Mesa (master): st/xvmc: remove L4A4_UNORM workaround

Christian König deathsimple at kemper.freedesktop.org
Thu Sep 1 17:21:21 UTC 2011


Module: Mesa
Branch: master
Commit: 8612235bbfbaafbe364f62e9355ffd683128e04b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8612235bbfbaafbe364f62e9355ffd683128e04b

Author: Christian König <deathsimple at vodafone.de>
Date:   Tue Aug 30 15:51:42 2011 +0200

st/xvmc: remove L4A4_UNORM workaround

This is no longer needed, since we now have native support for IA44 and AI44.

Signed-off-by: Christian König <deathsimple at vodafone.de>

---

 src/gallium/state_trackers/xorg/xvmc/subpicture.c |   38 +++------------------
 1 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xvmc/subpicture.c b/src/gallium/state_trackers/xorg/xvmc/subpicture.c
index 95a63c8..9e29a53 100644
--- a/src/gallium/state_trackers/xorg/xvmc/subpicture.c
+++ b/src/gallium/state_trackers/xorg/xvmc/subpicture.c
@@ -54,8 +54,10 @@ static enum pipe_format XvIDToPipe(int xvimage_id)
          return PIPE_FORMAT_B8G8R8X8_UNORM;
 
       case FOURCC_AI44:
+         return PIPE_FORMAT_A4R4_UNORM;
+
       case FOURCC_IA44:
-         return PIPE_FORMAT_L4A4_UNORM;
+         return PIPE_FORMAT_R4A4_UNORM;
 
       default:
          XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized Xv image ID 0x%08X.\n", xvimage_id);
@@ -79,36 +81,6 @@ static unsigned NumPaletteEntries4XvID(int xvimage_id)
    }
 }
 
-static void XvIDToSwizzle(int xvimage_id, struct pipe_sampler_view *tmpl)
-{
-   switch (xvimage_id) {
-      default:
-         XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized Xv image ID 0x%08X.\n", xvimage_id);
-
-      /* fall through */
-      case FOURCC_RGB:
-         tmpl->swizzle_r = PIPE_SWIZZLE_BLUE;
-         tmpl->swizzle_g = PIPE_SWIZZLE_GREEN;
-         tmpl->swizzle_b = PIPE_SWIZZLE_RED;
-         tmpl->swizzle_a = PIPE_SWIZZLE_ONE;
-         break;
-
-      case FOURCC_IA44:
-         tmpl->swizzle_r = PIPE_SWIZZLE_ALPHA;
-         tmpl->swizzle_g = PIPE_SWIZZLE_ZERO;
-         tmpl->swizzle_b = PIPE_SWIZZLE_ZERO;
-         tmpl->swizzle_a = PIPE_SWIZZLE_RED;
-         break;
-
-      case FOURCC_AI44:
-         tmpl->swizzle_r = PIPE_SWIZZLE_RED;
-         tmpl->swizzle_g = PIPE_SWIZZLE_ZERO;
-         tmpl->swizzle_b = PIPE_SWIZZLE_ZERO;
-         tmpl->swizzle_a = PIPE_SWIZZLE_ALPHA;
-         break;
-   }
-}
-
 static int PipeToComponentOrder(enum pipe_format format, char *component_order)
 {
    assert(component_order);
@@ -117,7 +89,8 @@ static int PipeToComponentOrder(enum pipe_format format, char *component_order)
       case PIPE_FORMAT_B8G8R8X8_UNORM:
          return 0;
 
-      case PIPE_FORMAT_L4A4_UNORM:
+      case PIPE_FORMAT_R4A4_UNORM:
+      case PIPE_FORMAT_A4R4_UNORM:
          component_order[0] = 'Y';
          component_order[1] = 'U';
          component_order[2] = 'V';
@@ -277,7 +250,6 @@ Status XvMCCreateSubpicture(Display *dpy, XvMCContext *context, XvMCSubpicture *
 
    memset(&sampler_templ, 0, sizeof(sampler_templ));
    u_sampler_view_default_template(&sampler_templ, tex, tex->format);
-   XvIDToSwizzle(xvimage_id, &sampler_templ);
 
    subpicture_priv->sampler = pipe->create_sampler_view(pipe, tex, &sampler_templ);
    pipe_resource_reference(&tex, NULL);




More information about the mesa-commit mailing list