aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600_cs.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-05-09 09:35:02 -0400
committerDave Airlie <airlied@redhat.com>2012-05-09 12:22:55 -0400
commitf2e3922106f6b29083086393ee474ad4483bc487 (patch)
tree73ae3df5af1166f5f80f198598871113a97acc15 /drivers/gpu/drm/radeon/r600_cs.c
parentf237750f007412eb5e1baafe3e32857b35fbc6ee (diff)
drm/radeon: make the ib an inline object
No need to malloc it any more. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_cs.c')
-rw-r--r--drivers/gpu/drm/radeon/r600_cs.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index b8e12af304a9..0133f5f09bd6 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -345,7 +345,7 @@ static int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
345 u32 height, height_align, pitch, pitch_align, depth_align; 345 u32 height, height_align, pitch, pitch_align, depth_align;
346 u64 base_offset, base_align; 346 u64 base_offset, base_align;
347 struct array_mode_checker array_check; 347 struct array_mode_checker array_check;
348 volatile u32 *ib = p->ib->ptr; 348 volatile u32 *ib = p->ib.ptr;
349 unsigned array_mode; 349 unsigned array_mode;
350 u32 format; 350 u32 format;
351 351
@@ -471,7 +471,7 @@ static int r600_cs_track_validate_db(struct radeon_cs_parser *p)
471 u64 base_offset, base_align; 471 u64 base_offset, base_align;
472 struct array_mode_checker array_check; 472 struct array_mode_checker array_check;
473 int array_mode; 473 int array_mode;
474 volatile u32 *ib = p->ib->ptr; 474 volatile u32 *ib = p->ib.ptr;
475 475
476 476
477 if (track->db_bo == NULL) { 477 if (track->db_bo == NULL) {
@@ -961,7 +961,7 @@ static int r600_cs_packet_parse_vline(struct radeon_cs_parser *p)
961 uint32_t header, h_idx, reg, wait_reg_mem_info; 961 uint32_t header, h_idx, reg, wait_reg_mem_info;
962 volatile uint32_t *ib; 962 volatile uint32_t *ib;
963 963
964 ib = p->ib->ptr; 964 ib = p->ib.ptr;
965 965
966 /* parse the WAIT_REG_MEM */ 966 /* parse the WAIT_REG_MEM */
967 r = r600_cs_packet_parse(p, &wait_reg_mem, p->idx); 967 r = r600_cs_packet_parse(p, &wait_reg_mem, p->idx);
@@ -1110,7 +1110,7 @@ static int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx)
1110 m = 1 << ((reg >> 2) & 31); 1110 m = 1 << ((reg >> 2) & 31);
1111 if (!(r600_reg_safe_bm[i] & m)) 1111 if (!(r600_reg_safe_bm[i] & m))
1112 return 0; 1112 return 0;
1113 ib = p->ib->ptr; 1113 ib = p->ib.ptr;
1114 switch (reg) { 1114 switch (reg) {
1115 /* force following reg to 0 in an attempt to disable out buffer 1115 /* force following reg to 0 in an attempt to disable out buffer
1116 * which will need us to better understand how it works to perform 1116 * which will need us to better understand how it works to perform
@@ -1714,7 +1714,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
1714 u32 idx_value; 1714 u32 idx_value;
1715 1715
1716 track = (struct r600_cs_track *)p->track; 1716 track = (struct r600_cs_track *)p->track;
1717 ib = p->ib->ptr; 1717 ib = p->ib.ptr;
1718 idx = pkt->idx + 1; 1718 idx = pkt->idx + 1;
1719 idx_value = radeon_get_ib_value(p, idx); 1719 idx_value = radeon_get_ib_value(p, idx);
1720 1720
@@ -2249,8 +2249,8 @@ int r600_cs_parse(struct radeon_cs_parser *p)
2249 } 2249 }
2250 } while (p->idx < p->chunks[p->chunk_ib_idx].length_dw); 2250 } while (p->idx < p->chunks[p->chunk_ib_idx].length_dw);
2251#if 0 2251#if 0
2252 for (r = 0; r < p->ib->length_dw; r++) { 2252 for (r = 0; r < p->ib.length_dw; r++) {
2253 printk(KERN_INFO "%05d 0x%08X\n", r, p->ib->ptr[r]); 2253 printk(KERN_INFO "%05d 0x%08X\n", r, p->ib.ptr[r]);
2254 mdelay(1); 2254 mdelay(1);
2255 } 2255 }
2256#endif 2256#endif
@@ -2298,7 +2298,6 @@ int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp,
2298{ 2298{
2299 struct radeon_cs_parser parser; 2299 struct radeon_cs_parser parser;
2300 struct radeon_cs_chunk *ib_chunk; 2300 struct radeon_cs_chunk *ib_chunk;
2301 struct radeon_ib fake_ib;
2302 struct r600_cs_track *track; 2301 struct r600_cs_track *track;
2303 int r; 2302 int r;
2304 2303
@@ -2314,9 +2313,8 @@ int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp,
2314 parser.dev = &dev->pdev->dev; 2313 parser.dev = &dev->pdev->dev;
2315 parser.rdev = NULL; 2314 parser.rdev = NULL;
2316 parser.family = family; 2315 parser.family = family;
2317 parser.ib = &fake_ib;
2318 parser.track = track; 2316 parser.track = track;
2319 fake_ib.ptr = ib; 2317 parser.ib.ptr = ib;
2320 r = radeon_cs_parser_init(&parser, data); 2318 r = radeon_cs_parser_init(&parser, data);
2321 if (r) { 2319 if (r) {
2322 DRM_ERROR("Failed to initialize parser !\n"); 2320 DRM_ERROR("Failed to initialize parser !\n");
@@ -2333,8 +2331,8 @@ int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp,
2333 * input memory (cached) and write to the IB (which can be 2331 * input memory (cached) and write to the IB (which can be
2334 * uncached). */ 2332 * uncached). */
2335 ib_chunk = &parser.chunks[parser.chunk_ib_idx]; 2333 ib_chunk = &parser.chunks[parser.chunk_ib_idx];
2336 parser.ib->length_dw = ib_chunk->length_dw; 2334 parser.ib.length_dw = ib_chunk->length_dw;
2337 *l = parser.ib->length_dw; 2335 *l = parser.ib.length_dw;
2338 r = r600_cs_parse(&parser); 2336 r = r600_cs_parse(&parser);
2339 if (r) { 2337 if (r) {
2340 DRM_ERROR("Invalid command stream !\n"); 2338 DRM_ERROR("Invalid command stream !\n");