Enable 3D engine gdrm-2.6.34
authorThomas White <taw@bitwiz.org.uk>
Sun, 6 Jun 2010 19:36:01 +0000 (21:36 +0200)
committerThomas White <taw@bitwiz.org.uk>
Sun, 6 Jun 2010 19:36:01 +0000 (21:36 +0200)
Turns out, this makes Mesa work a lot better.

Signed-off-by: Thomas White <taw@bitwiz.org.uk>
drivers/mfd/glamo/glamo-cmdq.c
drivers/mfd/glamo/glamo-core.c

index 28c5268..706685d 100644 (file)
@@ -465,10 +465,14 @@ int glamo_cmdq_setup(struct glamodrm_handle *gdrm)
 
        init_MUTEX(&gdrm->add_to_ring);
 
-       /* Enable 2D and 3D */
+       /* Enable 2D */
        glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_2D);
        glamo_engine_reset(gdrm->glamo_core, GLAMO_ENGINE_2D);
 
+       /* Enable 3D */
+       glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_3D);
+       glamo_engine_reset(gdrm->glamo_core, GLAMO_ENGINE_3D);
+
        /* Start by zeroing the command queue memory */
        for ( i=0; i<GLAMO_CMDQ_SIZE; i+=2 ) {
                iowrite16(0x0000, gdrm->cmdq_base+i);
index a54106b..c4a4ad2 100644 (file)
@@ -472,6 +472,23 @@ static const struct glamo_engine_reg_set glamo_2d_regs[] = {
        }
 };
 
+static const struct glamo_engine_reg_set glamo_3d_regs[] = {
+       { GLAMO_REG_CLOCK_3D,
+       GLAMO_CLOCK_3D_EN_M8CLK |
+       GLAMO_CLOCK_3D_DG_M8CLK,
+
+       GLAMO_CLOCK_3D_EN_ECLK |
+       GLAMO_CLOCK_3D_DG_ECLK,
+
+       GLAMO_CLOCK_3D_EN_RCLK |
+       GLAMO_CLOCK_3D_DG_RCLK
+       },
+       { GLAMO_REG_CLOCK_GEN5_1,
+       0,
+       GLAMO_CLOCK_GEN51_EN_DIV_GCLK,
+       }
+};
+
 static const struct glamo_engine_reg_set glamo_cmdq_regs[] = {
        { GLAMO_REG_CLOCK_2D,
        GLAMO_CLOCK_2D_EN_M6CLK,
@@ -493,6 +510,8 @@ static const struct glamo_engine_desc glamo_engines[] = {
                                        glamo_mmc_regs),
        [GLAMO_ENGINE_2D] = GLAMO_ENGINE("2D", GLAMO_HOSTBUS2_MMIO_EN_2D,
                                        glamo_2d_regs),
+       [GLAMO_ENGINE_3D] = GLAMO_ENGINE("3D", GLAMO_HOSTBUS2_MMIO_EN_3D,
+                                       glamo_3d_regs),
        [GLAMO_ENGINE_CMDQ] = GLAMO_ENGINE("CMDQ", GLAMO_HOSTBUS2_MMIO_EN_CQ,
                                        glamo_cmdq_regs),
 };
@@ -516,6 +535,7 @@ int __glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine)
        case GLAMO_ENGINE_LCD:
        case GLAMO_ENGINE_MMC:
        case GLAMO_ENGINE_2D:
+       case GLAMO_ENGINE_3D:
        case GLAMO_ENGINE_CMDQ:
                break;
        default:
@@ -562,6 +582,7 @@ int __glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine)
        case GLAMO_ENGINE_MMC:
        case GLAMO_ENGINE_2D:
        case GLAMO_ENGINE_CMDQ:
+       case GLAMO_ENGINE_3D:
                break;
        default:
                return -EINVAL;
@@ -654,6 +675,10 @@ static const struct glamo_script reset_regs[] = {
        [GLAMO_ENGINE_2D] = {
                GLAMO_REG_CLOCK_2D, GLAMO_CLOCK_2D_RESET
        },
+       [GLAMO_ENGINE_3D] = {
+               GLAMO_REG_CLOCK_3D, GLAMO_CLOCK_3D_BACK_RESET |
+                                   GLAMO_CLOCK_3D_FRONT_RESET
+       },
        [GLAMO_ENGINE_JPEG] = {
                GLAMO_REG_CLOCK_JPEG, GLAMO_CLOCK_JPEG_RESET
        },