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
f66fa771
Commit
f66fa771
authored
Feb 24, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: check for known dcb connector types
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
54abb5dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_bios.c
+61
-0
drivers/gpu/drm/nouveau/nouveau_bios.h
drivers/gpu/drm/nouveau/nouveau_bios.h
+1
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_bios.c
View file @
f66fa771
...
...
@@ -5173,6 +5173,43 @@ nouveau_bios_connector_entry(struct drm_device *dev, int index)
return
cte
;
}
static
enum
dcb_connector_type
divine_connector_type
(
struct
nvbios
*
bios
,
int
index
)
{
struct
dcb_table
*
dcb
=
&
bios
->
dcb
;
unsigned
encoders
=
0
,
type
=
DCB_CONNECTOR_NONE
;
int
i
;
for
(
i
=
0
;
i
<
dcb
->
entries
;
i
++
)
{
if
(
dcb
->
entry
[
i
].
connector
==
index
)
encoders
|=
(
1
<<
dcb
->
entry
[
i
].
type
);
}
if
(
encoders
&
(
1
<<
OUTPUT_DP
))
{
if
(
encoders
&
(
1
<<
OUTPUT_TMDS
))
type
=
DCB_CONNECTOR_DP
;
else
type
=
DCB_CONNECTOR_eDP
;
}
else
if
(
encoders
&
(
1
<<
OUTPUT_TMDS
))
{
if
(
encoders
&
(
1
<<
OUTPUT_ANALOG
))
type
=
DCB_CONNECTOR_DVI_I
;
else
type
=
DCB_CONNECTOR_DVI_D
;
}
else
if
(
encoders
&
(
1
<<
OUTPUT_ANALOG
))
{
type
=
DCB_CONNECTOR_VGA
;
}
else
if
(
encoders
&
(
1
<<
OUTPUT_LVDS
))
{
type
=
DCB_CONNECTOR_LVDS
;
}
else
if
(
encoders
&
(
1
<<
OUTPUT_TV
))
{
type
=
DCB_CONNECTOR_TV_0
;
}
return
type
;
}
static
void
parse_dcb_connector_table
(
struct
nvbios
*
bios
)
{
...
...
@@ -5205,6 +5242,7 @@ parse_dcb_connector_table(struct nvbios *bios)
cte
->
entry
=
ROM16
(
entry
[
0
]);
else
cte
->
entry
=
ROM32
(
entry
[
0
]);
cte
->
type
=
(
cte
->
entry
&
0x000000ff
)
>>
0
;
cte
->
index
=
(
cte
->
entry
&
0x00000f00
)
>>
8
;
switch
(
cte
->
entry
&
0x00033000
)
{
...
...
@@ -5230,6 +5268,29 @@ parse_dcb_connector_table(struct nvbios *bios)
NV_INFO
(
dev
,
" %d: 0x%08x: type 0x%02x idx %d tag 0x%02x
\n
"
,
i
,
cte
->
entry
,
cte
->
type
,
cte
->
index
,
cte
->
gpio_tag
);
/* check for known types, fallback to guessing the type
* from attached encoders if we hit an unknown.
*/
switch
(
cte
->
type
)
{
case
DCB_CONNECTOR_VGA
:
case
DCB_CONNECTOR_TV_0
:
case
DCB_CONNECTOR_TV_1
:
case
DCB_CONNECTOR_TV_3
:
case
DCB_CONNECTOR_DVI_I
:
case
DCB_CONNECTOR_DVI_D
:
case
DCB_CONNECTOR_LVDS
:
case
DCB_CONNECTOR_DP
:
case
DCB_CONNECTOR_eDP
:
case
DCB_CONNECTOR_HDMI_0
:
case
DCB_CONNECTOR_HDMI_1
:
break
;
default:
cte
->
type
=
divine_connector_type
(
bios
,
cte
->
index
);
NV_WARN
(
dev
,
"unknown type, using 0x%02x"
,
cte
->
type
);
break
;
}
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_bios.h
View file @
f66fa771
...
...
@@ -68,6 +68,7 @@ enum dcb_connector_type {
DCB_CONNECTOR_eDP
=
0x47
,
DCB_CONNECTOR_HDMI_0
=
0x60
,
DCB_CONNECTOR_HDMI_1
=
0x61
,
DCB_CONNECTOR_NONE
=
0xff
};
struct
dcb_connector_table_entry
{
...
...
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