winsys/amdgpu: remove the dcc_enable surface flag
authorMarek Olšák <marek.olsak@amd.com>
Mon, 26 Oct 2015 10:11:44 +0000 (11:11 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 27 Oct 2015 09:49:24 +0000 (10:49 +0100)
dcc_size is sufficient and doesn't need a further comment in my opinion.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_texture.c
src/gallium/drivers/radeon/radeon_winsys.h
src/gallium/winsys/amdgpu/drm/amdgpu_surface.c

index 789c66fd169ae44716896543600b6208b64e2ab9..edfdfe33187a09a730b876683959d250b2a1a193 100644 (file)
@@ -641,9 +641,8 @@ r600_texture_create_object(struct pipe_screen *screen,
                                return NULL;
                        }
                }
-               if (rtex->surface.dcc_enabled) {
+               if (rtex->surface.dcc_size)
                        vi_texture_alloc_dcc_separate(rscreen, rtex);
-               }
        }
 
        /* Now create the backing buffer. */
index 0178643549e82dcc78077ece4858363a8317c094..8bf1e15f3be5f03c662c89b9bc34060ed57cc1de 100644 (file)
@@ -371,7 +371,6 @@ struct radeon_surf {
 
     uint64_t                    dcc_size;
     uint64_t                    dcc_alignment;
-    bool                        dcc_enabled;
 };
 
 struct radeon_bo_list_item {
index b442174b7b87daf4952795554d0701bcb26a20fd..3006bd17958e66965361fc12fba8d9edf84d37a1 100644 (file)
@@ -251,7 +251,7 @@ static int compute_level(struct amdgpu_winsys *ws,
 
    surf->bo_size = surf_level->offset + AddrSurfInfoOut->surfSize;
 
-   if (surf->dcc_enabled) {
+   if (AddrSurfInfoIn->flags.dccCompatible) {
       AddrDccIn->colorSurfSize = AddrSurfInfoOut->surfSize;
       AddrDccIn->tileMode = AddrSurfInfoOut->tileMode;
       AddrDccIn->tileInfo = *AddrSurfInfoOut->pTileInfo;
@@ -267,10 +267,11 @@ static int compute_level(struct amdgpu_winsys *ws,
          surf->dcc_size = surf_level->dcc_offset + AddrDccOut->dccRamSize;
          surf->dcc_alignment = MAX2(surf->dcc_alignment, AddrDccOut->dccRamBaseAlign);
       } else {
-         surf->dcc_enabled = false;
+         surf->dcc_size = 0;
          surf_level->dcc_offset = 0;
       }
    } else {
+      surf->dcc_size = 0;
       surf_level->dcc_offset = 0;
    }
 
@@ -354,10 +355,6 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
    AddrDccIn.numSamples = AddrSurfInfoIn.numSamples = surf->nsamples;
    AddrSurfInfoIn.tileIndex = -1;
 
-   surf->dcc_enabled =  !(surf->flags & RADEON_SURF_Z_OR_SBUFFER) &&
-                        !(surf->flags & RADEON_SURF_SCANOUT) &&
-                        !compressed && AddrDccIn.numSamples <= 1;
-
    /* Set the micro tile type. */
    if (surf->flags & RADEON_SURF_SCANOUT)
       AddrSurfInfoIn.tileType = ADDR_DISPLAYABLE;
@@ -373,7 +370,9 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
    AddrSurfInfoIn.flags.display = (surf->flags & RADEON_SURF_SCANOUT) != 0;
    AddrSurfInfoIn.flags.pow2Pad = surf->last_level > 0;
    AddrSurfInfoIn.flags.degrade4Space = 1;
-   AddrSurfInfoIn.flags.dccCompatible = surf->dcc_enabled;
+   AddrSurfInfoIn.flags.dccCompatible = !(surf->flags & RADEON_SURF_Z_OR_SBUFFER) &&
+                                        !(surf->flags & RADEON_SURF_SCANOUT) &&
+                                        !compressed && AddrDccIn.numSamples <= 1;
 
    /* This disables incorrect calculations (hacks) in addrlib. */
    AddrSurfInfoIn.flags.noStencil = 1;