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
29181d2f
Commit
29181d2f
authored
Mar 04, 2012
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nvc0/vram: get part count from PUNITS
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
8b83d67c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
drivers/gpu/drm/nouveau/nvc0_vram.c
drivers/gpu/drm/nouveau/nvc0_vram.c
+14
-16
No files found.
drivers/gpu/drm/nouveau/nvc0_vram.c
View file @
29181d2f
...
@@ -106,34 +106,32 @@ nvc0_vram_init(struct drm_device *dev)
...
@@ -106,34 +106,32 @@ nvc0_vram_init(struct drm_device *dev)
struct
nouveau_vram_engine
*
vram
=
&
dev_priv
->
engine
.
vram
;
struct
nouveau_vram_engine
*
vram
=
&
dev_priv
->
engine
.
vram
;
const
u32
rsvd_head
=
(
256
*
1024
)
>>
12
;
/* vga memory */
const
u32
rsvd_head
=
(
256
*
1024
)
>>
12
;
/* vga memory */
const
u32
rsvd_tail
=
(
1024
*
1024
)
>>
12
;
/* vbios etc */
const
u32
rsvd_tail
=
(
1024
*
1024
)
>>
12
;
/* vbios etc */
u32
parts
=
nv_rd32
(
dev
,
0x121c74
);
u32
parts
=
nv_rd32
(
dev
,
0x022438
);
u32
pmask
=
nv_rd32
(
dev
,
0x022554
);
u32
bsize
=
nv_rd32
(
dev
,
0x10f20c
);
u32
bsize
=
nv_rd32
(
dev
,
0x10f20c
);
u32
offset
,
length
;
u32
offset
,
length
;
bool
uniform
=
true
;
bool
uniform
=
true
;
int
ret
,
part
;
int
ret
,
part
;
NV_DEBUG
(
dev
,
"0x100800: 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100800
));
NV_DEBUG
(
dev
,
"0x100800: 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100800
));
NV_DEBUG
(
dev
,
"parts 0x%08x
bcast_mem_amount 0x%08x
\n
"
,
parts
,
bsize
);
NV_DEBUG
(
dev
,
"parts 0x%08x
mask 0x%08x
\n
"
,
parts
,
pmask
);
dev_priv
->
vram_type
=
nouveau_mem_vbios_type
(
dev
);
dev_priv
->
vram_type
=
nouveau_mem_vbios_type
(
dev
);
dev_priv
->
vram_rank_B
=
!!
(
nv_rd32
(
dev
,
0x10f200
)
&
0x00000004
);
dev_priv
->
vram_rank_B
=
!!
(
nv_rd32
(
dev
,
0x10f200
)
&
0x00000004
);
/* read amount of vram attached to each memory controller */
/* read amount of vram attached to each memory controller */
part
=
0
;
for
(
part
=
0
;
part
<
parts
;
part
++
)
{
while
(
parts
)
{
if
(
!
(
pmask
&
(
1
<<
part
))
)
{
u32
psize
=
nv_rd32
(
dev
,
0x11020c
+
(
part
++
*
0x1000
));
u32
psize
=
nv_rd32
(
dev
,
0x11020c
+
(
part
*
0x1000
));
if
(
psize
==
0
)
if
(
psize
!=
bsize
)
{
continue
;
if
(
psize
<
bsize
)
parts
--
;
bsize
=
psize
;
uniform
=
false
;
if
(
psize
!=
bsize
)
{
}
if
(
psize
<
bsize
)
bsize
=
psize
;
NV_DEBUG
(
dev
,
"%d: mem_amount 0x%08x
\n
"
,
part
,
psize
)
;
uniform
=
false
;
dev_priv
->
vram_size
+=
(
u64
)
psize
<<
20
;
}
}
NV_DEBUG
(
dev
,
"%d: mem_amount 0x%08x
\n
"
,
part
,
psize
);
dev_priv
->
vram_size
+=
(
u64
)
psize
<<
20
;
}
}
/* if all controllers have the same amount attached, there's no holes */
/* if all controllers have the same amount attached, there's no holes */
...
...
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