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
Kirill Smelkov
linux
Commits
a91d3221
Commit
a91d3221
authored
Dec 22, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50-/kms: move identical scaler mode fixup code into a function
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
495b2176
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
54 deletions
+24
-54
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nv50_display.c
+24
-54
No files found.
drivers/gpu/drm/nouveau/nv50_display.c
View file @
a91d3221
...
...
@@ -1465,6 +1465,26 @@ nv50_crtc_create(struct drm_device *dev, int index)
return
ret
;
}
/******************************************************************************
* Encoder helpers
*****************************************************************************/
static
bool
nv50_encoder_mode_fixup
(
struct
drm_encoder
*
encoder
,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_connector
*
nv_connector
;
nv_connector
=
nouveau_encoder_connector_get
(
nv_encoder
);
if
(
nv_connector
&&
nv_connector
->
native_mode
)
{
if
(
nv_connector
->
scaling_mode
!=
DRM_MODE_SCALE_NONE
)
drm_mode_copy
(
adjusted_mode
,
nv_connector
->
native_mode
);
}
return
true
;
}
/******************************************************************************
* DAC
*****************************************************************************/
...
...
@@ -1492,26 +1512,6 @@ nv50_dac_dpms(struct drm_encoder *encoder, int mode)
nvif_mthd
(
disp
->
disp
,
0
,
&
args
,
sizeof
(
args
));
}
static
bool
nv50_dac_mode_fixup
(
struct
drm_encoder
*
encoder
,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_connector
*
nv_connector
;
nv_connector
=
nouveau_encoder_connector_get
(
nv_encoder
);
if
(
nv_connector
&&
nv_connector
->
native_mode
)
{
if
(
nv_connector
->
scaling_mode
!=
DRM_MODE_SCALE_NONE
)
{
int
id
=
adjusted_mode
->
base
.
id
;
*
adjusted_mode
=
*
nv_connector
->
native_mode
;
adjusted_mode
->
base
.
id
=
id
;
}
}
return
true
;
}
static
void
nv50_dac_commit
(
struct
drm_encoder
*
encoder
)
{
...
...
@@ -1629,7 +1629,7 @@ nv50_dac_destroy(struct drm_encoder *encoder)
static
const
struct
drm_encoder_helper_funcs
nv50_dac_hfunc
=
{
.
dpms
=
nv50_dac_dpms
,
.
mode_fixup
=
nv50_
dac
_mode_fixup
,
.
mode_fixup
=
nv50_
encoder
_mode_fixup
,
.
prepare
=
nv50_dac_disconnect
,
.
commit
=
nv50_dac_commit
,
.
mode_set
=
nv50_dac_mode_set
,
...
...
@@ -1834,26 +1834,6 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode)
}
}
static
bool
nv50_sor_mode_fixup
(
struct
drm_encoder
*
encoder
,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_connector
*
nv_connector
;
nv_connector
=
nouveau_encoder_connector_get
(
nv_encoder
);
if
(
nv_connector
&&
nv_connector
->
native_mode
)
{
if
(
nv_connector
->
scaling_mode
!=
DRM_MODE_SCALE_NONE
)
{
int
id
=
adjusted_mode
->
base
.
id
;
*
adjusted_mode
=
*
nv_connector
->
native_mode
;
adjusted_mode
->
base
.
id
=
id
;
}
}
return
true
;
}
static
void
nv50_sor_ctrl
(
struct
nouveau_encoder
*
nv_encoder
,
u32
mask
,
u32
data
)
{
...
...
@@ -2035,7 +2015,7 @@ nv50_sor_destroy(struct drm_encoder *encoder)
static
const
struct
drm_encoder_helper_funcs
nv50_sor_hfunc
=
{
.
dpms
=
nv50_sor_dpms
,
.
mode_fixup
=
nv50_
so
r_mode_fixup
,
.
mode_fixup
=
nv50_
encode
r_mode_fixup
,
.
prepare
=
nv50_sor_disconnect
,
.
commit
=
nv50_sor_commit
,
.
mode_set
=
nv50_sor_mode_set
,
...
...
@@ -2112,18 +2092,8 @@ nv50_pior_mode_fixup(struct drm_encoder *encoder,
const
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
{
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_connector
*
nv_connector
;
nv_connector
=
nouveau_encoder_connector_get
(
nv_encoder
);
if
(
nv_connector
&&
nv_connector
->
native_mode
)
{
if
(
nv_connector
->
scaling_mode
!=
DRM_MODE_SCALE_NONE
)
{
int
id
=
adjusted_mode
->
base
.
id
;
*
adjusted_mode
=
*
nv_connector
->
native_mode
;
adjusted_mode
->
base
.
id
=
id
;
}
}
if
(
!
nv50_encoder_mode_fixup
(
encoder
,
mode
,
adjusted_mode
))
return
false
;
adjusted_mode
->
clock
*=
2
;
return
true
;
}
...
...
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