mesa: lift default symlinks target into Makefile.template
[mesa.git] / src / mesa / drivers / dri / r300 / r300_ioctl.c
index da801f42e4c80f21a3907097e75fb1818237d8e2..5cb04e2bb6d3036245f1bc512a5bd52fe199c7f7 100644 (file)
@@ -57,7 +57,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "radeon_reg.h"
 #include "r300_emit.h"
 #include "r300_context.h"
-#include "r300_queryobj.h"
 
 #include "vblank.h"
 
@@ -139,7 +138,7 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags,
        GLuint cbpitch = 0;
        r300ContextPtr rmesa = r300;
 
-       if (RADEON_DEBUG & DEBUG_IOCTL)
+       if (RADEON_DEBUG & RADEON_IOCTL)
                fprintf(stderr, "%s: buffer %p (%i,%i %ix%i)\n",
                        __FUNCTION__, rrb, dPriv->x, dPriv->y,
                        dPriv->w, dPriv->h);
@@ -508,7 +507,15 @@ static void r300EmitClearState(GLcontext * ctx)
                        R500_ALU_RGBA_A_SWIZ_0;
 
                r500fp.cmd[7] = 0;
-               emit_r500fp(ctx, &r500fp);
+               if (r300->radeon.radeonScreen->kernel_mm) {
+                       emit_r500fp(ctx, &r500fp);
+               } else {
+                       int dwords = r500fp.check(ctx,&r500fp);
+                       BEGIN_BATCH_NO_AUTOSTATE(dwords);
+                       OUT_BATCH_TABLE(r500fp.cmd, dwords);
+                       END_BATCH();
+               }
+
        }
 
        BEGIN_BATCH(2);
@@ -552,6 +559,7 @@ static void r300EmitClearState(GLcontext * ctx)
         struct radeon_state_atom vpu;
         uint32_t _cmd[10];
                R300_STATECHANGE(r300, pvs);
+               R300_STATECHANGE(r300, vap_flush);
                R300_STATECHANGE(r300, vpi);
 
                BEGIN_BATCH(4);
@@ -593,8 +601,19 @@ static void r300EmitClearState(GLcontext * ctx)
                                       PVS_SRC_REG_INPUT, NEGATE_NONE);
                vpu.cmd[8] = 0x0;
 
-               r300->vap_flush_needed = GL_TRUE;
-               emit_vpu(ctx, &vpu);
+               if (r300->radeon.radeonScreen->kernel_mm) {
+                       int dwords = r300->hw.vap_flush.check(ctx,&r300->hw.vap_flush);
+                       BEGIN_BATCH_NO_AUTOSTATE(dwords);
+                       OUT_BATCH_TABLE(r300->hw.vap_flush.cmd, dwords);
+                       END_BATCH();
+                       emit_vpu(ctx, &vpu);
+               } else {
+                       int dwords = vpu.check(ctx,&vpu);
+                       BEGIN_BATCH_NO_AUTOSTATE(dwords);
+                       OUT_BATCH_TABLE(vpu.cmd, dwords);
+                       END_BATCH();
+               }
+
        }
 }
 
@@ -686,7 +705,7 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask)
        int i, ret;
        struct gl_framebuffer *fb = ctx->DrawBuffer;
 
-       if (RADEON_DEBUG & DEBUG_IOCTL)
+       if (RADEON_DEBUG & RADEON_IOCTL)
                fprintf(stderr, "r300Clear\n");
 
        if (!r300->radeon.radeonScreen->driScreen->dri2.enabled) {
@@ -748,26 +767,16 @@ static void r300Clear(GLcontext * ctx, GLbitfield mask)
        }
 
        if (swrast_mask) {
-               if (RADEON_DEBUG & DEBUG_FALLBACKS)
+               if (RADEON_DEBUG & RADEON_FALLBACKS)
                        fprintf(stderr, "%s: swrast clear, mask: %x\n",
                                __FUNCTION__, swrast_mask);
                _swrast_Clear(ctx, swrast_mask);
        }
 }
 
-static void r300Flush(GLcontext *ctx)
-{
-       r300ContextPtr r300 = R300_CONTEXT(ctx);
-
-       radeonFlush(ctx);
-
-       make_empty_list(&r300->query.not_flushed_head);
-}
-
-
 void r300InitIoctlFuncs(struct dd_function_table *functions)
 {
        functions->Clear = r300Clear;
        functions->Finish = radeonFinish;
-       functions->Flush = r300Flush;
+       functions->Flush = radeonFlush;
 }