Support linear format in i965.
authorHaihao Xiang <haihao.xiang@intel.com>
Wed, 27 Dec 2006 00:45:02 +0000 (16:45 -0800)
committerNian Wu <nian@graphics.(none)>
Wed, 27 Dec 2006 00:45:02 +0000 (16:45 -0800)
Fix bug #117 #118

src/mesa/drivers/dri/i965/intel_context.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h

index 6bcc984285ca03b2bb2479b27ab8f83aa840a958..1546b33108c7879dd410b3d0e964dc978d5e24dd 100644 (file)
@@ -440,7 +440,7 @@ GLboolean intelInitContext( struct intel_context *intel,
                                 intelScreen->cpp,
                                 intelScreen->front.pitch / intelScreen->cpp,
                                 intelScreen->height,
-                                GL_FALSE);
+                                intelScreen->front.tiled != 0); /* 0: LINEAR */
 
 
    intel->back_region = 
@@ -451,7 +451,7 @@ GLboolean intelInitContext( struct intel_context *intel,
                                 intelScreen->cpp,
                                 intelScreen->back.pitch / intelScreen->cpp,
                                 intelScreen->height,
-                                (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1);
+                                 intelScreen->back.tiled != 0);
 
    /* Still assuming front.cpp == depth.cpp
     *
@@ -467,7 +467,7 @@ GLboolean intelInitContext( struct intel_context *intel,
                                 intelScreen->cpp,
                                 intelScreen->depth.pitch / intelScreen->cpp,
                                 intelScreen->height,
-                                (INTEL_DEBUG & DEBUG_TILE) ? 0 : 1);
+                                 intelScreen->depth.tiled != 0);
    
    intel_bufferobj_init( intel );
    intel->batch = intel_batchbuffer_alloc( intel );
index 56e6a792fa25e75993268fa2e66d21edfe915dc5..8269deba664b284e9bedbb1c9333e42450a0f380 100644 (file)
@@ -230,16 +230,19 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
    intelScreen->front.pitch = sarea->pitch * intelScreen->cpp;
    intelScreen->front.handle = sarea->front_handle;
    intelScreen->front.size = sarea->front_size;
+   intelScreen->front.tiled = sarea->front_tiled;
 
    intelScreen->back.offset = sarea->back_offset;
    intelScreen->back.pitch = sarea->pitch * intelScreen->cpp;
    intelScreen->back.handle = sarea->back_handle;
    intelScreen->back.size = sarea->back_size;
-                        
+   intelScreen->back.tiled = sarea->back_tiled;
+
    intelScreen->depth.offset = sarea->depth_offset;
    intelScreen->depth.pitch = sarea->pitch * intelScreen->cpp;
    intelScreen->depth.handle = sarea->depth_handle;
    intelScreen->depth.size = sarea->depth_size;
+   intelScreen->depth.tiled = sarea->depth_tiled;
 
    intelScreen->tex.offset = sarea->tex_offset;
    intelScreen->logTextureGranularity = sarea->log_tex_granularity;
@@ -249,6 +252,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
    intelScreen->rotated.offset = sarea->rotated_offset;
    intelScreen->rotated.pitch = sarea->rotated_pitch * intelScreen->cpp;
    intelScreen->rotated.size = sarea->rotated_size;
+   intelScreen->rotated.tiled = sarea->rotated_tiled;
    intelScreen->current_rotation = sarea->rotation;
 #if 0
    matrix23Rotate(&intelScreen->rotMatrix,
index 094158afd851a369e255383f4ca659ba8db14117..bf9a716082d5888e1180362bbe57ada7c513c54e 100644 (file)
@@ -42,6 +42,7 @@ typedef struct {
    char *map;           /* memory map */
    int offset;          /* from start of video mem, in bytes */
    int pitch;           /* row stride, in pixels */
+   unsigned int tiled; 
 } intelRegion;
 
 typedef struct