diff options
author | Andi Kleen <ak@linux.intel.com> | 2011-10-13 19:08:47 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-10-18 04:53:05 -0400 |
commit | ce580fab739c815e25d13bae62f96ba7251f6e2e (patch) | |
tree | fb8d0e0e4c678b5a14198a0c65cd579aca039ad1 /drivers/gpu/drm/radeon/radeon.h | |
parent | cbdd45015af78ec9e75ed7a3df8b76048c4d289f (diff) |
drm/radeon: Move more code out of line
With this patch I'm only about 50k larger with DRM debugging
enables (why is that enabled by default?!?), and slightly
smaller without.
[airlied: moved r100.c additions to radeon_ring.c]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index ff5424e43d1b..f3260f7136a9 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -600,32 +600,7 @@ struct radeon_cs_parser { | |||
600 | 600 | ||
601 | extern int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx); | 601 | extern int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx); |
602 | extern int radeon_cs_finish_pages(struct radeon_cs_parser *p); | 602 | extern int radeon_cs_finish_pages(struct radeon_cs_parser *p); |
603 | 603 | extern u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx); | |
604 | |||
605 | static inline u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx) | ||
606 | { | ||
607 | struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx]; | ||
608 | u32 pg_idx, pg_offset; | ||
609 | u32 idx_value = 0; | ||
610 | int new_page; | ||
611 | |||
612 | pg_idx = (idx * 4) / PAGE_SIZE; | ||
613 | pg_offset = (idx * 4) % PAGE_SIZE; | ||
614 | |||
615 | if (ibc->kpage_idx[0] == pg_idx) | ||
616 | return ibc->kpage[0][pg_offset/4]; | ||
617 | if (ibc->kpage_idx[1] == pg_idx) | ||
618 | return ibc->kpage[1][pg_offset/4]; | ||
619 | |||
620 | new_page = radeon_cs_update_pages(p, pg_idx); | ||
621 | if (new_page < 0) { | ||
622 | p->parser_error = new_page; | ||
623 | return 0; | ||
624 | } | ||
625 | |||
626 | idx_value = ibc->kpage[new_page][pg_offset/4]; | ||
627 | return idx_value; | ||
628 | } | ||
629 | 604 | ||
630 | struct radeon_cs_packet { | 605 | struct radeon_cs_packet { |
631 | unsigned idx; | 606 | unsigned idx; |
@@ -1414,19 +1389,19 @@ void radeon_atombios_fini(struct radeon_device *rdev); | |||
1414 | /* | 1389 | /* |
1415 | * RING helpers. | 1390 | * RING helpers. |
1416 | */ | 1391 | */ |
1392 | |||
1393 | #if DRM_DEBUG_CODE == 0 | ||
1417 | static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) | 1394 | static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) |
1418 | { | 1395 | { |
1419 | #if DRM_DEBUG_CODE | ||
1420 | if (rdev->cp.count_dw <= 0) { | ||
1421 | DRM_ERROR("radeon: writting more dword to ring than expected !\n"); | ||
1422 | } | ||
1423 | #endif | ||
1424 | rdev->cp.ring[rdev->cp.wptr++] = v; | 1396 | rdev->cp.ring[rdev->cp.wptr++] = v; |
1425 | rdev->cp.wptr &= rdev->cp.ptr_mask; | 1397 | rdev->cp.wptr &= rdev->cp.ptr_mask; |
1426 | rdev->cp.count_dw--; | 1398 | rdev->cp.count_dw--; |
1427 | rdev->cp.ring_free_dw--; | 1399 | rdev->cp.ring_free_dw--; |
1428 | } | 1400 | } |
1429 | 1401 | #else | |
1402 | /* With debugging this is just too big to inline */ | ||
1403 | void radeon_ring_write(struct radeon_device *rdev, uint32_t v); | ||
1404 | #endif | ||
1430 | 1405 | ||
1431 | /* | 1406 | /* |
1432 | * ASICs macro. | 1407 | * ASICs macro. |