Slightly neater submission of commands
authorThomas White <taw@bitwiz.org.uk>
Sat, 2 May 2009 18:53:40 +0000 (19:53 +0100)
committerThomas White <taw@bitwiz.org.uk>
Sat, 2 May 2009 18:53:40 +0000 (19:53 +0100)
gdri-cmdq-submission.c

index 2d7fdaf..40dfcc9 100644 (file)
@@ -111,25 +111,25 @@ int main()
                return 1;
        }
 
-       cmds = malloc(2*13*2);
+       cmds = malloc(1024);
 
        OUT_REG(GLAMO_REG_2D_DST_ADDRL, offset & 0xffff);
        OUT_REG(GLAMO_REG_2D_DST_ADDRH, (offset >> 16) & 0x7f);
        OUT_REG(GLAMO_REG_2D_DST_PITCH, (480*2) & 0x7ff);
        OUT_REG(GLAMO_REG_2D_DST_HEIGHT, 640);
        OUT_REG(GLAMO_REG_2D_PAT_FG, 0xABCD);
-       OUT_REG(GLAMO_REG_2D_COMMAND2, 0x00aa);
+       OUT_REG(GLAMO_REG_2D_COMMAND2, 0xf000);
        OUT_REG(GLAMO_REG_2D_ID1, 0);
        OUT_REG(GLAMO_REG_2D_ID2, 0);
-
        OUT_REG(GLAMO_REG_2D_DST_X, 20);
        OUT_REG(GLAMO_REG_2D_DST_Y, 20);
        OUT_REG(GLAMO_REG_2D_RECT_WIDTH, 100);
        OUT_REG(GLAMO_REG_2D_RECT_HEIGHT, 50);
+
        OUT_REG(GLAMO_REG_2D_COMMAND3, 0);
 
        cmdbuf.buf = (char *)cmds;
-       cmdbuf.bufsz = 2*13*2;
+       cmdbuf.bufsz = 2*__count;
        r = drmCommandWrite(fd, DRM_GLAMO_CMDBUF, &cmdbuf, sizeof(cmdbuf));
        if ( r != 0 ) {
             fprintf(stderr, "DRM_GLAMO_CMDBUF failed");