diff mbox

radeon: add RADEON_SURF_FMASK flag which disables 2D->1D tiling transition

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

Commit Message

Marek Olšák May 9, 2013, 9:30 p.m. UTC
I will release a new version of libdrm after this is committed.
---
 radeon/radeon_surface.c |    9 ++++++---
 radeon/radeon_surface.h |    1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

Comments

Alex Deucher May 9, 2013, 11:12 p.m. UTC | #1
On Thu, May 9, 2013 at 5:30 PM, Marek Olšák <maraeo@gmail.com> wrote:
> I will release a new version of libdrm after this is committed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  radeon/radeon_surface.c |    9 ++++++---
>  radeon/radeon_surface.h |    1 +
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
> index 288b5e2..56012da 100644
> --- a/radeon/radeon_surface.c
> +++ b/radeon/radeon_surface.c
> @@ -158,7 +158,8 @@ static void surf_minify(struct radeon_surface *surf,
>      surflevel->nblk_x = (surflevel->npix_x + surf->blk_w - 1) / surf->blk_w;
>      surflevel->nblk_y = (surflevel->npix_y + surf->blk_h - 1) / surf->blk_h;
>      surflevel->nblk_z = (surflevel->npix_z + surf->blk_d - 1) / surf->blk_d;
> -    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D) {
> +    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D &&
> +        !(surf->flags & RADEON_SURF_FMASK)) {
>          if (surflevel->nblk_x < xalign || surflevel->nblk_y < yalign) {
>              surflevel->mode = RADEON_SURF_MODE_1D;
>              return;
> @@ -564,7 +565,8 @@ static void eg_surf_minify(struct radeon_surface *surf,
>      surflevel->nblk_x = (surflevel->npix_x + surf->blk_w - 1) / surf->blk_w;
>      surflevel->nblk_y = (surflevel->npix_y + surf->blk_h - 1) / surf->blk_h;
>      surflevel->nblk_z = (surflevel->npix_z + surf->blk_d - 1) / surf->blk_d;
> -    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D) {
> +    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D &&
> +        !(surf->flags & RADEON_SURF_FMASK)) {
>          if (surflevel->nblk_x < mtilew || surflevel->nblk_y < mtileh) {
>              surflevel->mode = RADEON_SURF_MODE_1D;
>              return;
> @@ -1458,7 +1460,8 @@ static void si_surf_minify_2d(struct radeon_surface *surf,
>          surflevel->nblk_z = (surflevel->npix_z + surf->blk_d - 1) / surf->blk_d;
>      }
>
> -    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D) {
> +    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D &&
> +        !(surf->flags & RADEON_SURF_FMASK)) {
>          if (surflevel->nblk_x < xalign || surflevel->nblk_y < yalign) {
>              surflevel->mode = RADEON_SURF_MODE_1D;
>              return;
> diff --git a/radeon/radeon_surface.h b/radeon/radeon_surface.h
> index 2babfd7..bbed56f 100644
> --- a/radeon/radeon_surface.h
> +++ b/radeon/radeon_surface.h
> @@ -56,6 +56,7 @@
>  #define RADEON_SURF_SBUFFER                     (1 << 18)
>  #define RADEON_SURF_HAS_SBUFFER_MIPTREE         (1 << 19)
>  #define RADEON_SURF_HAS_TILE_MODE_INDEX         (1 << 20)
> +#define RADEON_SURF_FMASK                       (1 << 21)
>
>  #define RADEON_SURF_GET(v, field)   (((v) >> RADEON_SURF_ ## field ## _SHIFT) & RADEON_SURF_ ## field ## _MASK)
>  #define RADEON_SURF_SET(v, field)   (((v) & RADEON_SURF_ ## field ## _MASK) << RADEON_SURF_ ## field ## _SHIFT)
> --
> 1.7.10.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 288b5e2..56012da 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -158,7 +158,8 @@  static void surf_minify(struct radeon_surface *surf,
     surflevel->nblk_x = (surflevel->npix_x + surf->blk_w - 1) / surf->blk_w;
     surflevel->nblk_y = (surflevel->npix_y + surf->blk_h - 1) / surf->blk_h;
     surflevel->nblk_z = (surflevel->npix_z + surf->blk_d - 1) / surf->blk_d;
-    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D) {
+    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D &&
+        !(surf->flags & RADEON_SURF_FMASK)) {
         if (surflevel->nblk_x < xalign || surflevel->nblk_y < yalign) {
             surflevel->mode = RADEON_SURF_MODE_1D;
             return;
@@ -564,7 +565,8 @@  static void eg_surf_minify(struct radeon_surface *surf,
     surflevel->nblk_x = (surflevel->npix_x + surf->blk_w - 1) / surf->blk_w;
     surflevel->nblk_y = (surflevel->npix_y + surf->blk_h - 1) / surf->blk_h;
     surflevel->nblk_z = (surflevel->npix_z + surf->blk_d - 1) / surf->blk_d;
-    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D) {
+    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D &&
+        !(surf->flags & RADEON_SURF_FMASK)) {
         if (surflevel->nblk_x < mtilew || surflevel->nblk_y < mtileh) {
             surflevel->mode = RADEON_SURF_MODE_1D;
             return;
@@ -1458,7 +1460,8 @@  static void si_surf_minify_2d(struct radeon_surface *surf,
         surflevel->nblk_z = (surflevel->npix_z + surf->blk_d - 1) / surf->blk_d;
     }
 
-    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D) {
+    if (surf->nsamples == 1 && surflevel->mode == RADEON_SURF_MODE_2D &&
+        !(surf->flags & RADEON_SURF_FMASK)) {
         if (surflevel->nblk_x < xalign || surflevel->nblk_y < yalign) {
             surflevel->mode = RADEON_SURF_MODE_1D;
             return;
diff --git a/radeon/radeon_surface.h b/radeon/radeon_surface.h
index 2babfd7..bbed56f 100644
--- a/radeon/radeon_surface.h
+++ b/radeon/radeon_surface.h
@@ -56,6 +56,7 @@ 
 #define RADEON_SURF_SBUFFER                     (1 << 18)
 #define RADEON_SURF_HAS_SBUFFER_MIPTREE         (1 << 19)
 #define RADEON_SURF_HAS_TILE_MODE_INDEX         (1 << 20)
+#define RADEON_SURF_FMASK                       (1 << 21)
 
 #define RADEON_SURF_GET(v, field)   (((v) >> RADEON_SURF_ ## field ## _SHIFT) & RADEON_SURF_ ## field ## _MASK)
 #define RADEON_SURF_SET(v, field)   (((v) & RADEON_SURF_ ## field ## _MASK) << RADEON_SURF_ ## field ## _SHIFT)