Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
92854622
Commit
92854622
authored
Nov 11, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nvd0/disp: scaler updates, overscan compensation etc
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
2d1d898b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
33 deletions
+67
-33
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+3
-3
drivers/gpu/drm/nouveau/nvd0_display.c
drivers/gpu/drm/nouveau/nvd0_display.c
+64
-30
No files found.
drivers/gpu/drm/nouveau/nouveau_display.c
View file @
92854622
...
@@ -161,9 +161,9 @@ struct drm_prop_enum_list {
...
@@ -161,9 +161,9 @@ struct drm_prop_enum_list {
};
};
static
struct
drm_prop_enum_list
underscan
[]
=
{
static
struct
drm_prop_enum_list
underscan
[]
=
{
{
2
,
UNDERSCAN_AUTO
,
"auto"
},
{
6
,
UNDERSCAN_AUTO
,
"auto"
},
{
2
,
UNDERSCAN_OFF
,
"off"
},
{
6
,
UNDERSCAN_OFF
,
"off"
},
{
2
,
UNDERSCAN_ON
,
"on"
},
{
6
,
UNDERSCAN_ON
,
"on"
},
{}
{}
};
};
...
...
drivers/gpu/drm/nouveau/nvd0_display.c
View file @
92854622
...
@@ -160,49 +160,83 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
...
@@ -160,49 +160,83 @@ nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update)
static
int
static
int
nvd0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
nvd0_crtc_set_scale
(
struct
nouveau_crtc
*
nv_crtc
,
bool
update
)
{
{
struct
drm_display_mode
*
mode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_display_mode
*
omode
,
*
u
mode
=
&
nv_crtc
->
base
.
mode
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
drm_device
*
dev
=
nv_crtc
->
base
.
dev
;
struct
nouveau_connector
*
nv_connector
;
struct
nouveau_connector
*
nv_connector
;
u32
*
push
,
outX
,
outY
;
int
mode
=
DRM_MODE_SCALE_NONE
;
u32
oX
,
oY
,
*
push
;
outX
=
mode
->
hdisplay
;
outY
=
mode
->
vdisplay
;
/* start off at the resolution we programmed the crtc for, this
* effectively handles NONE/FULL scaling
*/
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
nv_connector
=
nouveau_crtc_connector_get
(
nv_crtc
);
if
(
nv_connector
&&
nv_connector
->
native_mode
)
{
if
(
nv_connector
&&
nv_connector
->
native_mode
)
struct
drm_display_mode
*
native
=
nv_connector
->
native_mode
;
mode
=
nv_connector
->
scaling_mode
;
u32
xratio
=
(
native
->
hdisplay
<<
19
)
/
mode
->
hdisplay
;
u32
yratio
=
(
native
->
vdisplay
<<
19
)
/
mode
->
vdisplay
;
if
(
mode
!=
DRM_MODE_SCALE_NONE
)
omode
=
nv_connector
->
native_mode
;
switch
(
nv_connector
->
scaling_mode
)
{
else
case
DRM_MODE_SCALE_ASPECT
:
omode
=
umode
;
if
(
xratio
>
yratio
)
{
outX
=
(
mode
->
hdisplay
*
yratio
)
>>
19
;
oX
=
omode
->
hdisplay
;
outY
=
(
mode
->
vdisplay
*
yratio
)
>>
19
;
oY
=
omode
->
vdisplay
;
}
else
{
if
(
omode
->
flags
&
DRM_MODE_FLAG_DBLSCAN
)
outX
=
(
mode
->
hdisplay
*
xratio
)
>>
19
;
oY
*=
2
;
outY
=
(
mode
->
vdisplay
*
xratio
)
>>
19
;
}
/* add overscan compensation if necessary, will keep the aspect
break
;
* ratio the same as the backend mode unless overridden by the
case
DRM_MODE_SCALE_FULLSCREEN
:
* user setting both hborder and vborder properties.
outX
=
native
->
hdisplay
;
*/
outY
=
native
->
vdisplay
;
if
(
nv_connector
&&
(
nv_connector
->
underscan
==
UNDERSCAN_ON
||
break
;
(
nv_connector
->
underscan
==
UNDERSCAN_AUTO
&&
default:
nv_connector
->
edid
&&
break
;
drm_detect_hdmi_monitor
(
nv_connector
->
edid
))))
{
u32
bX
=
nv_connector
->
underscan_hborder
;
u32
bY
=
nv_connector
->
underscan_vborder
;
u32
aspect
=
(
oY
<<
19
)
/
oX
;
if
(
bX
)
{
oX
-=
(
bX
*
2
);
if
(
bY
)
oY
-=
(
bY
*
2
);
else
oY
=
((
oX
*
aspect
)
+
(
aspect
/
2
))
>>
19
;
}
else
{
oX
-=
(
oX
>>
4
)
+
32
;
if
(
bY
)
oY
-=
(
bY
*
2
);
else
oY
=
((
oX
*
aspect
)
+
(
aspect
/
2
))
>>
19
;
}
}
}
}
/* handle CENTER/ASPECT scaling, taking into account the areas
* removed already for overscan compensation
*/
switch
(
mode
)
{
case
DRM_MODE_SCALE_CENTER
:
oX
=
min
((
u32
)
umode
->
hdisplay
,
oX
);
oY
=
min
((
u32
)
umode
->
vdisplay
,
oY
);
/* fall-through */
case
DRM_MODE_SCALE_ASPECT
:
if
(
oY
<
oX
)
{
u32
aspect
=
(
umode
->
hdisplay
<<
19
)
/
umode
->
vdisplay
;
oX
=
((
oY
*
aspect
)
+
(
aspect
/
2
))
>>
19
;
}
else
{
u32
aspect
=
(
umode
->
vdisplay
<<
19
)
/
umode
->
hdisplay
;
oY
=
((
oX
*
aspect
)
+
(
aspect
/
2
))
>>
19
;
}
break
;
default:
break
;
}
push
=
evo_wait
(
dev
,
0
,
16
);
push
=
evo_wait
(
dev
,
0
,
16
);
if
(
push
)
{
if
(
push
)
{
evo_mthd
(
push
,
0x04c0
+
(
nv_crtc
->
index
*
0x300
),
3
);
evo_mthd
(
push
,
0x04c0
+
(
nv_crtc
->
index
*
0x300
),
3
);
evo_data
(
push
,
(
o
utY
<<
16
)
|
out
X
);
evo_data
(
push
,
(
o
Y
<<
16
)
|
o
X
);
evo_data
(
push
,
(
o
utY
<<
16
)
|
out
X
);
evo_data
(
push
,
(
o
Y
<<
16
)
|
o
X
);
evo_data
(
push
,
(
o
utY
<<
16
)
|
out
X
);
evo_data
(
push
,
(
o
Y
<<
16
)
|
o
X
);
evo_mthd
(
push
,
0x0494
+
(
nv_crtc
->
index
*
0x300
),
1
);
evo_mthd
(
push
,
0x0494
+
(
nv_crtc
->
index
*
0x300
),
1
);
evo_data
(
push
,
0x00000000
);
evo_data
(
push
,
0x00000000
);
evo_mthd
(
push
,
0x04b8
+
(
nv_crtc
->
index
*
0x300
),
1
);
evo_mthd
(
push
,
0x04b8
+
(
nv_crtc
->
index
*
0x300
),
1
);
evo_data
(
push
,
(
mode
->
vdisplay
<<
16
)
|
mode
->
hdisplay
);
evo_data
(
push
,
(
umode
->
vdisplay
<<
16
)
|
u
mode
->
hdisplay
);
if
(
update
)
{
if
(
update
)
{
evo_mthd
(
push
,
0x0080
,
1
);
evo_mthd
(
push
,
0x0080
,
1
);
evo_data
(
push
,
0x00000000
);
evo_data
(
push
,
0x00000000
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment