Mesa (8.0): st/dri: Support 24bit formats in dri2_allocate_buffer

Benjamin Franzke bnf at kemper.freedesktop.org
Mon Jan 30 16:23:33 UTC 2012


Module: Mesa
Branch: 8.0
Commit: 5f60d134e68775d00afca062eec42838e7888358
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f60d134e68775d00afca062eec42838e7888358

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Sun Jan 29 17:28:50 2012 +0100

st/dri: Support 24bit formats in dri2_allocate_buffer

Prior commit 576161289df68eedade591fbca4013329c9e5ded,
the parameter format was bpp, thus both 24bit and 32bit formats were
requested with format set to 32. Handle 24bit seperately now.

Fixes RGBX formats in wayland platform for egl_dri2 (EGL_ALPHA_SIZE=0).

Note: This is a candidate for the 8.0 branch.
(cherry picked from commit c72d7df16879e3210946ba92a7edc823815b6f16)

---

 src/gallium/state_trackers/dri/drm/dri2.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index 2f7f1cb..b9930d3 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -316,6 +316,9 @@ dri2_allocate_buffer(__DRIscreen *sPriv,
 
    switch (format) {
       case 32:
+         pf = PIPE_FORMAT_B8G8R8A8_UNORM;
+         break;
+      case 24:
          pf = PIPE_FORMAT_B8G8R8X8_UNORM;
          break;
       case 16:




More information about the mesa-commit mailing list