summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.c10
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.h13
2 files changed, 20 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c
index 817cb86c524..df0d27302cc 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.c
@@ -38,12 +38,16 @@ driDeleteRenderbuffer(struct gl_renderbuffer *rb)
* this function.
* \param format Either GL_RGBA, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24,
* GL_DEPTH_COMPONENT32, or GL_STENCIL_INDEX8_EXT (for now).
+ * \param addr address in main memory of the buffer. Probably a memory
+ * mapped region.
* \param cpp chars or bytes per pixel
* \param offset start of renderbuffer with respect to start of framebuffer
* \param pitch pixels per row
*/
driRenderbuffer *
-driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch)
+driNewRenderbuffer(GLenum format, GLvoid *addr,
+ GLint cpp, GLint offset, GLint pitch,
+ __DRIdrawablePrivate *dPriv)
{
driRenderbuffer *drb;
@@ -98,7 +102,10 @@ driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch)
drb->Base.AllocStorage = driRenderbufferStorage;
drb->Base.Delete = driDeleteRenderbuffer;
+ drb->Base.Data = addr;
+
/* DRI renderbuffer-specific fields: */
+ drb->dPriv = dPriv;
drb->offset = offset;
drb->pitch = pitch;
drb->cpp = cpp;
@@ -106,6 +113,7 @@ driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch)
/* may be changed if page flipping is active: */
drb->flippedOffset = offset;
drb->flippedPitch = pitch;
+ drb->flippedData = addr;
}
return drb;
}
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h
index bd07bc790f2..f2cc357ff9e 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.h
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.h
@@ -11,6 +11,8 @@
#define DRIRENDERBUFFER_H
#include "mtypes.h"
+#include "dri_util.h"
+
typedef struct {
struct gl_renderbuffer Base;
@@ -38,7 +40,12 @@ typedef struct {
*/
GLint flippedOffset;
GLint flippedPitch;
- GLubyte *flippedData; /* mmap'd memory, if used */
+ GLvoid *flippedData; /* mmap'd address of buffer memory, if used */
+
+ /* Pointer to corresponding __DRIdrawablePrivate. This is used to compute
+ * the window's position within the framebuffer.
+ */
+ __DRIdrawablePrivate *dPriv;
/* XXX this is for radeon/r200 only. We should really create a new
* r200Renderbuffer class, derived from this class... not a huge deal.
@@ -53,7 +60,9 @@ typedef struct {
extern driRenderbuffer *
-driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch);
+driNewRenderbuffer(GLenum format, GLvoid *addr,
+ GLint cpp, GLint offset, GLint pitch,
+ __DRIdrawablePrivate *dPriv);
extern void
driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped);