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
7ebb38b5
Commit
7ebb38b5
authored
Nov 09, 2012
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50/disp: call into core for dac load detection
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
ef22c8bb
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
51 deletions
+22
-51
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c
+3
-3
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
+2
-2
drivers/gpu/drm/nouveau/core/engine/disp/nv84.c
drivers/gpu/drm/nouveau/core/engine/disp/nv84.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nva0.c
drivers/gpu/drm/nouveau/core/engine/disp/nva0.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
+1
-0
drivers/gpu/drm/nouveau/nv50_dac.c
drivers/gpu/drm/nouveau/nv50_dac.c
+11
-45
drivers/gpu/drm/nouveau/nvd0_display.c
drivers/gpu/drm/nouveau/nvd0_display.c
+1
-1
No files found.
drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c
View file @
7ebb38b5
...
...
@@ -46,11 +46,11 @@ nv50_dac_power(struct nv50_disp_priv *priv, int or, u32 data)
}
int
nv50_dac_sense
(
struct
nv50_disp_priv
*
priv
,
int
or
)
nv50_dac_sense
(
struct
nv50_disp_priv
*
priv
,
int
or
,
u32
loadval
)
{
const
u32
doff
=
(
or
*
0x800
);
int
load
=
-
EINVAL
;
nv_wr32
(
priv
,
0x61a00c
+
doff
,
0x00100000
);
nv_wr32
(
priv
,
0x61a00c
+
doff
,
0x00100000
|
loadval
);
udelay
(
9500
);
nv_wr32
(
priv
,
0x61a00c
+
doff
,
0x80000000
);
load
=
(
nv_rd32
(
priv
,
0x61a00c
+
doff
)
&
0x38000000
)
>>
27
;
...
...
@@ -74,7 +74,7 @@ nv50_dac_mthd(struct nouveau_object *object, u32 mthd, void *args, u32 size)
ret
=
priv
->
dac
.
power
(
priv
,
or
,
data
[
0
]);
break
;
case
NV50_DISP_DAC_LOAD
:
ret
=
priv
->
dac
.
sense
(
priv
,
or
);
ret
=
priv
->
dac
.
sense
(
priv
,
or
,
data
[
0
]
);
if
(
ret
>=
0
)
{
data
[
0
]
=
ret
;
ret
=
0
;
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
View file @
7ebb38b5
...
...
@@ -807,6 +807,7 @@ nv50_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
2
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
INIT_LIST_HEAD
(
&
priv
->
base
.
vblank
.
list
);
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv50.h
View file @
7ebb38b5
...
...
@@ -19,7 +19,7 @@ struct nv50_disp_priv {
struct
{
int
nr
;
int
(
*
power
)(
struct
nv50_disp_priv
*
,
int
dac
,
u32
data
);
int
(
*
sense
)(
struct
nv50_disp_priv
*
,
int
dac
);
int
(
*
sense
)(
struct
nv50_disp_priv
*
,
int
dac
,
u32
load
);
}
dac
;
struct
{
int
nr
;
...
...
@@ -42,7 +42,7 @@ struct nv50_disp_priv {
int
nv50_dac_mthd
(
struct
nouveau_object
*
,
u32
,
void
*
,
u32
);
int
nv50_dac_power
(
struct
nv50_disp_priv
*
,
int
,
u32
);
int
nv50_dac_sense
(
struct
nv50_disp_priv
*
,
int
);
int
nv50_dac_sense
(
struct
nv50_disp_priv
*
,
int
,
u32
);
#define SOR_MTHD(n) (n), (n) + 0x3f
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv84.c
View file @
7ebb38b5
...
...
@@ -76,6 +76,7 @@ nv84_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
2
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
INIT_LIST_HEAD
(
&
priv
->
base
.
vblank
.
list
);
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv94.c
View file @
7ebb38b5
...
...
@@ -82,6 +82,7 @@ nv94_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
4
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
INIT_LIST_HEAD
(
&
priv
->
base
.
vblank
.
list
);
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nva0.c
View file @
7ebb38b5
...
...
@@ -67,6 +67,7 @@ nva0_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
2
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
INIT_LIST_HEAD
(
&
priv
->
base
.
vblank
.
list
);
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nva3.c
View file @
7ebb38b5
...
...
@@ -83,6 +83,7 @@ nva3_disp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
priv
->
dac
.
nr
=
3
;
priv
->
sor
.
nr
=
4
;
priv
->
dac
.
power
=
nv50_dac_power
;
priv
->
dac
.
sense
=
nv50_dac_sense
;
priv
->
sor
.
power
=
nv50_sor_power
;
INIT_LIST_HEAD
(
&
priv
->
base
.
vblank
.
list
);
...
...
drivers/gpu/drm/nouveau/nv50_dac.c
View file @
7ebb38b5
...
...
@@ -71,56 +71,22 @@ nv50_dac_disconnect(struct drm_encoder *encoder)
static
enum
drm_connector_status
nv50_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
{
struct
nv50_display
*
priv
=
nv50_display
(
encoder
->
dev
);
struct
nouveau_encoder
*
nv_encoder
=
nouveau_encoder
(
encoder
);
struct
nouveau_device
*
device
=
nouveau_dev
(
encoder
->
dev
);
struct
nouveau_drm
*
drm
=
nouveau_drm
(
encoder
->
dev
);
enum
drm_connector_status
status
=
connector_status_disconnected
;
uint32_t
dpms_state
,
load_pattern
,
load_state
;
int
or
=
nv_encoder
->
or
;
nv_wr32
(
device
,
NV50_PDISPLAY_DAC_CLK_CTRL1
(
or
),
0x00000001
);
dpms_state
=
nv_rd32
(
device
,
NV50_PDISPLAY_DAC_DPMS_CTRL
(
or
));
nv_wr32
(
device
,
NV50_PDISPLAY_DAC_DPMS_CTRL
(
or
),
0x00150000
|
NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING
);
if
(
!
nv_wait
(
device
,
NV50_PDISPLAY_DAC_DPMS_CTRL
(
or
),
NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING
,
0
))
{
NV_ERROR
(
drm
,
"timeout: DAC_DPMS_CTRL_PENDING(%d) == 0
\n
"
,
or
);
NV_ERROR
(
drm
,
"DAC_DPMS_CTRL(%d) = 0x%08x
\n
"
,
or
,
nv_rd32
(
device
,
NV50_PDISPLAY_DAC_DPMS_CTRL
(
or
)));
return
status
;
}
/* Use bios provided value if possible. */
if
(
drm
->
vbios
.
dactestval
)
{
load_pattern
=
drm
->
vbios
.
dactestval
;
NV_DEBUG
(
drm
,
"Using bios provided load_pattern of %d
\n
"
,
load_pattern
);
}
else
{
load_pattern
=
340
;
NV_DEBUG
(
drm
,
"Using default load_pattern of %d
\n
"
,
load_pattern
);
}
nv_wr32
(
device
,
NV50_PDISPLAY_DAC_LOAD_CTRL
(
or
),
NV50_PDISPLAY_DAC_LOAD_CTRL_ACTIVE
|
load_pattern
);
mdelay
(
45
);
/* give it some time to process */
load_state
=
nv_rd32
(
device
,
NV50_PDISPLAY_DAC_LOAD_CTRL
(
or
));
nv_wr32
(
device
,
NV50_PDISPLAY_DAC_LOAD_CTRL
(
or
),
0
);
nv_wr32
(
device
,
NV50_PDISPLAY_DAC_DPMS_CTRL
(
or
),
dpms_state
|
NV50_PDISPLAY_DAC_DPMS_CTRL_PENDING
);
int
or
=
nv_encoder
->
or
,
ret
;
u32
load
;
if
((
load_state
&
NV50_PDISPLAY_DAC_LOAD_CTRL_PRESENT
)
==
NV50_PDISPLAY_DAC_LOAD_CTRL_PRESENT
)
status
=
connector_status_connected
;
if
(
status
==
connector_status_connected
)
NV_DEBUG
(
drm
,
"Load was detected on output with or %d
\n
"
,
or
);
if
(
drm
->
vbios
.
dactestval
)
load
=
drm
->
vbios
.
dactestval
;
else
NV_DEBUG
(
drm
,
"Load was not detected on output with or %d
\n
"
,
or
);
load
=
340
;
ret
=
nv_exec
(
priv
->
core
,
NV50_DISP_DAC_LOAD
+
or
,
&
load
,
sizeof
(
load
));
if
(
ret
||
load
!=
7
)
return
connector_status_disconnected
;
return
status
;
return
connector_status_connected
;
}
static
void
...
...
drivers/gpu/drm/nouveau/nvd0_display.c
View file @
7ebb38b5
...
...
@@ -1176,7 +1176,7 @@ nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
{
struct
nvd0_disp
*
disp
=
nvd0_disp
(
encoder
->
dev
);
int
ret
,
or
=
nouveau_encoder
(
encoder
)
->
or
;
u32
load
;
u32
load
=
0
;
ret
=
nv_exec
(
disp
->
core
,
NV50_DISP_DAC_LOAD
+
or
,
&
load
,
sizeof
(
load
));
if
(
ret
||
load
!=
7
)
...
...
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