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
be079e97
Commit
be079e97
authored
Feb 24, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: use dcb connector types throughout the driver
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
11575639
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
32 deletions
+41
-32
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+41
-32
No files found.
drivers/gpu/drm/nouveau/nouveau_connector.c
View file @
be079e97
...
...
@@ -218,7 +218,7 @@ nouveau_connector_set_encoder(struct drm_connector *connector,
connector
->
interlace_allowed
=
true
;
}
if
(
connector
->
connector_type
==
DRM_MODE_CONNECTOR_DVI
I
)
{
if
(
nv_connector
->
dcb
->
type
==
DCB_CONNECTOR_DVI_
I
)
{
drm_connector_property_set_value
(
connector
,
dev
->
mode_config
.
dvi_i_subconnector_property
,
nv_encoder
->
dcb
->
type
==
OUTPUT_TMDS
?
...
...
@@ -236,7 +236,7 @@ nouveau_connector_detect(struct drm_connector *connector)
struct
nouveau_i2c_chan
*
i2c
;
int
type
,
flags
;
if
(
connector
->
connector_type
==
DRM_MODE
_CONNECTOR_LVDS
)
if
(
nv_connector
->
dcb
->
type
==
DCB
_CONNECTOR_LVDS
)
nv_encoder
=
find_encoder_by_type
(
connector
,
OUTPUT_LVDS
);
if
(
nv_encoder
&&
nv_connector
->
native_mode
)
{
#ifdef CONFIG_ACPI
...
...
@@ -279,7 +279,7 @@ nouveau_connector_detect(struct drm_connector *connector)
* same i2c channel so the value returned from ddc_detect
* isn't necessarily correct.
*/
if
(
connector
->
connector_type
==
DRM_MODE_CONNECTOR_DVI
I
)
{
if
(
nv_connector
->
dcb
->
type
==
DCB_CONNECTOR_DVI_
I
)
{
if
(
nv_connector
->
edid
->
input
&
DRM_EDID_INPUT_DIGITAL
)
type
=
OUTPUT_TMDS
;
else
...
...
@@ -321,11 +321,11 @@ nouveau_connector_detect(struct drm_connector *connector)
static
void
nouveau_connector_force
(
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
nouveau_connector
*
nv_connector
=
nouveau_connector
(
connector
)
;
struct
nouveau_encoder
*
nv_encoder
;
int
type
;
if
(
connector
->
connector_type
==
DRM_MODE_CONNECTOR_DVI
I
)
{
if
(
nv_connector
->
dcb
->
type
==
DCB_CONNECTOR_DVI_
I
)
{
if
(
connector
->
force
==
DRM_FORCE_ON_DIGITAL
)
type
=
OUTPUT_TMDS
;
else
...
...
@@ -335,7 +335,7 @@ nouveau_connector_force(struct drm_connector *connector)
nv_encoder
=
find_encoder_by_type
(
connector
,
type
);
if
(
!
nv_encoder
)
{
NV_ERROR
(
dev
,
"can't find encoder to force %s on!
\n
"
,
NV_ERROR
(
connector
->
dev
,
"can't find encoder to force %s on!
\n
"
,
drm_get_connector_name
(
connector
));
connector
->
status
=
connector_status_disconnected
;
return
;
...
...
@@ -369,7 +369,7 @@ nouveau_connector_set_property(struct drm_connector *connector,
}
/* LVDS always needs gpu scaling */
if
(
connector
->
connector_type
==
DRM_MODE
_CONNECTOR_LVDS
&&
if
(
nv_connector
->
dcb
->
type
==
DCB
_CONNECTOR_LVDS
&&
value
==
DRM_MODE_SCALE_NONE
)
return
-
EINVAL
;
...
...
@@ -535,7 +535,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
/* If we're not LVDS, destroy the previous native mode, the attached
* monitor could have changed.
*/
if
(
connector
->
connector_type
!=
DRM_MODE
_CONNECTOR_LVDS
&&
if
(
nv_connector
->
dcb
->
type
!=
DCB
_CONNECTOR_LVDS
&&
nv_connector
->
native_mode
)
{
drm_mode_destroy
(
dev
,
nv_connector
->
native_mode
);
nv_connector
->
native_mode
=
NULL
;
...
...
@@ -563,7 +563,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
ret
=
get_slave_funcs
(
nv_encoder
)
->
get_modes
(
to_drm_encoder
(
nv_encoder
),
connector
);
if
(
connector
->
connector_type
==
DRM_MODE_CONNECTOR
_LVDS
)
if
(
nv_encoder
->
dcb
->
type
==
OUTPUT
_LVDS
)
ret
+=
nouveau_connector_scaler_modes_add
(
connector
);
return
ret
;
...
...
@@ -771,20 +771,26 @@ nouveau_connector_create(struct drm_device *dev,
type
=
DRM_MODE_CONNECTOR_DVII
;
break
;
case
DCB_CONNECTOR_DVI_D
:
case
DCB_CONNECTOR_HDMI_0
:
case
DCB_CONNECTOR_HDMI_1
:
NV_INFO
(
dev
,
"Detected a DVI-D connector
\n
"
);
type
=
DRM_MODE_CONNECTOR_DVID
;
break
;
case
DCB_CONNECTOR_HDMI_0
:
case
DCB_CONNECTOR_HDMI_1
:
NV_INFO
(
dev
,
"Detected a HDMI connector
\n
"
);
type
=
DRM_MODE_CONNECTOR_HDMIA
;
break
;
case
DCB_CONNECTOR_LVDS
:
NV_INFO
(
dev
,
"Detected a LVDS connector
\n
"
);
type
=
DRM_MODE_CONNECTOR_LVDS
;
break
;
case
DCB_CONNECTOR_DP
:
case
DCB_CONNECTOR_eDP
:
NV_INFO
(
dev
,
"Detected a DisplayPort connector
\n
"
);
type
=
DRM_MODE_CONNECTOR_DisplayPort
;
break
;
case
DCB_CONNECTOR_eDP
:
NV_INFO
(
dev
,
"Detected an eDP connector
\n
"
);
type
=
DRM_MODE_CONNECTOR_eDP
;
break
;
default:
NV_ERROR
(
dev
,
"unknown connector type: 0x%02x!!
\n
"
,
dcb
->
type
);
return
-
EINVAL
;
...
...
@@ -824,41 +830,44 @@ nouveau_connector_create(struct drm_device *dev,
}
/* Init DVI-I specific properties */
if
(
type
==
DRM_MODE_CONNECTOR_DVI
I
)
{
if
(
dcb
->
type
==
DCB_CONNECTOR_DVI_
I
)
{
drm_mode_create_dvi_i_properties
(
dev
);
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
dvi_i_subconnector_property
,
0
);
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
dvi_i_select_subconnector_property
,
0
);
}
if
(
type
!=
DRM_MODE
_CONNECTOR_LVDS
)
if
(
dcb
->
type
!=
DCB
_CONNECTOR_LVDS
)
nv_connector
->
use_dithering
=
false
;
if
(
type
==
DRM_MODE_CONNECTOR_DVID
||
type
==
DRM_MODE_CONNECTOR_DVII
||
type
==
DRM_MODE_CONNECTOR_LVDS
||
type
==
DRM_MODE_CONNECTOR_DisplayPort
)
{
nv_connector
->
scaling_mode
=
DRM_MODE_SCALE_FULLSCREEN
;
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
scaling_mode_property
,
switch
(
dcb
->
type
)
{
case
DCB_CONNECTOR_VGA
:
if
(
dev_priv
->
card_type
>=
NV_50
)
{
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
scaling_mode_property
,
nv_connector
->
scaling_mode
);
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
dithering_mode_property
,
nv_connector
->
use_dithering
?
DRM_MODE_DITHERING_ON
:
DRM_MODE_DITHERING_OFF
);
}
else
{
}
/* fall-through */
case
DCB_CONNECTOR_TV_0
:
case
DCB_CONNECTOR_TV_1
:
case
DCB_CONNECTOR_TV_3
:
nv_connector
->
scaling_mode
=
DRM_MODE_SCALE_NONE
;
break
;
default:
nv_connector
->
scaling_mode
=
DRM_MODE_SCALE_FULLSCREEN
;
if
(
type
==
DRM_MODE_CONNECTOR_VGA
&&
dev_priv
->
card_type
>=
NV_50
)
{
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
scaling_mode_property
,
nv_connector
->
scaling_mode
);
}
drm_connector_attach_property
(
connector
,
dev
->
mode_config
.
dithering_mode_property
,
nv_connector
->
use_dithering
?
DRM_MODE_DITHERING_ON
:
DRM_MODE_DITHERING_OFF
);
break
;
}
drm_sysfs_connector_add
(
connector
);
if
(
connector
->
connector_type
==
DRM_MODE
_CONNECTOR_LVDS
)
{
if
(
dcb
->
type
==
DCB
_CONNECTOR_LVDS
)
{
ret
=
nouveau_connector_create_lvds
(
dev
,
connector
);
if
(
ret
)
{
connector
->
funcs
->
destroy
(
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