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
c37e9905
Commit
c37e9905
authored
Nov 07, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/mxm: implement ROM shadow method
Untested, -ENOHW. Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
3952315b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
drivers/gpu/drm/nouveau/nouveau_mxm.c
drivers/gpu/drm/nouveau/nouveau_mxm.c
+39
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_mxm.c
View file @
c37e9905
...
@@ -470,9 +470,48 @@ mxm_dcb_sanitise(struct drm_device *dev)
...
@@ -470,9 +470,48 @@ mxm_dcb_sanitise(struct drm_device *dev)
mxms_foreach
(
dev
,
0x01
,
mxm_show_unmatched
,
NULL
);
mxms_foreach
(
dev
,
0x01
,
mxm_show_unmatched
,
NULL
);
}
}
static
bool
mxm_shadow_rom_fetch
(
struct
nouveau_i2c_chan
*
i2c
,
u8
addr
,
u8
offset
,
u8
size
,
u8
*
data
)
{
struct
i2c_msg
msgs
[]
=
{
{
.
addr
=
addr
,
.
flags
=
0
,
.
len
=
1
,
.
buf
=
&
offset
},
{
.
addr
=
addr
,
.
flags
=
I2C_M_RD
,
.
len
=
size
,
.
buf
=
data
,
},
};
return
i2c_transfer
(
&
i2c
->
adapter
,
msgs
,
2
)
==
2
;
}
static
bool
static
bool
mxm_shadow_rom
(
struct
drm_device
*
dev
,
u8
version
)
mxm_shadow_rom
(
struct
drm_device
*
dev
,
u8
version
)
{
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_i2c_chan
*
i2c
=
NULL
;
u8
i2cidx
,
mxms
[
6
],
addr
,
size
;
i2cidx
=
mxm_ddc_map
(
dev
,
1
/* LVDS_DDC */
)
&
0x0f
;
if
(
i2cidx
<
0x0f
)
i2c
=
nouveau_i2c_find
(
dev
,
i2cidx
);
if
(
!
i2c
)
return
false
;
addr
=
0x54
;
if
(
!
mxm_shadow_rom_fetch
(
i2c
,
addr
,
0
,
6
,
mxms
))
{
addr
=
0x56
;
if
(
!
mxm_shadow_rom_fetch
(
i2c
,
addr
,
0
,
6
,
mxms
))
return
false
;
}
dev_priv
->
mxms
=
mxms
;
size
=
mxms_headerlen
(
dev
)
+
mxms_structlen
(
dev
);
dev_priv
->
mxms
=
kmalloc
(
size
,
GFP_KERNEL
);
if
(
dev_priv
->
mxms
&&
mxm_shadow_rom_fetch
(
i2c
,
addr
,
0
,
size
,
dev_priv
->
mxms
))
return
true
;
kfree
(
dev_priv
->
mxms
);
dev_priv
->
mxms
=
NULL
;
return
false
;
return
false
;
}
}
...
...
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