r100/r200/r300/r300: only enable accelerated pixel ops with kms
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 12 Mar 2010 16:16:50 +0000 (11:16 -0500)
committerAlex Deucher <alexdeucher@gmail.com>
Fri, 12 Mar 2010 16:19:36 +0000 (11:19 -0500)
fixes fdo bug 27043

src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r200/r200_state.h
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_state.h
src/mesa/drivers/dri/r600/r600_context.c
src/mesa/drivers/dri/r600/r700_state.c
src/mesa/drivers/dri/r600/r700_state.h
src/mesa/drivers/dri/radeon/radeon_state.c

index 5739443bdf2dd26dbece3094c5c7ddab15343c98..36a29350ccc3f1f7035898ec54875f2472e82d82 100644 (file)
@@ -324,7 +324,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
    _mesa_init_driver_functions(&functions);
    r200InitDriverFuncs(&functions);
    r200InitIoctlFuncs(&functions);
-   r200InitStateFuncs(&functions);
+   r200InitStateFuncs(&rmesa->radeon, &functions);
    r200InitTextureFuncs(&rmesa->radeon, &functions);
    r200InitShaderFuncs(&functions);
    radeonInitQueryObjFunctions(&functions);
index 71f764aaaefae93c1bf639b867fa77dcae9e440a..9c2ac05ad6c55a4b489dd02eef939306e298aa05 100644 (file)
@@ -2488,16 +2488,19 @@ static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask )
 }
 /* Initialize the driver's state functions.
  */
-void r200InitStateFuncs( struct dd_function_table *functions )
+void r200InitStateFuncs( radeonContextPtr radeon, struct dd_function_table *functions )
 {
    functions->UpdateState              = r200InvalidateState;
    functions->LightingSpaceChange      = r200LightingSpaceChange;
 
    functions->DrawBuffer               = radeonDrawBuffer;
    functions->ReadBuffer               = radeonReadBuffer;
-   functions->CopyPixels                = _mesa_meta_CopyPixels;
-   functions->DrawPixels                = _mesa_meta_DrawPixels;
-   functions->ReadPixels                = radeonReadPixels;
+
+   if (radeon->radeonScreen->kernel_mm) {
+          functions->CopyPixels                = _mesa_meta_CopyPixels;
+          functions->DrawPixels                = _mesa_meta_DrawPixels;
+          functions->ReadPixels                = radeonReadPixels;
+   }
 
    functions->AlphaFunc                        = r200AlphaFunc;
    functions->BlendColor               = r200BlendColor;
index 7b9b0c106aa10876d0574bc82fc9a9b928186c0f..327ba837e25516602f78189484955e411f6b8fe5 100644 (file)
@@ -38,7 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r200_context.h"
 
 extern void r200InitState( r200ContextPtr rmesa );
-extern void r200InitStateFuncs( struct dd_function_table *functions );
+extern void r200InitStateFuncs( radeonContextPtr radeon, struct dd_function_table *functions );
 extern void r200InitTnlFuncs( GLcontext *ctx );
 
 extern void r200UpdateMaterial( GLcontext *ctx );
index 364e0ba6b6147f07e7c36b716a87b196f7a6b41e..cfeb5407e914499b4833bd9573ca7a9275a20a01 100644 (file)
@@ -500,7 +500,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
 
        _mesa_init_driver_functions(&functions);
        r300InitIoctlFuncs(&functions);
-       r300InitStateFuncs(&functions);
+       r300InitStateFuncs(&r300->radeon, &functions);
        r300InitTextureFuncs(&r300->radeon, &functions);
        r300InitShaderFuncs(&functions);
        radeonInitQueryObjFunctions(&functions);
index e75c88e101b7b51b82cdbb751ff93e38974f4dff..749a2464e7cbf3ee66acc1e757e071542677e7b1 100644 (file)
@@ -2354,7 +2354,7 @@ static void r300RenderMode(GLcontext * ctx, GLenum mode)
 /**
  * Initialize driver's state callback functions
  */
-void r300InitStateFuncs(struct dd_function_table *functions)
+void r300InitStateFuncs(radeonContextPtr radeon, struct dd_function_table *functions)
 {
 
        functions->UpdateState = r300InvalidateState;
@@ -2396,9 +2396,11 @@ void r300InitStateFuncs(struct dd_function_table *functions)
        functions->DrawBuffer = radeonDrawBuffer;
        functions->ReadBuffer = radeonReadBuffer;
 
-       functions->CopyPixels = _mesa_meta_CopyPixels;
-       functions->DrawPixels = _mesa_meta_DrawPixels;
-       functions->ReadPixels = radeonReadPixels;
+       if (radeon->radeonScreen->kernel_mm) {
+               functions->CopyPixels = _mesa_meta_CopyPixels;
+               functions->DrawPixels = _mesa_meta_DrawPixels;
+               functions->ReadPixels = radeonReadPixels;
+       }
 }
 
 void r300InitShaderFunctions(r300ContextPtr r300)
index d46bf9f179685b68981c61aa00c28be361754f86..e70f84f4e4b69a76c3eae08820725763f9394e84 100644 (file)
@@ -55,7 +55,7 @@ void r300UpdateDrawBuffer (GLcontext * ctx);
 void r300UpdateShaders (r300ContextPtr rmesa);
 void r300UpdateShaderStates (r300ContextPtr rmesa);
 void r300InitState (r300ContextPtr r300);
-void r300InitStateFuncs (struct dd_function_table *functions);
+void r300InitStateFuncs (radeonContextPtr radeon, struct dd_function_table *functions);
 void r300VapCntl(r300ContextPtr rmesa, GLuint input_count, GLuint output_count, GLuint temp_count);
 void r300SetupVAP(GLcontext *ctx, GLuint InputsRead, GLuint OutputsWritten);
 
index 76d5027649e30a1c238dd91b5f81f0b003c59496..fddac2f9bdc8011c887c954acb254e8308ca0ab5 100644 (file)
@@ -384,7 +384,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual,
         */
        _mesa_init_driver_functions(&functions);
 
-       r700InitStateFuncs(&functions);
+       r700InitStateFuncs(&r600->radeon, &functions);
        r600InitTextureFuncs(&r600->radeon, &functions);
        r700InitShaderFuncs(&functions);
        radeonInitQueryObjFunctions(&functions);
index 8797f8059a9944ffd0cfd2180b438f8043117dcc..2953ffd0288651f48fe06f7c1066757089f4321e 100644 (file)
@@ -1817,7 +1817,7 @@ void r700InitState(GLcontext * ctx) //-------------------
 
 }
 
-void r700InitStateFuncs(struct dd_function_table *functions) //-----------------
+void r700InitStateFuncs(radeonContextPtr radeon, struct dd_function_table *functions)
 {
        functions->UpdateState = r700InvalidateState;
        functions->AlphaFunc = r700AlphaFunc;
@@ -1861,9 +1861,10 @@ void r700InitStateFuncs(struct dd_function_table *functions) //-----------------
        functions->DrawBuffer = radeonDrawBuffer;
        functions->ReadBuffer = radeonReadBuffer;
 
-       functions->CopyPixels = _mesa_meta_CopyPixels;
-       functions->DrawPixels = _mesa_meta_DrawPixels;
-       functions->ReadPixels = radeonReadPixels;
-
+       if (radeon->radeonScreen->kernel_mm) {
+               functions->CopyPixels = _mesa_meta_CopyPixels;
+               functions->DrawPixels = _mesa_meta_DrawPixels;
+               functions->ReadPixels = radeonReadPixels;
+       }
 }
 
index 60c6a7f23ca7d59e508bddd12b9a48ad2e950b07..56885e0b15450fe0676b93ec04671fd36a0b2873 100644 (file)
@@ -40,7 +40,7 @@ extern void r700UpdateShaderStates(GLcontext * ctx);
 extern void r700UpdateViewportOffset(GLcontext * ctx);
 
 extern void r700InitState (GLcontext * ctx);
-extern void r700InitStateFuncs (struct dd_function_table *functions);
+extern void r700InitStateFuncs (radeonContextPtr radeon, struct dd_function_table *functions);
 
 extern void r700SetScissor(context_t *context);
 
index ec5612fdd7f9f0702ea2d67f7e22effdc505abd9..ebae0792aa569fb9a9a2f783dbb342f0e1afa871 100644 (file)
@@ -2249,9 +2249,11 @@ void radeonInitStateFuncs( GLcontext *ctx , GLboolean dri2 )
 
    ctx->Driver.DrawBuffer              = radeonDrawBuffer;
    ctx->Driver.ReadBuffer              = radeonReadBuffer;
-   ctx->Driver.CopyPixels               = _mesa_meta_CopyPixels;
-   ctx->Driver.DrawPixels               = _mesa_meta_DrawPixels;
-   ctx->Driver.ReadPixels               = radeonReadPixels;
+   if (dri2) {
+          ctx->Driver.CopyPixels               = _mesa_meta_CopyPixels;
+          ctx->Driver.DrawPixels               = _mesa_meta_DrawPixels;
+          ctx->Driver.ReadPixels               = radeonReadPixels;
+   }
 
    ctx->Driver.AlphaFunc               = radeonAlphaFunc;
    ctx->Driver.BlendEquationSeparate   = radeonBlendEquationSeparate;