Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
02076da9
Commit
02076da9
authored
Dec 17, 2009
by
Francisco Jerez
Committed by
Dave Airlie
Jan 11, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: Clean up the nv17-nv4x load detection code a bit.
Signed-off-by:
Francisco Jerez
<
currojerez@riseup.net
>
parent
e55ca7e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
31 deletions
+37
-31
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-5
drivers/gpu/drm/nouveau/nv04_dac.c
drivers/gpu/drm/nouveau/nv04_dac.c
+19
-16
drivers/gpu/drm/nouveau/nv17_tv.c
drivers/gpu/drm/nouveau/nv17_tv.c
+17
-10
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
02076da9
...
...
@@ -1074,8 +1074,7 @@ extern long nouveau_compat_ioctl(struct file *file, unsigned int cmd,
/* nv04_dac.c */
extern
int
nv04_dac_create
(
struct
drm_device
*
dev
,
struct
dcb_entry
*
entry
);
extern
enum
drm_connector_status
nv17_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
);
extern
uint32_t
nv17_dac_sample_load
(
struct
drm_encoder
*
encoder
);
extern
int
nv04_dac_output_offset
(
struct
drm_encoder
*
encoder
);
extern
void
nv04_dac_update_dacclk
(
struct
drm_encoder
*
encoder
,
bool
enable
);
...
...
@@ -1093,9 +1092,6 @@ extern int nv04_tv_create(struct drm_device *dev, struct dcb_entry *entry);
/* nv17_tv.c */
extern
int
nv17_tv_create
(
struct
drm_device
*
dev
,
struct
dcb_entry
*
entry
);
extern
enum
drm_connector_status
nv17_tv_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
,
uint32_t
pin_mask
);
/* nv04_display.c */
extern
int
nv04_display_create
(
struct
drm_device
*
);
...
...
drivers/gpu/drm/nouveau/nv04_dac.c
View file @
02076da9
...
...
@@ -212,16 +212,15 @@ out:
return
connector_status_disconnected
;
}
enum
drm_connector_status
nv17_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
uint32_t
nv17_dac_sample_load
(
struct
drm_encoder
*
encoder
)
{
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
dcb_entry
*
dcb
=
nouveau_encoder
(
encoder
)
->
dcb
;
uint32_t
testval
,
regoffset
=
nv04_dac_output_offset
(
encoder
);
uint32_t
sample
,
testval
,
regoffset
=
nv04_dac_output_offset
(
encoder
);
uint32_t
saved_powerctrl_2
=
0
,
saved_powerctrl_4
=
0
,
saved_routput
,
saved_rtest_ctrl
,
saved_gpio0
,
saved_gpio1
,
temp
,
routput
;
int
head
,
present
=
0
;
int
head
;
#define RGB_TEST_DATA(r, g, b) (r << 0 | g << 10 | b << 20)
if
(
dcb
->
type
==
OUTPUT_TV
)
{
...
...
@@ -287,13 +286,7 @@ enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder,
temp
|
NV_PRAMDAC_TEST_CONTROL_TP_INS_EN_ASSERTED
);
msleep
(
5
);
temp
=
NVReadRAMDAC
(
dev
,
0
,
NV_PRAMDAC_TEST_CONTROL
+
regoffset
);
if
(
dcb
->
type
==
OUTPUT_TV
)
present
=
(
nv17_tv_detect
(
encoder
,
connector
,
temp
)
==
connector_status_connected
);
else
present
=
temp
&
NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI
;
sample
=
NVReadRAMDAC
(
dev
,
0
,
NV_PRAMDAC_TEST_CONTROL
+
regoffset
);
temp
=
NVReadRAMDAC
(
dev
,
head
,
NV_PRAMDAC_TEST_CONTROL
);
NVWriteRAMDAC
(
dev
,
head
,
NV_PRAMDAC_TEST_CONTROL
,
...
...
@@ -310,15 +303,25 @@ enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder,
nv17_gpio_set
(
dev
,
DCB_GPIO_TVDAC1
,
saved_gpio1
);
nv17_gpio_set
(
dev
,
DCB_GPIO_TVDAC0
,
saved_gpio0
);
if
(
present
)
{
NV_INFO
(
dev
,
"Load detected on output %c
\n
"
,
'@'
+
ffs
(
dcb
->
or
));
return
sample
;
}
static
enum
drm_connector_status
nv17_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
dcb_entry
*
dcb
=
nouveau_encoder
(
encoder
)
->
dcb
;
uint32_t
sample
=
nv17_dac_sample_load
(
encoder
);
if
(
sample
&
NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI
)
{
NV_INFO
(
dev
,
"Load detected on output %c
\n
"
,
'@'
+
ffs
(
dcb
->
or
));
return
connector_status_connected
;
}
else
{
return
connector_status_disconnected
;
}
return
connector_status_disconnected
;
}
static
bool
nv04_dac_mode_fixup
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
...
...
drivers/gpu/drm/nouveau/nv17_tv.c
View file @
02076da9
...
...
@@ -33,13 +33,15 @@
#include "nouveau_hw.h"
#include "nv17_tv.h"
enum
drm_connector_status
nv17_tv_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
,
uint32_t
pin_mask
)
static
enum
drm_connector_status
nv17_tv_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
drm_mode_config
*
conf
=
&
dev
->
mode_config
;
struct
nv17_tv_encoder
*
tv_enc
=
to_tv_enc
(
encoder
);
struct
dcb_entry
*
dcb
=
tv_enc
->
base
.
dcb
;
tv_enc
->
pin_mask
=
pin_mask
>>
28
&
0xe
;
tv_enc
->
pin_mask
=
nv17_dac_sample_load
(
encoder
)
>>
28
&
0xe
;
switch
(
tv_enc
->
pin_mask
)
{
case
0x2
:
...
...
@@ -50,7 +52,7 @@ enum drm_connector_status nv17_tv_detect(struct drm_encoder *encoder,
tv_enc
->
subconnector
=
DRM_MODE_SUBCONNECTOR_SVIDEO
;
break
;
case
0xe
:
if
(
nouveau_encoder
(
encoder
)
->
dcb
->
tvconf
.
has_component_output
)
if
(
dcb
->
tvconf
.
has_component_output
)
tv_enc
->
subconnector
=
DRM_MODE_SUBCONNECTOR_Component
;
else
tv_enc
->
subconnector
=
DRM_MODE_SUBCONNECTOR_SCART
;
...
...
@@ -61,11 +63,16 @@ enum drm_connector_status nv17_tv_detect(struct drm_encoder *encoder,
}
drm_connector_property_set_value
(
connector
,
encoder
->
dev
->
mode_config
.
tv_subconnector_property
,
tv_enc
->
subconnector
);
conf
->
tv_subconnector_property
,
tv_enc
->
subconnector
);
return
tv_enc
->
subconnector
?
connector_status_connected
:
connector_status_disconnected
;
if
(
tv_enc
->
subconnector
)
{
NV_INFO
(
dev
,
"Load detected on output %c
\n
"
,
'@'
+
ffs
(
dcb
->
or
));
return
connector_status_connected
;
}
else
{
return
connector_status_disconnected
;
}
}
static
const
struct
{
...
...
@@ -633,7 +640,7 @@ static struct drm_encoder_helper_funcs nv17_tv_helper_funcs = {
.
prepare
=
nv17_tv_prepare
,
.
commit
=
nv17_tv_commit
,
.
mode_set
=
nv17_tv_mode_set
,
.
detect
=
nv17_
dac
_detect
,
.
detect
=
nv17_
tv
_detect
,
};
static
struct
drm_encoder_slave_funcs
nv17_tv_slave_funcs
=
{
...
...
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