r600g: get tiling flags using radeon_winsys
authorMarek Olšák <maraeo@gmail.com>
Thu, 4 Aug 2011 01:19:33 +0000 (03:19 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 16 Aug 2011 07:15:11 +0000 (09:15 +0200)
Also remove some unused fence-related leftovers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/winsys/r600/drm/r600_bo.c
src/gallium/winsys/r600/drm/r600_priv.h
src/gallium/winsys/r600/drm/radeon_bo.c

index 9e2c08ab56fc9b705a63fd1e5581faed6eb8dd6e..0b2a9aabac37dd2e9c452983bfb2bf65bf0ab26b 100644 (file)
@@ -79,7 +79,6 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon, struct winsys_handle *whan
 {
        struct r600_bo *bo = calloc(1, sizeof(struct r600_bo));
        struct radeon_bo *rbo;
-       unsigned tiling_flags;
 
        rbo = bo->bo = radeon_bo(radeon, whandle->handle, 0, 0, 0, 0);
        if (rbo == NULL) {
@@ -93,16 +92,17 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon, struct winsys_handle *whan
        if (stride)
                *stride = whandle->stride;
 
-       radeon_bo_get_tiling_flags(radeon, rbo, &tiling_flags);
        if (array_mode) {
-               if (tiling_flags) {
-                       if (tiling_flags & RADEON_TILING_MACRO)
-                               *array_mode = V_0280A0_ARRAY_2D_TILED_THIN1;
-                       else if (tiling_flags & RADEON_TILING_MICRO)
-                               *array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
-               } else {
+               enum radeon_bo_layout micro, macro;
+
+               radeon->ws->buffer_get_tiling(rbo->buf, &micro, &macro);
+
+               if (macro == RADEON_LAYOUT_TILED)
+                       *array_mode = V_0280A0_ARRAY_2D_TILED_THIN1;
+               else if (micro == RADEON_LAYOUT_TILED)
+                       *array_mode = V_0280A0_ARRAY_1D_TILED_THIN1;
+               else
                        *array_mode = 0;
-               }
        }
        return bo;
 }
index 0efb02aadae746435c1cf14c7dced119b18bdc44..952f91df89a1f62bcf4979686063b918977c217e 100644 (file)
@@ -94,16 +94,11 @@ void radeon_bo_reference(struct radeon *radeon, struct radeon_bo **dst,
                         struct radeon_bo *src);
 int radeon_bo_wait(struct radeon *radeon, struct radeon_bo *bo);
 int radeon_bo_busy(struct radeon *radeon, struct radeon_bo *bo, uint32_t *domain);
-int radeon_bo_fencelist(struct radeon *radeon, struct radeon_bo **bolist, uint32_t num_bo);
-int radeon_bo_get_tiling_flags(struct radeon *radeon,
-                              struct radeon_bo *bo,
-                              uint32_t *tiling_flags);
 int radeon_bo_fixed_map(struct radeon *radeon, struct radeon_bo *bo);
 
 /*
  * r600_hw_context.c
  */
-int r600_context_init_fence(struct r600_context *ctx);
 void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
                                unsigned flush_mask, struct r600_bo *rbo);
 struct r600_bo *r600_context_reg_bo(struct r600_context *ctx, unsigned offset);
@@ -161,17 +156,4 @@ static inline void radeon_bo_unmap(struct radeon *radeon, struct radeon_bo *bo)
        assert(bo->map_count >= 0);
 }
 
-/*
- * fence
- */
-static inline boolean fence_is_after(unsigned fence, unsigned ofence)
-{
-       /* handle wrap around */
-       if (fence < 0x80000000 && ofence > 0x80000000)
-               return TRUE;
-       if (fence > ofence)
-               return TRUE;
-       return FALSE;
-}
-
 #endif
index 9d351480d59b89777de00870275655332e02fb56..f2f53a14a58f7a49628a6ebf4547cce3306cb0e7 100644 (file)
@@ -148,20 +148,3 @@ int radeon_bo_busy(struct radeon *radeon, struct radeon_bo *bo, uint32_t *domain
        *domain = args.domain;
        return ret;
 }
-
-int radeon_bo_get_tiling_flags(struct radeon *radeon,
-                              struct radeon_bo *bo,
-                              uint32_t *tiling_flags)
-{
-       struct drm_radeon_gem_get_tiling args = {};
-       int ret;
-
-       args.handle = bo->handle;
-       ret = drmCommandWriteRead(radeon->info.fd, DRM_RADEON_GEM_GET_TILING,
-                                 &args, sizeof(args));
-       if (ret)
-               return ret;
-
-       *tiling_flags = args.tiling_flags;
-       return ret;
-}