summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915tex/intel_fbo.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-02-15 16:30:40 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-02-20 19:15:44 +0100
commit6b99cafd69a791d03ce749d0fd2b9f59ca265677 (patch)
tree67b2f1d25ebbff406343ff01cb19dea2e07e4c2b /src/mesa/drivers/dri/i915tex/intel_fbo.c
parentaf64dd2ae0aa31261002335f10d46492000f552b (diff)
i915tex: Support page flipping on both CRTCs independently.
No longer track page flipping state per context but per window, via struct intel_framebuffer which wraps struct gl_framebuffer for windows.
Diffstat (limited to 'src/mesa/drivers/dri/i915tex/intel_fbo.c')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_fbo.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_fbo.c b/src/mesa/drivers/dri/i915tex/intel_fbo.c
index b739e22cca..104cf1d9bb 100644
--- a/src/mesa/drivers/dri/i915tex/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915tex/intel_fbo.c
@@ -71,6 +71,21 @@ intel_renderbuffer(struct gl_renderbuffer *rb)
struct intel_renderbuffer *
intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex)
{
+ if (fb->Name == 0) {
+ struct intel_framebuffer *intel_fb = (struct intel_framebuffer*)fb;
+
+ if (intel_fb->pf_current_page) {
+ switch (attIndex) {
+ case BUFFER_BACK_LEFT:
+ attIndex = BUFFER_FRONT_LEFT;
+ break;
+ case BUFFER_FRONT_LEFT:
+ attIndex = BUFFER_BACK_LEFT;
+ break;
+ }
+ }
+ }
+
return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
}
@@ -78,22 +93,7 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex)
struct intel_region *
intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
{
- GET_CURRENT_CONTEXT(ctx);
- struct intel_context *intel = intel_context(ctx);
- struct intel_renderbuffer *irb;
-
- if (intel->sarea->pf_current_page) {
- switch (attIndex) {
- case BUFFER_BACK_LEFT:
- attIndex = BUFFER_FRONT_LEFT;
- break;
- case BUFFER_FRONT_LEFT:
- attIndex = BUFFER_BACK_LEFT;
- break;
- }
- }
-
- irb = intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
+ struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
if (irb)
return irb->region;
@@ -109,7 +109,9 @@ intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
static struct gl_framebuffer *
intel_new_framebuffer(GLcontext * ctx, GLuint name)
{
- /* there's no intel_framebuffer at this time, just use Mesa's class */
+ /* Only drawable state in intel_framebuffer at this time, just use Mesa's
+ * class
+ */
return _mesa_new_framebuffer(ctx, name);
}