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
93d9206d
Commit
93d9206d
authored
Nov 07, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/mxm: implement wmi shadow method
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
b4c26818
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
6 deletions
+45
-6
drivers/gpu/drm/nouveau/nouveau_mxm.c
drivers/gpu/drm/nouveau/nouveau_mxm.c
+45
-6
No files found.
drivers/gpu/drm/nouveau/nouveau_mxm.c
View file @
93d9206d
...
...
@@ -22,6 +22,8 @@
* Authors: Ben Skeggs
*/
#include <linux/acpi.h>
#include "drmP.h"
#include "nouveau_drv.h"
...
...
@@ -469,34 +471,71 @@ mxm_dcb_sanitise(struct drm_device *dev)
}
static
bool
mxm_shadow_rom
(
struct
drm_device
*
dev
)
mxm_shadow_rom
(
struct
drm_device
*
dev
,
u8
version
)
{
return
false
;
}
static
bool
mxm_shadow_dsm
(
struct
drm_device
*
dev
,
u8
version
)
{
return
false
;
}
#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
#define WMI_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0"
static
bool
mxm_shadow_
dsm
(
struct
drm_device
*
dev
)
mxm_shadow_
wmi
(
struct
drm_device
*
dev
,
u8
version
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
u32
mxms_args
[]
=
{
0x534D584D
/* MXMS */
,
version
,
0
};
struct
acpi_buffer
args
=
{
sizeof
(
mxms_args
),
mxms_args
};
struct
acpi_buffer
retn
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
union
acpi_object
*
obj
;
acpi_status
status
;
if
(
!
wmi_has_guid
(
WMI_WMMX_GUID
))
return
false
;
status
=
wmi_evaluate_method
(
WMI_WMMX_GUID
,
0
,
0
,
&
args
,
&
retn
);
if
(
ACPI_FAILURE
(
status
))
{
MXM_DBG
(
dev
,
"WMMX MXMS returned %d
\n
"
,
status
);
return
false
;
}
obj
=
retn
.
pointer
;
if
(
obj
->
type
==
ACPI_TYPE_BUFFER
)
{
dev_priv
->
mxms
=
kmemdup
(
obj
->
buffer
.
pointer
,
obj
->
buffer
.
length
,
GFP_KERNEL
);
}
kfree
(
obj
);
return
dev_priv
->
mxms
!=
NULL
;
}
#endif
struct
mxm_shadow_h
{
const
char
*
name
;
bool
(
*
exec
)(
struct
drm_device
*
);
bool
(
*
exec
)(
struct
drm_device
*
,
u8
version
);
}
_mxm_shadow
[]
=
{
{
"ROM"
,
mxm_shadow_rom
},
{
"DSM"
,
mxm_shadow_dsm
},
#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
{
"WMI"
,
mxm_shadow_wmi
},
#endif
{}
};
static
int
mxm_shadow
(
struct
drm_device
*
dev
)
mxm_shadow
(
struct
drm_device
*
dev
,
u8
version
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
mxm_shadow_h
*
shadow
=
_mxm_shadow
;
do
{
MXM_DBG
(
dev
,
"checking %s
\n
"
,
shadow
->
name
);
if
(
shadow
->
exec
(
dev
))
{
if
(
shadow
->
exec
(
dev
,
version
))
{
if
(
mxms_valid
(
dev
))
return
0
;
kfree
(
dev_priv
->
mxms
);
...
...
@@ -517,7 +556,7 @@ nouveau_mxm_init(struct drm_device *dev)
MXM_MSG
(
dev
,
"BIOS version %d.%d
\n
"
,
mxm
[
0
]
>>
4
,
mxm
[
0
]
&
0x0f
);
if
(
mxm_shadow
(
dev
))
{
if
(
mxm_shadow
(
dev
,
mxm
[
0
]
))
{
MXM_MSG
(
dev
,
"failed to locate valid SIS
\n
"
);
return
-
EINVAL
;
}
...
...
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