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
63221755
Commit
63221755
authored
Oct 17, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: determine a value for display_info.bpc if edid doesn't
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
9976f15c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+46
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_connector.c
View file @
63221755
...
...
@@ -644,6 +644,46 @@ nouveau_connector_scaler_modes_add(struct drm_connector *connector)
return
modes
;
}
static
void
nouveau_connector_detect_depth
(
struct
drm_connector
*
connector
)
{
struct
drm_nouveau_private
*
dev_priv
=
connector
->
dev
->
dev_private
;
struct
nouveau_connector
*
nv_connector
=
nouveau_connector
(
connector
);
struct
nouveau_encoder
*
nv_encoder
=
nv_connector
->
detected_encoder
;
struct
nvbios
*
bios
=
&
dev_priv
->
vbios
;
struct
drm_display_mode
*
mode
=
nv_connector
->
native_mode
;
bool
duallink
;
/* if the edid is feeling nice enough to provide this info, use it */
if
(
nv_connector
->
edid
&&
connector
->
display_info
.
bpc
)
return
;
/* if not, we're out of options unless we're LVDS, default to 6bpc */
connector
->
display_info
.
bpc
=
6
;
if
(
nv_encoder
->
dcb
->
type
!=
OUTPUT_LVDS
)
return
;
/* LVDS: panel straps */
if
(
bios
->
fp_no_ddc
)
{
if
(
bios
->
fp
.
if_is_24bit
)
connector
->
display_info
.
bpc
=
8
;
return
;
}
/* LVDS: DDC panel, need to first determine the number of links to
* know which if_is_24bit flag to check...
*/
if
(
nv_connector
->
edid
&&
nv_connector
->
dcb
->
type
==
DCB_CONNECTOR_LVDS_SPWG
)
duallink
=
((
u8
*
)
nv_connector
->
edid
)[
121
]
==
2
;
else
duallink
=
mode
->
clock
>=
bios
->
fp
.
duallink_transition_clk
;
if
((
!
duallink
&&
(
bios
->
fp
.
strapless_is_24bit
&
1
))
||
(
duallink
&&
(
bios
->
fp
.
strapless_is_24bit
&
2
)))
connector
->
display_info
.
bpc
=
8
;
}
static
int
nouveau_connector_get_modes
(
struct
drm_connector
*
connector
)
{
...
...
@@ -688,6 +728,12 @@ nouveau_connector_get_modes(struct drm_connector *connector)
ret
=
1
;
}
/* Attempt to determine display colour depth, this has to happen after
* we've determined the "native" mode for LVDS, as the VBIOS tables
* require us to compare against a pixel clock in some cases..
*/
nouveau_connector_detect_depth
(
connector
);
if
(
nv_encoder
->
dcb
->
type
==
OUTPUT_TV
)
ret
=
get_slave_funcs
(
encoder
)
->
get_modes
(
encoder
,
connector
);
...
...
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