diff mbox

[1/2] radeon: simplify ZS buffer checking on r600

Message ID 1343570522-4080-1-git-send-email-maraeo@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marek Olšák July 29, 2012, 2:02 p.m. UTC
Setting those flags has no effect anywhere else.
---
 radeon/radeon_surface.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Christian König July 30, 2012, 8:29 a.m. UTC | #1
I wanted to work on something similar this week, cause we need some 
updates for SI on this.

So thx, you saved me some work here. And both patches are:

Reviewed-by: Christian König <christian.koenig@amd.com>

On 29.07.2012 16:02, Marek Olšák wrote:
> Setting those flags has no effect anywhere else.
> ---
>   radeon/radeon_surface.c |    9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
> index c80f7f4..5800c33 100644
> --- a/radeon/radeon_surface.c
> +++ b/radeon/radeon_surface.c
> @@ -385,14 +385,7 @@ static int r6_surface_init(struct radeon_surface_manager *surf_man,
>       /* tiling mode */
>       mode = (surf->flags >> RADEON_SURF_MODE_SHIFT) & RADEON_SURF_MODE_MASK;
>   
> -    /* always enable z & stencil together */
> -    if (surf->flags & RADEON_SURF_ZBUFFER) {
> -        surf->flags |= RADEON_SURF_SBUFFER;
> -    }
> -    if (surf->flags & RADEON_SURF_SBUFFER) {
> -        surf->flags |= RADEON_SURF_ZBUFFER;
> -    }
> -    if (surf->flags & RADEON_SURF_ZBUFFER) {
> +    if (surf->flags & (RADEON_SURF_ZBUFFER | RADEON_SURF_SBUFFER)) {
>           /* zbuffer only support 1D or 2D tiled surface */
>           switch (mode) {
>           case RADEON_SURF_MODE_1D:
diff mbox

Patch

diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index c80f7f4..5800c33 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -385,14 +385,7 @@  static int r6_surface_init(struct radeon_surface_manager *surf_man,
     /* tiling mode */
     mode = (surf->flags >> RADEON_SURF_MODE_SHIFT) & RADEON_SURF_MODE_MASK;
 
-    /* always enable z & stencil together */
-    if (surf->flags & RADEON_SURF_ZBUFFER) {
-        surf->flags |= RADEON_SURF_SBUFFER;
-    }
-    if (surf->flags & RADEON_SURF_SBUFFER) {
-        surf->flags |= RADEON_SURF_ZBUFFER;
-    }
-    if (surf->flags & RADEON_SURF_ZBUFFER) {
+    if (surf->flags & (RADEON_SURF_ZBUFFER | RADEON_SURF_SBUFFER)) {
         /* zbuffer only support 1D or 2D tiled surface */
         switch (mode) {
         case RADEON_SURF_MODE_1D: