r300: prepare for texcopy code sharing
[mesa.git] / src / mesa / drivers / dri / r300 / r300_context.c
index 6995637288ac10f08079fb45e547e7c05e2141ee..e449590fbb832d923307ec8e91a17851d6daa5b4 100644 (file)
@@ -93,6 +93,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "main/remap_helper.h"
 
+void r300_init_texcopy_functions(struct dd_function_table *table);
 
 static const struct dri_extension card_extensions[] = {
   /* *INDENT-OFF* */
@@ -325,6 +326,8 @@ static void r300_init_vtbl(radeonContextPtr radeon)
                        radeon->vtbl.emit_query_finish = rv530_emit_query_finish_single_z;
        } else
                radeon->vtbl.emit_query_finish = r300_emit_query_finish;
+
+    radeon->vtbl.blit = r300_blit;
 }
 
 static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
@@ -462,10 +465,10 @@ static void r300InitIoctlFuncs(struct dd_function_table *functions)
 /* Create the device specific rendering context.
  */
 GLboolean r300CreateContext(const __GLcontextModes * glVisual,
-                           __DRIcontextPrivate * driContextPriv,
+                           __DRIcontext * driContextPriv,
                            void *sharedContextPrivate)
 {
-       __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv;
+       __DRIscreen *sPriv = driContextPriv->driScreenPriv;
        radeonScreenPtr screen = (radeonScreenPtr) (sPriv->private);
        struct dd_function_table functions;
        r300ContextPtr r300;
@@ -492,6 +495,10 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        radeonInitQueryObjFunctions(&functions);
        radeonInitBufferObjectFuncs(&functions);
 
+       if (r300->radeon.radeonScreen->kernel_mm) {
+               r300_init_texcopy_functions(&functions);
+       }
+
        if (!radeonInitContext(&r300->radeon, &functions,
                               glVisual, driContextPriv,
                               sharedContextPrivate)) {