Add offset and pitch fields to intelRegion. Remove frontOffset, frontPitch,
backOffset, backPitch, depthOffset, depthPitch, textureOffset fields.
This commit is contained in:
@@ -389,7 +389,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
|
|||||||
if(mask & BUFFER_BIT_FRONT_LEFT) {
|
if(mask & BUFFER_BIT_FRONT_LEFT) {
|
||||||
set_no_depth_stencil_write( i830 );
|
set_no_depth_stencil_write( i830 );
|
||||||
set_color_mask( i830, GL_TRUE );
|
set_color_mask( i830, GL_TRUE );
|
||||||
set_draw_offset( i830, screen->frontOffset );
|
set_draw_offset( i830, screen->front.offset );
|
||||||
draw_quad(i830, x0, x1, y0, y1,
|
draw_quad(i830, x0, x1, y0, y1,
|
||||||
intel->clear_red, intel->clear_green,
|
intel->clear_red, intel->clear_green,
|
||||||
intel->clear_blue, intel->clear_alpha,
|
intel->clear_blue, intel->clear_alpha,
|
||||||
@@ -399,7 +399,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
|
|||||||
if(mask & BUFFER_BIT_BACK_LEFT) {
|
if(mask & BUFFER_BIT_BACK_LEFT) {
|
||||||
set_no_depth_stencil_write( i830 );
|
set_no_depth_stencil_write( i830 );
|
||||||
set_color_mask( i830, GL_TRUE );
|
set_color_mask( i830, GL_TRUE );
|
||||||
set_draw_offset( i830, screen->backOffset );
|
set_draw_offset( i830, screen->back.offset );
|
||||||
|
|
||||||
draw_quad(i830, x0, x1, y0, y1,
|
draw_quad(i830, x0, x1, y0, y1,
|
||||||
intel->clear_red, intel->clear_green,
|
intel->clear_red, intel->clear_green,
|
||||||
@@ -413,7 +413,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask,
|
|||||||
intel->ctx.Stencil.Clear);
|
intel->ctx.Stencil.Clear);
|
||||||
|
|
||||||
set_color_mask( i830, GL_FALSE );
|
set_color_mask( i830, GL_FALSE );
|
||||||
set_draw_offset( i830, screen->frontOffset );
|
set_draw_offset( i830, screen->front.offset );
|
||||||
draw_quad( i830, x0, x1, y0, y1, 0, 0, 0, 0, 0, 0, 0, 0 );
|
draw_quad( i830, x0, x1, y0, y1, 0, 0, 0, 0, 0, 0, 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,7 +542,7 @@ i830TryTextureReadPixels( GLcontext *ctx,
|
|||||||
src_offset,
|
src_offset,
|
||||||
screen->width,
|
screen->width,
|
||||||
screen->height,
|
screen->height,
|
||||||
screen->frontPitch,
|
screen->front.pitch,
|
||||||
textureFormat );
|
textureFormat );
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1000,16 +1000,16 @@ static void i830_init_packets( i830ContextPtr i830 )
|
|||||||
i830->state.Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
i830->state.Buffer[I830_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
||||||
i830->state.Buffer[I830_DESTREG_CBUFADDR1] =
|
i830->state.Buffer[I830_DESTREG_CBUFADDR1] =
|
||||||
(BUF_3D_ID_COLOR_BACK |
|
(BUF_3D_ID_COLOR_BACK |
|
||||||
BUF_3D_PITCH(screen->frontPitch * screen->cpp) |
|
BUF_3D_PITCH(screen->front.pitch * screen->cpp) |
|
||||||
BUF_3D_USE_FENCE);
|
BUF_3D_USE_FENCE);
|
||||||
|
|
||||||
|
|
||||||
i830->state.Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
i830->state.Buffer[I830_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
||||||
i830->state.Buffer[I830_DESTREG_DBUFADDR1] =
|
i830->state.Buffer[I830_DESTREG_DBUFADDR1] =
|
||||||
(BUF_3D_ID_DEPTH |
|
(BUF_3D_ID_DEPTH |
|
||||||
BUF_3D_PITCH(screen->depthPitch * screen->cpp) |
|
BUF_3D_PITCH(screen->depth.pitch * screen->cpp) |
|
||||||
BUF_3D_USE_FENCE);
|
BUF_3D_USE_FENCE);
|
||||||
i830->state.Buffer[I830_DESTREG_DBUFADDR2] = screen->depthOffset;
|
i830->state.Buffer[I830_DESTREG_DBUFADDR2] = screen->depth.offset;
|
||||||
|
|
||||||
|
|
||||||
i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
|
i830->state.Buffer[I830_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
|
||||||
|
@@ -478,7 +478,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
|
|||||||
if (mask & BUFFER_BIT_FRONT_LEFT) {
|
if (mask & BUFFER_BIT_FRONT_LEFT) {
|
||||||
set_no_depth_stencil_write( i915 );
|
set_no_depth_stencil_write( i915 );
|
||||||
set_color_mask( i915, GL_TRUE );
|
set_color_mask( i915, GL_TRUE );
|
||||||
set_draw_offset( i915, screen->frontOffset );
|
set_draw_offset( i915, screen->front.offset );
|
||||||
|
|
||||||
draw_quad(i915, x0, x1, y0, y1,
|
draw_quad(i915, x0, x1, y0, y1,
|
||||||
intel->clear_red, intel->clear_green,
|
intel->clear_red, intel->clear_green,
|
||||||
@@ -489,7 +489,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
|
|||||||
if (mask & BUFFER_BIT_BACK_LEFT) {
|
if (mask & BUFFER_BIT_BACK_LEFT) {
|
||||||
set_no_depth_stencil_write( i915 );
|
set_no_depth_stencil_write( i915 );
|
||||||
set_color_mask( i915, GL_TRUE );
|
set_color_mask( i915, GL_TRUE );
|
||||||
set_draw_offset( i915, screen->backOffset );
|
set_draw_offset( i915, screen->back.offset );
|
||||||
|
|
||||||
draw_quad(i915, x0, x1, y0, y1,
|
draw_quad(i915, x0, x1, y0, y1,
|
||||||
intel->clear_red, intel->clear_green,
|
intel->clear_red, intel->clear_green,
|
||||||
@@ -503,7 +503,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask,
|
|||||||
intel->ctx.Stencil.Clear);
|
intel->ctx.Stencil.Clear);
|
||||||
|
|
||||||
set_color_mask( i915, GL_FALSE );
|
set_color_mask( i915, GL_FALSE );
|
||||||
set_draw_offset( i915, screen->frontOffset ); /* could be either? */
|
set_draw_offset( i915, screen->front.offset ); /* could be either? */
|
||||||
|
|
||||||
draw_quad( i915, x0, x1, y0, y1, 0, 0, 0, 0, 0, 0, 0, 0 );
|
draw_quad( i915, x0, x1, y0, y1, 0, 0, 0, 0, 0, 0, 0, 0 );
|
||||||
}
|
}
|
||||||
|
@@ -856,16 +856,16 @@ static void i915_init_packets( i915ContextPtr i915 )
|
|||||||
i915->state.Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
i915->state.Buffer[I915_DESTREG_CBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
||||||
i915->state.Buffer[I915_DESTREG_CBUFADDR1] =
|
i915->state.Buffer[I915_DESTREG_CBUFADDR1] =
|
||||||
(BUF_3D_ID_COLOR_BACK |
|
(BUF_3D_ID_COLOR_BACK |
|
||||||
BUF_3D_PITCH(screen->frontPitch * screen->cpp) |
|
BUF_3D_PITCH(screen->front.pitch * screen->cpp) |
|
||||||
BUF_3D_USE_FENCE);
|
BUF_3D_USE_FENCE);
|
||||||
|
|
||||||
|
|
||||||
i915->state.Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
i915->state.Buffer[I915_DESTREG_DBUFADDR0] = _3DSTATE_BUF_INFO_CMD;
|
||||||
i915->state.Buffer[I915_DESTREG_DBUFADDR1] =
|
i915->state.Buffer[I915_DESTREG_DBUFADDR1] =
|
||||||
(BUF_3D_ID_DEPTH |
|
(BUF_3D_ID_DEPTH |
|
||||||
BUF_3D_PITCH(screen->depthPitch * screen->cpp) |
|
BUF_3D_PITCH(screen->depth.pitch * screen->cpp) |
|
||||||
BUF_3D_USE_FENCE);
|
BUF_3D_USE_FENCE);
|
||||||
i915->state.Buffer[I915_DESTREG_DBUFADDR2] = screen->depthOffset;
|
i915->state.Buffer[I915_DESTREG_DBUFADDR2] = screen->depth.offset;
|
||||||
|
|
||||||
|
|
||||||
i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
|
i915->state.Buffer[I915_DESTREG_DV0] = _3DSTATE_DST_BUF_VARS_CMD;
|
||||||
|
@@ -51,8 +51,8 @@ static void intel_fill_box( intelContextPtr intel,
|
|||||||
{
|
{
|
||||||
intelEmitFillBlitLocked( intel,
|
intelEmitFillBlitLocked( intel,
|
||||||
intel->intelScreen->cpp,
|
intel->intelScreen->cpp,
|
||||||
intel->intelScreen->backPitch,
|
intel->intelScreen->back.pitch,
|
||||||
intel->intelScreen->frontOffset,
|
intel->intelScreen->front.offset,
|
||||||
x, y, w, h,
|
x, y, w, h,
|
||||||
INTEL_PACKCOLOR(intel->intelScreen->fbFormat,
|
INTEL_PACKCOLOR(intel->intelScreen->fbFormat,
|
||||||
r,g,b,0xff));
|
r,g,b,0xff));
|
||||||
@@ -338,7 +338,7 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
|
|||||||
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
||||||
int nbox = dPriv->numClipRects;
|
int nbox = dPriv->numClipRects;
|
||||||
drm_clip_rect_t *pbox = dPriv->pClipRects;
|
drm_clip_rect_t *pbox = dPriv->pClipRects;
|
||||||
int pitch = intelScreen->frontPitch;
|
int pitch = intelScreen->front.pitch;
|
||||||
int cpp = intelScreen->cpp;
|
int cpp = intelScreen->cpp;
|
||||||
int i;
|
int i;
|
||||||
GLuint CMD, BR13;
|
GLuint CMD, BR13;
|
||||||
@@ -378,17 +378,17 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv )
|
|||||||
OUT_BATCH( (pbox->y2 << 16) | pbox->x2 );
|
OUT_BATCH( (pbox->y2 << 16) | pbox->x2 );
|
||||||
|
|
||||||
if (intel->sarea->pf_current_page == 0)
|
if (intel->sarea->pf_current_page == 0)
|
||||||
OUT_BATCH( intelScreen->frontOffset );
|
OUT_BATCH( intelScreen->front.offset );
|
||||||
else
|
else
|
||||||
OUT_BATCH( intelScreen->backOffset );
|
OUT_BATCH( intelScreen->back.offset );
|
||||||
|
|
||||||
OUT_BATCH( (pbox->y1 << 16) | pbox->x1 );
|
OUT_BATCH( (pbox->y1 << 16) | pbox->x1 );
|
||||||
OUT_BATCH( BR13 & 0xffff );
|
OUT_BATCH( BR13 & 0xffff );
|
||||||
|
|
||||||
if (intel->sarea->pf_current_page == 0)
|
if (intel->sarea->pf_current_page == 0)
|
||||||
OUT_BATCH( intelScreen->backOffset );
|
OUT_BATCH( intelScreen->back.offset );
|
||||||
else
|
else
|
||||||
OUT_BATCH( intelScreen->frontOffset );
|
OUT_BATCH( intelScreen->front.offset );
|
||||||
|
|
||||||
ADVANCE_BATCH();
|
ADVANCE_BATCH();
|
||||||
}
|
}
|
||||||
@@ -502,7 +502,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
|
|||||||
intelScreenPrivate *intelScreen = intel->intelScreen;
|
intelScreenPrivate *intelScreen = intel->intelScreen;
|
||||||
GLuint clear_depth, clear_color;
|
GLuint clear_depth, clear_color;
|
||||||
GLint cx, cy;
|
GLint cx, cy;
|
||||||
GLint pitch = intelScreen->frontPitch;
|
GLint pitch = intelScreen->front.pitch;
|
||||||
GLint cpp = intelScreen->cpp;
|
GLint cpp = intelScreen->cpp;
|
||||||
GLint i;
|
GLint i;
|
||||||
GLuint BR13, CMD, D_CMD;
|
GLuint BR13, CMD, D_CMD;
|
||||||
@@ -596,7 +596,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
|
|||||||
OUT_BATCH( BR13 );
|
OUT_BATCH( BR13 );
|
||||||
OUT_BATCH( (b.y1 << 16) | b.x1 );
|
OUT_BATCH( (b.y1 << 16) | b.x1 );
|
||||||
OUT_BATCH( (b.y2 << 16) | b.x2 );
|
OUT_BATCH( (b.y2 << 16) | b.x2 );
|
||||||
OUT_BATCH( intelScreen->frontOffset );
|
OUT_BATCH( intelScreen->front.offset );
|
||||||
OUT_BATCH( clear_color );
|
OUT_BATCH( clear_color );
|
||||||
ADVANCE_BATCH();
|
ADVANCE_BATCH();
|
||||||
}
|
}
|
||||||
@@ -607,7 +607,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
|
|||||||
OUT_BATCH( BR13 );
|
OUT_BATCH( BR13 );
|
||||||
OUT_BATCH( (b.y1 << 16) | b.x1 );
|
OUT_BATCH( (b.y1 << 16) | b.x1 );
|
||||||
OUT_BATCH( (b.y2 << 16) | b.x2 );
|
OUT_BATCH( (b.y2 << 16) | b.x2 );
|
||||||
OUT_BATCH( intelScreen->backOffset );
|
OUT_BATCH( intelScreen->back.offset );
|
||||||
OUT_BATCH( clear_color );
|
OUT_BATCH( clear_color );
|
||||||
ADVANCE_BATCH();
|
ADVANCE_BATCH();
|
||||||
}
|
}
|
||||||
@@ -618,7 +618,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all,
|
|||||||
OUT_BATCH( BR13 );
|
OUT_BATCH( BR13 );
|
||||||
OUT_BATCH( (b.y1 << 16) | b.x1 );
|
OUT_BATCH( (b.y1 << 16) | b.x1 );
|
||||||
OUT_BATCH( (b.y2 << 16) | b.x2 );
|
OUT_BATCH( (b.y2 << 16) | b.x2 );
|
||||||
OUT_BATCH( intelScreen->depthOffset );
|
OUT_BATCH( intelScreen->depth.offset );
|
||||||
OUT_BATCH( clear_depth );
|
OUT_BATCH( clear_depth );
|
||||||
ADVANCE_BATCH();
|
ADVANCE_BATCH();
|
||||||
}
|
}
|
||||||
|
@@ -558,7 +558,7 @@ GLuint intelAgpOffsetFromVirtual( intelContextPtr intel, const GLvoid *pointer )
|
|||||||
if (offset < 0 || offset > intel->intelScreen->tex.size)
|
if (offset < 0 || offset > intel->intelScreen->tex.size)
|
||||||
return ~0;
|
return ~0;
|
||||||
else
|
else
|
||||||
return intel->intelScreen->textureOffset + offset;
|
return intel->intelScreen->tex.offset + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -130,7 +130,7 @@ clip_pixelrect( const GLcontext *ctx,
|
|||||||
if (*height <= 0)
|
if (*height <= 0)
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
*size = ((*y + *height - 1) * intel->intelScreen->frontPitch +
|
*size = ((*y + *height - 1) * intel->intelScreen->front.pitch +
|
||||||
(*x + *width - 1) * intel->intelScreen->cpp);
|
(*x + *width - 1) * intel->intelScreen->cpp);
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
@@ -193,7 +193,7 @@ intelTryReadPixels( GLcontext *ctx,
|
|||||||
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
||||||
int nbox = dPriv->numClipRects;
|
int nbox = dPriv->numClipRects;
|
||||||
int src_offset = intel->drawOffset;
|
int src_offset = intel->drawOffset;
|
||||||
int src_pitch = intel->intelScreen->frontPitch;
|
int src_pitch = intel->intelScreen->front.pitch;
|
||||||
int dst_offset = intelAgpOffsetFromVirtual( intel, pixels);
|
int dst_offset = intelAgpOffsetFromVirtual( intel, pixels);
|
||||||
drm_clip_rect_t *box = dPriv->pClipRects;
|
drm_clip_rect_t *box = dPriv->pClipRects;
|
||||||
int i;
|
int i;
|
||||||
@@ -318,7 +318,7 @@ static void do_draw_pix( GLcontext *ctx,
|
|||||||
intelEmitCopyBlitLocked( intel,
|
intelEmitCopyBlitLocked( intel,
|
||||||
intel->intelScreen->cpp,
|
intel->intelScreen->cpp,
|
||||||
src_pitch, src_offset,
|
src_pitch, src_offset,
|
||||||
intel->intelScreen->frontPitch,
|
intel->intelScreen->front.pitch,
|
||||||
intel->drawOffset,
|
intel->drawOffset,
|
||||||
bx - x, by - y,
|
bx - x, by - y,
|
||||||
bx, by,
|
bx, by,
|
||||||
|
@@ -61,13 +61,13 @@ static void intelPrintDRIInfo(intelScreenPrivate *intelScreen,
|
|||||||
I830DRIPtr gDRIPriv)
|
I830DRIPtr gDRIPriv)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Front size : 0x%x\n", sPriv->fbSize);
|
fprintf(stderr, "Front size : 0x%x\n", sPriv->fbSize);
|
||||||
fprintf(stderr, "Front offset : 0x%x\n", intelScreen->frontOffset);
|
fprintf(stderr, "Front offset : 0x%x\n", intelScreen->front.offset);
|
||||||
fprintf(stderr, "Back size : 0x%x\n", intelScreen->back.size);
|
fprintf(stderr, "Back size : 0x%x\n", intelScreen->back.size);
|
||||||
fprintf(stderr, "Back offset : 0x%x\n", intelScreen->backOffset);
|
fprintf(stderr, "Back offset : 0x%x\n", intelScreen->back.offset);
|
||||||
fprintf(stderr, "Depth size : 0x%x\n", intelScreen->depth.size);
|
fprintf(stderr, "Depth size : 0x%x\n", intelScreen->depth.size);
|
||||||
fprintf(stderr, "Depth offset : 0x%x\n", intelScreen->depthOffset);
|
fprintf(stderr, "Depth offset : 0x%x\n", intelScreen->depth.offset);
|
||||||
fprintf(stderr, "Texture size : 0x%x\n", intelScreen->tex.size);
|
fprintf(stderr, "Texture size : 0x%x\n", intelScreen->tex.size);
|
||||||
fprintf(stderr, "Texture offset : 0x%x\n", intelScreen->textureOffset);
|
fprintf(stderr, "Texture offset : 0x%x\n", intelScreen->tex.offset);
|
||||||
fprintf(stderr, "Memory : 0x%x\n", gDRIPriv->mem);
|
fprintf(stderr, "Memory : 0x%x\n", gDRIPriv->mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,8 +102,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
intelScreen->height = gDRIPriv->height;
|
intelScreen->height = gDRIPriv->height;
|
||||||
intelScreen->mem = gDRIPriv->mem;
|
intelScreen->mem = gDRIPriv->mem;
|
||||||
intelScreen->cpp = gDRIPriv->cpp;
|
intelScreen->cpp = gDRIPriv->cpp;
|
||||||
intelScreen->frontPitch = gDRIPriv->fbStride;
|
|
||||||
intelScreen->frontOffset = gDRIPriv->fbOffset;
|
|
||||||
|
|
||||||
switch (gDRIPriv->bitsPerPixel) {
|
switch (gDRIPriv->bitsPerPixel) {
|
||||||
case 15: intelScreen->fbFormat = DV_PF_555; break;
|
case 15: intelScreen->fbFormat = DV_PF_555; break;
|
||||||
@@ -111,12 +109,12 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
case 32: intelScreen->fbFormat = DV_PF_8888; break;
|
case 32: intelScreen->fbFormat = DV_PF_8888; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
intelScreen->backOffset = gDRIPriv->backOffset;
|
intelScreen->front.pitch = gDRIPriv->fbStride;
|
||||||
intelScreen->backPitch = gDRIPriv->backPitch;
|
intelScreen->front.offset = gDRIPriv->fbOffset;
|
||||||
intelScreen->depthOffset = gDRIPriv->depthOffset;
|
intelScreen->front.map = sPriv->pFB;
|
||||||
intelScreen->depthPitch = gDRIPriv->depthPitch;
|
|
||||||
intelScreen->textureOffset = gDRIPriv->textureOffset;
|
intelScreen->back.offset = gDRIPriv->backOffset;
|
||||||
intelScreen->logTextureGranularity = gDRIPriv->logTextureGranularity;
|
intelScreen->back.pitch = gDRIPriv->backPitch;
|
||||||
intelScreen->back.handle = gDRIPriv->backbuffer;
|
intelScreen->back.handle = gDRIPriv->backbuffer;
|
||||||
intelScreen->back.size = gDRIPriv->backbufferSize;
|
intelScreen->back.size = gDRIPriv->backbufferSize;
|
||||||
|
|
||||||
@@ -131,6 +129,8 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
intelScreen->depth.offset = gDRIPriv->depthOffset;
|
||||||
|
intelScreen->depth.pitch = gDRIPriv->depthPitch;
|
||||||
intelScreen->depth.handle = gDRIPriv->depthbuffer;
|
intelScreen->depth.handle = gDRIPriv->depthbuffer;
|
||||||
intelScreen->depth.size = gDRIPriv->depthbufferSize;
|
intelScreen->depth.size = gDRIPriv->depthbufferSize;
|
||||||
|
|
||||||
@@ -146,6 +146,8 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
intelScreen->tex.offset = gDRIPriv->textureOffset;
|
||||||
|
intelScreen->logTextureGranularity = gDRIPriv->logTextureGranularity;
|
||||||
intelScreen->tex.handle = gDRIPriv->textures;
|
intelScreen->tex.handle = gDRIPriv->textures;
|
||||||
intelScreen->tex.size = gDRIPriv->textureSize;
|
intelScreen->tex.size = gDRIPriv->textureSize;
|
||||||
|
|
||||||
@@ -245,7 +247,7 @@ static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
|||||||
= driNewRenderbuffer(GL_RGBA,
|
= driNewRenderbuffer(GL_RGBA,
|
||||||
driScrnPriv->pFB,
|
driScrnPriv->pFB,
|
||||||
screen->cpp,
|
screen->cpp,
|
||||||
screen->frontOffset, screen->frontPitch,
|
screen->front.offset, screen->front.pitch,
|
||||||
driDrawPriv);
|
driDrawPriv);
|
||||||
intelSetSpanFunctions(frontRb, mesaVis);
|
intelSetSpanFunctions(frontRb, mesaVis);
|
||||||
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
|
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
|
||||||
@@ -256,7 +258,7 @@ static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
|||||||
= driNewRenderbuffer(GL_RGBA,
|
= driNewRenderbuffer(GL_RGBA,
|
||||||
screen->back.map,
|
screen->back.map,
|
||||||
screen->cpp,
|
screen->cpp,
|
||||||
screen->backOffset, screen->backPitch,
|
screen->back.offset, screen->back.pitch,
|
||||||
driDrawPriv);
|
driDrawPriv);
|
||||||
intelSetSpanFunctions(backRb, mesaVis);
|
intelSetSpanFunctions(backRb, mesaVis);
|
||||||
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
|
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
|
||||||
@@ -267,7 +269,7 @@ static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
|||||||
= driNewRenderbuffer(GL_DEPTH_COMPONENT16,
|
= driNewRenderbuffer(GL_DEPTH_COMPONENT16,
|
||||||
screen->depth.map,
|
screen->depth.map,
|
||||||
screen->cpp,
|
screen->cpp,
|
||||||
screen->depthOffset, screen->depthPitch,
|
screen->depth.offset, screen->depth.pitch,
|
||||||
driDrawPriv);
|
driDrawPriv);
|
||||||
intelSetSpanFunctions(depthRb, mesaVis);
|
intelSetSpanFunctions(depthRb, mesaVis);
|
||||||
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
|
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
|
||||||
@@ -277,7 +279,7 @@ static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
|||||||
= driNewRenderbuffer(GL_DEPTH_COMPONENT24,
|
= driNewRenderbuffer(GL_DEPTH_COMPONENT24,
|
||||||
screen->depth.map,
|
screen->depth.map,
|
||||||
screen->cpp,
|
screen->cpp,
|
||||||
screen->depthOffset, screen->depthPitch,
|
screen->depth.offset, screen->depth.pitch,
|
||||||
driDrawPriv);
|
driDrawPriv);
|
||||||
intelSetSpanFunctions(depthRb, mesaVis);
|
intelSetSpanFunctions(depthRb, mesaVis);
|
||||||
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
|
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
|
||||||
@@ -288,7 +290,7 @@ static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
|||||||
= driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
|
= driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
|
||||||
screen->depth.map,
|
screen->depth.map,
|
||||||
screen->cpp,
|
screen->cpp,
|
||||||
screen->depthOffset, screen->depthPitch,
|
screen->depth.offset, screen->depth.pitch,
|
||||||
driDrawPriv);
|
driDrawPriv);
|
||||||
intelSetSpanFunctions(stencilRb, mesaVis);
|
intelSetSpanFunctions(stencilRb, mesaVis);
|
||||||
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
|
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base);
|
||||||
|
@@ -34,8 +34,10 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
drm_handle_t handle;
|
drm_handle_t handle;
|
||||||
drmSize size;
|
drmSize size; /* region size in bytes */
|
||||||
char *map;
|
char *map; /* memory map */
|
||||||
|
int offset; /* from start of video mem, in bytes */
|
||||||
|
int pitch; /* row stride, in pixels */
|
||||||
} intelRegion;
|
} intelRegion;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -48,24 +50,12 @@ typedef struct
|
|||||||
int deviceID;
|
int deviceID;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int mem;
|
int mem; /* unused */
|
||||||
|
|
||||||
int cpp; /* for front and back buffers */
|
int cpp; /* for front and back buffers */
|
||||||
int bitsPerPixel;
|
int bitsPerPixel; /* unused */
|
||||||
|
|
||||||
int fbFormat;
|
int fbFormat;
|
||||||
|
|
||||||
int frontOffset;
|
|
||||||
int frontPitch;
|
|
||||||
|
|
||||||
int backOffset;
|
|
||||||
int backPitch;
|
|
||||||
|
|
||||||
int depthOffset;
|
|
||||||
int depthPitch;
|
|
||||||
|
|
||||||
|
|
||||||
int textureOffset;
|
|
||||||
int logTextureGranularity;
|
int logTextureGranularity;
|
||||||
|
|
||||||
__DRIscreenPrivate *driScrnPriv;
|
__DRIscreenPrivate *driScrnPriv;
|
||||||
|
@@ -193,9 +193,9 @@ static void intelDrawBuffer(GLcontext *ctx, GLenum mode )
|
|||||||
intelSetFrontClipRects( intel );
|
intelSetFrontClipRects( intel );
|
||||||
|
|
||||||
if (front) {
|
if (front) {
|
||||||
intel->drawOffset = screen->frontOffset;
|
intel->drawOffset = screen->front.offset;
|
||||||
} else {
|
} else {
|
||||||
intel->drawOffset = screen->backOffset;
|
intel->drawOffset = screen->back.offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel->vtbl.set_draw_offset( intel, intel->drawOffset );
|
intel->vtbl.set_draw_offset( intel, intel->drawOffset );
|
||||||
|
@@ -749,7 +749,7 @@ int intelUploadTexImages( intelContextPtr intel,
|
|||||||
|
|
||||||
/* Set the base offset of the texture image */
|
/* Set the base offset of the texture image */
|
||||||
t->BufAddr = intel->intelScreen->tex.map + t->base.memBlock->ofs;
|
t->BufAddr = intel->intelScreen->tex.map + t->base.memBlock->ofs;
|
||||||
t->TextureOffset = intel->intelScreen->textureOffset + t->base.memBlock->ofs;
|
t->TextureOffset = intel->intelScreen->tex.offset + t->base.memBlock->ofs;
|
||||||
t->dirty = ~0;
|
t->dirty = ~0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user