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
27cc60a1
Commit
27cc60a1
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/mxm: switch to subdev printk macros
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
85ae830f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
33 deletions
+39
-33
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c
+19
-15
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c
+13
-13
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c
+7
-5
No files found.
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c
View file @
27cc60a1
...
...
@@ -78,7 +78,8 @@ mxm_shadow_rom(struct nvkm_mxm *mxm, u8 version)
static
bool
mxm_shadow_dsm
(
struct
nvkm_mxm
*
mxm
,
u8
version
)
{
struct
nvkm_device
*
device
=
nv_device
(
mxm
);
struct
nvkm_subdev
*
subdev
=
&
mxm
->
subdev
;
struct
nvkm_device
*
device
=
subdev
->
device
;
static
char
muid
[]
=
{
0x00
,
0xA4
,
0x04
,
0x40
,
0x7D
,
0x91
,
0xF2
,
0x4C
,
0xB8
,
0x9C
,
0x79
,
0xB6
,
0x2F
,
0xD5
,
0x56
,
0x65
...
...
@@ -105,7 +106,7 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
rev
=
(
version
&
0xf0
)
<<
4
|
(
version
&
0x0f
);
obj
=
acpi_evaluate_dsm
(
handle
,
muid
,
rev
,
0x00000010
,
&
argv4
);
if
(
!
obj
)
{
nv
_debug
(
mxm
,
"DSM MXMS failed
\n
"
);
nv
km_debug
(
subdev
,
"DSM MXMS failed
\n
"
);
return
false
;
}
...
...
@@ -113,7 +114,8 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
mxm
->
mxms
=
kmemdup
(
obj
->
buffer
.
pointer
,
obj
->
buffer
.
length
,
GFP_KERNEL
);
}
else
if
(
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
nv_debug
(
mxm
,
"DSM MXMS returned 0x%llx
\n
"
,
obj
->
integer
.
value
);
nvkm_debug
(
subdev
,
"DSM MXMS returned 0x%llx
\n
"
,
obj
->
integer
.
value
);
}
ACPI_FREE
(
obj
);
...
...
@@ -128,6 +130,7 @@ mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
static
u8
wmi_wmmx_mxmi
(
struct
nvkm_mxm
*
mxm
,
u8
version
)
{
struct
nvkm_subdev
*
subdev
=
&
mxm
->
subdev
;
u32
mxmi_args
[]
=
{
0x494D584D
/* MXMI */
,
version
,
0
};
struct
acpi_buffer
args
=
{
sizeof
(
mxmi_args
),
mxmi_args
};
struct
acpi_buffer
retn
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
...
...
@@ -136,18 +139,18 @@ wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
status
=
wmi_evaluate_method
(
WMI_WMMX_GUID
,
0
,
0
,
&
args
,
&
retn
);
if
(
ACPI_FAILURE
(
status
))
{
nv
_debug
(
mxm
,
"WMMX MXMI returned %d
\n
"
,
status
);
nv
km_debug
(
subdev
,
"WMMX MXMI returned %d
\n
"
,
status
);
return
0x00
;
}
obj
=
retn
.
pointer
;
if
(
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
version
=
obj
->
integer
.
value
;
nv
_debug
(
mxm
,
"WMMX MXMI version %d.%d
\n
"
,
(
version
>>
4
),
version
&
0x0f
);
nv
km_debug
(
subdev
,
"WMMX MXMI version %d.%d
\n
"
,
(
version
>>
4
),
version
&
0x0f
);
}
else
{
version
=
0
;
nv
_debug
(
mxm
,
"WMMX MXMI returned non-integer
\n
"
);
nv
km_debug
(
subdev
,
"WMMX MXMI returned non-integer
\n
"
);
}
kfree
(
obj
);
...
...
@@ -157,6 +160,7 @@ wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
static
bool
mxm_shadow_wmi
(
struct
nvkm_mxm
*
mxm
,
u8
version
)
{
struct
nvkm_subdev
*
subdev
=
&
mxm
->
subdev
;
u32
mxms_args
[]
=
{
0x534D584D
/* MXMS */
,
version
,
0
};
struct
acpi_buffer
args
=
{
sizeof
(
mxms_args
),
mxms_args
};
struct
acpi_buffer
retn
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
...
...
@@ -164,7 +168,7 @@ mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
acpi_status
status
;
if
(
!
wmi_has_guid
(
WMI_WMMX_GUID
))
{
nv
_debug
(
mxm
,
"WMMX GUID not found
\n
"
);
nv
km_debug
(
subdev
,
"WMMX GUID not found
\n
"
);
return
false
;
}
...
...
@@ -176,7 +180,7 @@ mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
status
=
wmi_evaluate_method
(
WMI_WMMX_GUID
,
0
,
0
,
&
args
,
&
retn
);
if
(
ACPI_FAILURE
(
status
))
{
nv
_debug
(
mxm
,
"WMMX MXMS returned %d
\n
"
,
status
);
nv
km_debug
(
subdev
,
"WMMX MXMS returned %d
\n
"
,
status
);
return
false
;
}
...
...
@@ -210,7 +214,7 @@ mxm_shadow(struct nvkm_mxm *mxm, u8 version)
{
struct
mxm_shadow_h
*
shadow
=
_mxm_shadow
;
do
{
nv
_debug
(
mxm
,
"checking %s
\n
"
,
shadow
->
name
);
nv
km_debug
(
&
mxm
->
subdev
,
"checking %s
\n
"
,
shadow
->
name
);
if
(
shadow
->
exec
(
mxm
,
version
))
{
if
(
mxms_valid
(
mxm
))
return
0
;
...
...
@@ -240,14 +244,14 @@ nvkm_mxm_create_(struct nvkm_object *parent, struct nvkm_object *engine,
data
=
mxm_table
(
bios
,
&
ver
,
&
len
);
if
(
!
data
||
!
(
ver
=
nv_ro08
(
bios
,
data
)))
{
nv
_debug
(
mxm
,
"no VBIOS data, nothing to do
\n
"
);
nv
km_debug
(
&
mxm
->
subdev
,
"no VBIOS data, nothing to do
\n
"
);
return
0
;
}
nv
_info
(
mxm
,
"BIOS version %d.%d
\n
"
,
ver
>>
4
,
ver
&
0x0f
);
nv
km_info
(
&
mxm
->
subdev
,
"BIOS version %d.%d
\n
"
,
ver
>>
4
,
ver
&
0x0f
);
if
(
mxm_shadow
(
mxm
,
ver
))
{
nv
_info
(
mxm
,
"failed to locate valid SIS
\n
"
);
nv
km_warn
(
&
mxm
->
subdev
,
"failed to locate valid SIS
\n
"
);
#if 0
/* we should, perhaps, fall back to some kind of limited
* mode here if the x86 vbios hasn't already done the
...
...
@@ -260,8 +264,8 @@ nvkm_mxm_create_(struct nvkm_object *parent, struct nvkm_object *engine,
#endif
}
nv
_info
(
mxm
,
"MXMS Version %d.%d
\n
"
,
mxms_version
(
mxm
)
>>
8
,
mxms_version
(
mxm
)
&
0xff
);
nv
km_debug
(
&
mxm
->
subdev
,
"MXMS Version %d.%d
\n
"
,
mxms_version
(
mxm
)
>>
8
,
mxms_version
(
mxm
)
&
0xff
);
mxms_foreach
(
mxm
,
0
,
NULL
,
NULL
);
if
(
nvkm_boolopt
(
device
->
cfgopt
,
"NvMXMDCB"
,
true
))
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.c
View file @
27cc60a1
...
...
@@ -47,7 +47,7 @@ mxms_version(struct nvkm_mxm *mxm)
break
;
}
nv
_debug
(
mxm
,
"unknown version %d.%d
\n
"
,
mxms
[
4
],
mxms
[
5
]);
nv
km_debug
(
&
mxm
->
subdev
,
"unknown version %d.%d
\n
"
,
mxms
[
4
],
mxms
[
5
]);
return
0x0000
;
}
...
...
@@ -71,7 +71,7 @@ mxms_checksum(struct nvkm_mxm *mxm)
while
(
size
--
)
sum
+=
*
mxms
++
;
if
(
sum
)
{
nv
_debug
(
mxm
,
"checksum invalid
\n
"
);
nv
km_debug
(
&
mxm
->
subdev
,
"checksum invalid
\n
"
);
return
false
;
}
return
true
;
...
...
@@ -82,7 +82,7 @@ mxms_valid(struct nvkm_mxm *mxm)
{
u8
*
mxms
=
mxms_data
(
mxm
);
if
(
*
(
u32
*
)
mxms
!=
0x5f4d584d
)
{
nv
_debug
(
mxm
,
"signature invalid
\n
"
);
nv
km_debug
(
&
mxm
->
subdev
,
"signature invalid
\n
"
);
return
false
;
}
...
...
@@ -96,6 +96,7 @@ bool
mxms_foreach
(
struct
nvkm_mxm
*
mxm
,
u8
types
,
bool
(
*
exec
)(
struct
nvkm_mxm
*
,
u8
*
,
void
*
),
void
*
info
)
{
struct
nvkm_subdev
*
subdev
=
&
mxm
->
subdev
;
u8
*
mxms
=
mxms_data
(
mxm
);
u8
*
desc
=
mxms
+
mxms_headerlen
(
mxm
);
u8
*
fini
=
desc
+
mxms_structlen
(
mxm
)
-
1
;
...
...
@@ -140,29 +141,28 @@ mxms_foreach(struct nvkm_mxm *mxm, u8 types,
entries
=
desc
[
1
]
&
0x07
;
break
;
default:
nv
_debug
(
mxm
,
"unknown descriptor type %d
\n
"
,
type
);
nv
km_debug
(
subdev
,
"unknown descriptor type %d
\n
"
,
type
);
return
false
;
}
if
(
nv_subdev
(
mxm
)
->
debug
>=
NV_DBG_DEBUG
&&
(
exec
==
NULL
))
{
static
const
char
*
mxms_desc
_name
[]
=
{
static
const
char
*
mxms_desc
[]
=
{
"ODS"
,
"SCCS"
,
"TS"
,
"IPS"
,
"GSD"
,
"VSS"
,
"BCS"
,
"FCS"
,
};
u8
*
dump
=
desc
;
char
data
[
32
],
*
ptr
;
int
i
,
j
;
nv_debug
(
mxm
,
"%4s: "
,
mxms_desc_name
[
type
]);
for
(
j
=
headerlen
-
1
;
j
>=
0
;
j
--
)
pr_cont
(
"%02x"
,
dump
[
j
]);
pr_cont
(
"
\n
"
);
for
(
j
=
headerlen
-
1
,
ptr
=
data
;
j
>=
0
;
j
--
)
ptr
+=
sprintf
(
ptr
,
"%02x"
,
dump
[
j
]);
dump
+=
headerlen
;
nvkm_debug
(
subdev
,
"%4s: %s
\n
"
,
mxms_desc
[
type
],
data
);
for
(
i
=
0
;
i
<
entries
;
i
++
,
dump
+=
recordlen
)
{
nv_debug
(
mxm
,
" "
);
for
(
j
=
recordlen
-
1
;
j
>=
0
;
j
--
)
pr_cont
(
"%02x"
,
dump
[
j
]);
pr_cont
(
"
\n
"
);
for
(
j
=
recordlen
-
1
,
ptr
=
data
;
j
>=
0
;
j
--
)
ptr
+=
sprintf
(
ptr
,
"%02x"
,
dump
[
j
]);
nvkm_debug
(
subdev
,
" %s
\n
"
,
data
);
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c
View file @
27cc60a1
...
...
@@ -103,8 +103,8 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
* if one isn't found, disable it.
*/
if
(
mxms_foreach
(
mxm
,
0x01
,
mxm_match_dcb
,
&
ctx
))
{
nv
_debug
(
mxm
,
"disable %d: 0x%08x 0x
%08x
\n
"
,
idx
,
ctx
.
outp
[
0
],
ctx
.
outp
[
1
]);
nv
km_debug
(
&
mxm
->
subdev
,
"disable %d: %08x
%08x
\n
"
,
idx
,
ctx
.
outp
[
0
],
ctx
.
outp
[
1
]);
ctx
.
outp
[
0
]
|=
0x0000000f
;
return
0
;
}
...
...
@@ -176,20 +176,22 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
static
bool
mxm_show_unmatched
(
struct
nvkm_mxm
*
mxm
,
u8
*
data
,
void
*
info
)
{
struct
nvkm_subdev
*
subdev
=
&
mxm
->
subdev
;
u64
desc
=
*
(
u64
*
)
data
;
if
((
desc
&
0xf0
)
!=
0xf0
)
nv
_info
(
mxm
,
"unmatched output device 0x
%016llx
\n
"
,
desc
);
nv
km_info
(
subdev
,
"unmatched output device
%016llx
\n
"
,
desc
);
return
true
;
}
static
void
mxm_dcb_sanitise
(
struct
nvkm_mxm
*
mxm
)
{
struct
nvkm_bios
*
bios
=
nvkm_bios
(
mxm
);
struct
nvkm_subdev
*
subdev
=
&
mxm
->
subdev
;
struct
nvkm_bios
*
bios
=
subdev
->
device
->
bios
;
u8
ver
,
hdr
,
cnt
,
len
;
u16
dcb
=
dcb_table
(
bios
,
&
ver
,
&
hdr
,
&
cnt
,
&
len
);
if
(
dcb
==
0x0000
||
ver
!=
0x40
)
{
nv
_debug
(
mxm
,
"unsupported DCB version
\n
"
);
nv
km_debug
(
subdev
,
"unsupported DCB version
\n
"
);
return
;
}
...
...
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