Commit c4c7f314 authored by Dave Airlie's avatar Dave Airlie

radeon: make radeon_cs_update_pages static.

Just move its only caller into the same file as it and make it static.
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent a01ee165
...@@ -848,7 +848,6 @@ struct radeon_cs_parser { ...@@ -848,7 +848,6 @@ struct radeon_cs_parser {
s32 priority; s32 priority;
}; };
extern int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx);
extern int radeon_cs_finish_pages(struct radeon_cs_parser *p); extern int radeon_cs_finish_pages(struct radeon_cs_parser *p);
extern u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx); extern u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx);
......
...@@ -580,7 +580,7 @@ int radeon_cs_finish_pages(struct radeon_cs_parser *p) ...@@ -580,7 +580,7 @@ int radeon_cs_finish_pages(struct radeon_cs_parser *p)
return 0; return 0;
} }
int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx) static int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx)
{ {
int new_page; int new_page;
struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx]; struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
...@@ -623,3 +623,28 @@ int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx) ...@@ -623,3 +623,28 @@ int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx)
return new_page; return new_page;
} }
u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
{
struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
u32 pg_idx, pg_offset;
u32 idx_value = 0;
int new_page;
pg_idx = (idx * 4) / PAGE_SIZE;
pg_offset = (idx * 4) % PAGE_SIZE;
if (ibc->kpage_idx[0] == pg_idx)
return ibc->kpage[0][pg_offset/4];
if (ibc->kpage_idx[1] == pg_idx)
return ibc->kpage[1][pg_offset/4];
new_page = radeon_cs_update_pages(p, pg_idx);
if (new_page < 0) {
p->parser_error = new_page;
return 0;
}
idx_value = ibc->kpage[new_page][pg_offset/4];
return idx_value;
}
...@@ -39,31 +39,6 @@ ...@@ -39,31 +39,6 @@
*/ */
int radeon_debugfs_sa_init(struct radeon_device *rdev); int radeon_debugfs_sa_init(struct radeon_device *rdev);
u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
{
struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
u32 pg_idx, pg_offset;
u32 idx_value = 0;
int new_page;
pg_idx = (idx * 4) / PAGE_SIZE;
pg_offset = (idx * 4) % PAGE_SIZE;
if (ibc->kpage_idx[0] == pg_idx)
return ibc->kpage[0][pg_offset/4];
if (ibc->kpage_idx[1] == pg_idx)
return ibc->kpage[1][pg_offset/4];
new_page = radeon_cs_update_pages(p, pg_idx);
if (new_page < 0) {
p->parser_error = new_page;
return 0;
}
idx_value = ibc->kpage[new_page][pg_offset/4];
return idx_value;
}
int radeon_ib_get(struct radeon_device *rdev, int ring, int radeon_ib_get(struct radeon_device *rdev, int ring,
struct radeon_ib *ib, unsigned size) struct radeon_ib *ib, unsigned size)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment