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

Author: Jakob Bornecrantz <[email protected]>
Date:   Thu Mar 25 00:27:46 2010 +0100

st/dri: Fix for X server 1.6.0 (DRI2 version 1)

---

 src/gallium/state_trackers/dri/dri_st_api.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri_st_api.c 
b/src/gallium/state_trackers/dri/dri_st_api.c
index 2cde019..263c1e1 100644
--- a/src/gallium/state_trackers/dri/dri_st_api.c
+++ b/src/gallium/state_trackers/dri/dri_st_api.c
@@ -168,13 +168,18 @@ dri_drawable_get_buffers(struct dri_drawable *drawable,
    boolean with_format;
    __DRIbuffer *buffers;
    int num_buffers;
-   unsigned attachments[8];
+   unsigned attachments[10];
    unsigned num_attachments, i;
 
    assert(loader);
    with_format = (loader->base.version > 2 && loader->getBuffersWithFormat);
 
    num_attachments = 0;
+
+   /* for Xserver 1.6.0 (DRI2 version 1) we always need to ask for the front */
+   if (!with_format)
+      attachments[num_attachments++] = __DRI_BUFFER_FRONT_LEFT;
+
    for (i = 0; i < *count; i++) {
       enum pipe_format format;
       int att;
@@ -185,6 +190,9 @@ dri_drawable_get_buffers(struct dri_drawable *drawable,
 
       switch (statts[i]) {
       case ST_ATTACHMENT_FRONT_LEFT:
+         /* already added */
+         if (!with_format)
+            continue;
          att = __DRI_BUFFER_FRONT_LEFT;
          break;
       case ST_ATTACHMENT_BACK_LEFT:

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to