summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_context.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-10-18 20:27:11 +0000
committerIan Romanick <idr@us.ibm.com>2006-10-18 20:27:11 +0000
commit3beaff1e3cf227c493badfc55a69381c778b2ff7 (patch)
treedbbbd04df4088f2d57284cac6e05b98771e4841e /src/mesa/drivers/dri/radeon/radeon_context.c
parentec99e716a229e58233551d821418428cc1b90324 (diff)
Enable GLX_SGI_make_current_read for radeon.
Added code to track the drawable bound to the context for reading. In addition, when a drawable is initially bound (for reading or drawing) or when the size of the drawable changes, update the size of the framebuffer object that back the drawable (for software fallbacks). Deprecate the old GetBufferSize interface. Bump the driver date. These changes were tested with wincopy on both direct rendering and accelerated indirect rendering (AIGLX).
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 6328c08442..e4dcc96466 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -70,7 +70,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
-#define DRIVER_DATE "20060327"
+#define DRIVER_DATE "20061018"
#include "vblank.h"
#include "utils.h"
@@ -80,21 +80,6 @@ int RADEON_DEBUG = (0);
#endif
-/* Return the width and height of the given buffer.
- */
-static void radeonGetBufferSize( GLframebuffer *buffer,
- GLuint *width, GLuint *height )
-{
- GET_CURRENT_CONTEXT(ctx);
- radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-
- LOCK_HARDWARE( rmesa );
- *width = rmesa->dri.drawable->w;
- *height = rmesa->dri.drawable->h;
-
- UNLOCK_HARDWARE( rmesa );
-}
-
/* Return various strings for glGetString().
*/
static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
@@ -186,7 +171,7 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = {
*/
static void radeonInitDriverFuncs( struct dd_function_table *functions )
{
- functions->GetBufferSize = radeonGetBufferSize;
+ functions->GetBufferSize = NULL; /* OBSOLETE */
functions->GetString = radeonGetString;
}
@@ -280,7 +265,8 @@ radeonCreateContext( const __GLcontextModes *glVisual,
/* Init radeon context data */
rmesa->dri.context = driContextPriv;
rmesa->dri.screen = sPriv;
- rmesa->dri.drawable = NULL; /* Set by XMesaMakeCurrent */
+ rmesa->dri.drawable = NULL;
+ rmesa->dri.readable = NULL;
rmesa->dri.hwContext = driContextPriv->hHWContext;
rmesa->dri.hwLock = &sPriv->pSAREA->lock;
rmesa->dri.fd = sPriv->fd;
@@ -621,11 +607,17 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv,
/* XXX we may need to validate the drawable here!!! */
driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags,
&newCtx->vbl_seq );
+ }
+
+ if ( (newCtx->dri.drawable != driDrawPriv)
+ || (newCtx->dri.readable != driReadPriv) ) {
newCtx->dri.drawable = driDrawPriv;
+ newCtx->dri.readable = driReadPriv;
+
radeonUpdateWindow( newCtx->glCtx );
radeonUpdateViewportOffset( newCtx->glCtx );
}
-
+
_mesa_make_current( newCtx->glCtx,
(GLframebuffer *) driDrawPriv->driverPrivate,
(GLframebuffer *) driReadPriv->driverPrivate );