summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-10-06 18:37:05 -0700
committerEric Anholt <eric@anholt.net>2009-10-08 15:34:09 -0700
commitda0f6616ad63f1581cf91a98104e5287aa44e7ce (patch)
treed9987ea4583c0f5864ff7cd79b5fd3e0f3a6a52b /src
parent050a141b7bc94b459061615124b7686a9c331e01 (diff)
de-pCamelHungarian the Render pictures and pixmaps.
Diffstat (limited to 'src')
-rw-r--r--src/i830.h39
-rw-r--r--src/i830_dri.c6
-rw-r--r--src/i830_render.c148
-rw-r--r--src/i830_uxa.c46
-rw-r--r--src/i915_render.c178
-rw-r--r--src/i965_render.c156
6 files changed, 286 insertions, 287 deletions
diff --git a/src/i830.h b/src/i830.h
index a505cb54..442ad100 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -230,7 +230,6 @@ typedef struct intel_screen_private {
uxa_driver_t *uxa_driver;
Bool need_flush;
- PixmapPtr pSrcPixmap;
int accel_pixmap_pitch_alignment;
int accel_pixmap_offset_alignment;
int accel_max_x;
@@ -383,23 +382,23 @@ void i830_set_max_gtt_map_size(ScrnInfoPtr scrn);
i830_memory *i830_allocate_framebuffer(ScrnInfoPtr scrn);
/* i830_render.c */
-Bool i830_check_composite(int op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst);
-Bool i830_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst, PixmapPtr pSrcPixmap,
- PixmapPtr pMaskPixmap, PixmapPtr pDstPixmap);
+Bool i830_check_composite(int op, PicturePtr sourcec, PicturePtr mask,
+ PicturePtr dest);
+Bool i830_prepare_composite(int op, PicturePtr sourcec, PicturePtr mask,
+ PicturePtr dest, PixmapPtr sourcecPixmap,
+ PixmapPtr maskPixmap, PixmapPtr destPixmap);
Bool i830_transform_is_affine(PictTransformPtr t);
-void i830_composite(PixmapPtr pDst, int srcX, int srcY,
+void i830_composite(PixmapPtr dest, int srcX, int srcY,
int maskX, int maskY, int dstX, int dstY, int w, int h);
-void i830_done_composite(PixmapPtr pDst);
+void i830_done_composite(PixmapPtr dest);
/* i915_render.c */
-Bool i915_check_composite(int op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst);
-Bool i915_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst, PixmapPtr pSrcPixmap,
- PixmapPtr pMaskPixmap, PixmapPtr pDstPixmap);
-void i915_composite(PixmapPtr pDst, int srcX, int srcY,
+Bool i915_check_composite(int op, PicturePtr sourcec, PicturePtr mask,
+ PicturePtr dest);
+Bool i915_prepare_composite(int op, PicturePtr sourcec, PicturePtr mask,
+ PicturePtr dest, PixmapPtr sourcecPixmap,
+ PixmapPtr maskPixmap, PixmapPtr destPixmap);
+void i915_composite(PixmapPtr dest, int srcX, int srcY,
int maskX, int maskY, int dstX, int dstY, int w, int h);
void i915_batch_flush_notify(ScrnInfoPtr scrn);
void i830_batch_flush_notify(ScrnInfoPtr scrn);
@@ -407,12 +406,12 @@ void i830_batch_flush_notify(ScrnInfoPtr scrn);
unsigned int gen4_render_state_size(ScrnInfoPtr scrn);
void gen4_render_state_init(ScrnInfoPtr scrn);
void gen4_render_state_cleanup(ScrnInfoPtr scrn);
-Bool i965_check_composite(int op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst);
-Bool i965_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst, PixmapPtr pSrcPixmap,
- PixmapPtr pMaskPixmap, PixmapPtr pDstPixmap);
-void i965_composite(PixmapPtr pDst, int srcX, int srcY,
+Bool i965_check_composite(int op, PicturePtr sourcec, PicturePtr mask,
+ PicturePtr dest);
+Bool i965_prepare_composite(int op, PicturePtr sourcec, PicturePtr mask,
+ PicturePtr dest, PixmapPtr sourcecPixmap,
+ PixmapPtr maskPixmap, PixmapPtr destPixmap);
+void i965_composite(PixmapPtr dest, int srcX, int srcY,
int maskX, int maskY, int dstX, int dstY, int w, int h);
void i965_batch_flush_notify(ScrnInfoPtr scrn);
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 9e51b8c5..1c5ebbe8 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -272,10 +272,10 @@ static void I830DRI2DestroyBuffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer)
static void
I830DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
- DRI2BufferPtr pDstBuffer, DRI2BufferPtr pSrcBuffer)
+ DRI2BufferPtr destBuffer, DRI2BufferPtr sourceBuffer)
{
- I830DRI2BufferPrivatePtr srcPrivate = pSrcBuffer->driverPrivate;
- I830DRI2BufferPrivatePtr dstPrivate = pDstBuffer->driverPrivate;
+ I830DRI2BufferPrivatePtr srcPrivate = sourceBuffer->driverPrivate;
+ I830DRI2BufferPrivatePtr dstPrivate = destBuffer->driverPrivate;
ScreenPtr pScreen = pDraw->pScreen;
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
diff --git a/src/i830_render.c b/src/i830_render.c
index d463b536..d37e19d3 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -141,9 +141,9 @@ static struct formatinfo i830_tex_formats[] = {
{PICT_a8, MT_8BIT_A8},
};
-static Bool i830_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format)
+static Bool i830_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
{
- switch (pDstPicture->format) {
+ switch (dest_picture->format) {
case PICT_a8r8g8b8:
case PICT_x8r8g8b8:
*dst_format = COLR_BUF_ARGB8888;
@@ -167,16 +167,16 @@ static Bool i830_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format)
ScrnInfoPtr scrn;
scrn =
- xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ xf86Screens[dest_picture->pDrawable->pScreen->myNum];
I830FALLBACK("Unsupported dest format 0x%x\n",
- (int)pDstPicture->format);
+ (int)dest_picture->format);
}
}
*dst_format |= DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8);
return TRUE;
}
-static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr pMask,
+static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr mask,
uint32_t dst_format, uint32_t * blendctl)
{
uint32_t sblend, dblend;
@@ -207,7 +207,7 @@ static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr pMask,
* where the source blend factor is 0, and the source blend value is the
* mask channels multiplied by the source picture's alpha.
*/
- if (pMask && pMask->componentAlpha && PICT_FORMAT_RGB(pMask->format)
+ if (mask && mask->componentAlpha && PICT_FORMAT_RGB(mask->format)
&& i830_blend_op[op].src_alpha) {
if (dblend == BLENDFACTOR_SRC_ALPHA) {
dblend = BLENDFACTOR_SRC_COLR;
@@ -222,55 +222,55 @@ static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr pMask,
return TRUE;
}
-static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr pPict,
+static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
int unit)
{
- if (pPict->repeatType > RepeatReflect)
+ if (picture->repeatType > RepeatReflect)
I830FALLBACK("Unsupported picture repeat %d\n",
- pPict->repeatType);
+ picture->repeatType);
- if (pPict->filter != PictFilterNearest &&
- pPict->filter != PictFilterBilinear) {
- I830FALLBACK("Unsupported filter 0x%x\n", pPict->filter);
+ if (picture->filter != PictFilterNearest &&
+ picture->filter != PictFilterBilinear) {
+ I830FALLBACK("Unsupported filter 0x%x\n", picture->filter);
}
- if (pPict->pDrawable) {
+ if (picture->pDrawable) {
int w, h, i;
- w = pPict->pDrawable->width;
- h = pPict->pDrawable->height;
+ w = picture->pDrawable->width;
+ h = picture->pDrawable->height;
if ((w > 2048) || (h > 2048))
I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
for (i = 0;
i < sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]);
i++) {
- if (i830_tex_formats[i].fmt == pPict->format)
+ if (i830_tex_formats[i].fmt == picture->format)
break;
}
if (i == sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]))
I830FALLBACK("Unsupported picture format 0x%x\n",
- (int)pPict->format);
+ (int)picture->format);
}
return TRUE;
}
-static uint32_t i8xx_get_card_format(PicturePtr pPict)
+static uint32_t i8xx_get_card_format(PicturePtr picture)
{
int i;
for (i = 0; i < sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]);
i++) {
- if (i830_tex_formats[i].fmt == pPict->format)
+ if (i830_tex_formats[i].fmt == picture->format)
return i830_tex_formats[i].card_fmt;
}
- FatalError("Unsupported format type %d\n", pPict->format);
+ FatalError("Unsupported format type %d\n", picture->format);
}
-static void i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
+static void i830_texture_setup(PicturePtr picture, PixmapPtr pPix, int unit)
{
- ScrnInfoPtr scrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[picture->pDrawable->pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
uint32_t format, pitch, filter;
uint32_t wrap_mode;
@@ -279,16 +279,16 @@ static void i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
pitch = intel_get_pixmap_pitch(pPix);
intel->scale_units[unit][0] = pPix->drawable.width;
intel->scale_units[unit][1] = pPix->drawable.height;
- intel->transform[unit] = pPict->transform;
+ intel->transform[unit] = picture->transform;
if (i830_transform_is_affine(intel->transform[unit]))
texcoordtype = TEXCOORDTYPE_CARTESIAN;
else
texcoordtype = TEXCOORDTYPE_HOMOGENEOUS;
- format = i8xx_get_card_format(pPict);
+ format = i8xx_get_card_format(picture);
- switch (pPict->repeatType) {
+ switch (picture->repeatType) {
case RepeatNone:
wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
break;
@@ -302,10 +302,10 @@ static void i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
wrap_mode = TEXCOORDMODE_MIRROR;
break;
default:
- FatalError("Unknown repeat type %d\n", pPict->repeatType);
+ FatalError("Unknown repeat type %d\n", picture->repeatType);
}
- switch (pPict->filter) {
+ switch (picture->filter) {
case PictFilterNearest:
filter = ((FILTER_NEAREST << TM0S3_MAG_FILTER_SHIFT) |
(FILTER_NEAREST << TM0S3_MIN_FILTER_SHIFT));
@@ -316,7 +316,7 @@ static void i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
break;
default:
filter = 0;
- FatalError("Bad filter 0x%x\n", pPict->filter);
+ FatalError("Bad filter 0x%x\n", picture->filter);
}
filter |= (MIPFILTER_NONE << TM0S3_MIP_FILTER_SHIFT);
@@ -368,18 +368,18 @@ static void i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
}
Bool
-i830_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
- PicturePtr pDstPicture)
+i830_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
+ PicturePtr dest_picture)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
uint32_t tmp1;
/* Check for unsupported compositing operations. */
if (op >= sizeof(i830_blend_op) / sizeof(i830_blend_op[0]))
I830FALLBACK("Unsupported Composite op 0x%x\n", op);
- if (pMaskPicture != NULL && pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format)) {
+ if (mask_picture != NULL && mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format)) {
/* Check if it's component alpha that relies on a source alpha and on
* the source value. We can only get one of those into the single
* source value that we get to blend with.
@@ -391,49 +391,49 @@ i830_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
"alpha and source value blending.\n");
}
- if (!i830_check_composite_texture(scrn, pSrcPicture, 0))
+ if (!i830_check_composite_texture(scrn, source_picture, 0))
I830FALLBACK("Check Src picture texture\n");
- if (pMaskPicture != NULL
- && !i830_check_composite_texture(scrn, pMaskPicture, 1))
+ if (mask_picture != NULL
+ && !i830_check_composite_texture(scrn, mask_picture, 1))
I830FALLBACK("Check Mask picture texture\n");
- if (!i830_get_dest_format(pDstPicture, &tmp1))
+ if (!i830_get_dest_format(dest_picture, &tmp1))
I830FALLBACK("Get Color buffer format\n");
return TRUE;
}
Bool
-i830_prepare_composite(int op, PicturePtr pSrcPicture,
- PicturePtr pMaskPicture, PicturePtr pDstPicture,
- PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
+i830_prepare_composite(int op, PicturePtr source_picture,
+ PicturePtr mask_picture, PicturePtr dest_picture,
+ PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
- intel->render_source_picture = pSrcPicture;
- intel->render_source = pSrc;
- intel->render_mask_picture = pMaskPicture;
- intel->render_mask = pMask;
- intel->render_dest_picture = pDstPicture;
- intel->render_dest = pDst;
+ intel->render_source_picture = source_picture;
+ intel->render_source = source;
+ intel->render_mask_picture = mask_picture;
+ intel->render_mask = mask;
+ intel->render_dest_picture = dest_picture;
+ intel->render_dest = dest;
- i830_exa_check_pitch_3d(pSrc);
- if (pMask)
- i830_exa_check_pitch_3d(pMask);
- i830_exa_check_pitch_3d(pDst);
+ i830_exa_check_pitch_3d(source);
+ if (mask)
+ i830_exa_check_pitch_3d(mask);
+ i830_exa_check_pitch_3d(dest);
- if (!i830_get_dest_format(pDstPicture, &intel->render_dest_format))
+ if (!i830_get_dest_format(dest_picture, &intel->render_dest_format))
return FALSE;
intel->dst_coord_adjust = 0;
intel->src_coord_adjust = 0;
intel->mask_coord_adjust = 0;
- if (pSrcPicture->filter == PictFilterNearest)
+ if (source_picture->filter == PictFilterNearest)
intel->src_coord_adjust = 0.375;
- if (pMask != NULL) {
+ if (mask != NULL) {
intel->mask_coord_adjust = 0;
- if (pMaskPicture->filter == PictFilterNearest)
+ if (mask_picture->filter == PictFilterNearest)
intel->mask_coord_adjust = 0.375;
} else {
intel->transform[1] = NULL;
@@ -465,17 +465,17 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture,
TB0A_OUTPUT_WRITE_CURRENT;
/* Get the source picture's channels into TBx_ARG1 */
- if ((pMaskPicture != NULL &&
- pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format) &&
+ if ((mask_picture != NULL &&
+ mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format) &&
i830_blend_op[op].src_alpha)
- || pDstPicture->format == PICT_a8) {
+ || dest_picture->format == PICT_a8) {
/* Producing source alpha value, so the first set of channels
* is src.A instead of src.X. We also do this if the destination
* is a8, in which case src.G is what's written, and the other
* channels are ignored.
*/
- if (PICT_FORMAT_A(pSrcPicture->format) != 0) {
+ if (PICT_FORMAT_A(source_picture->format) != 0) {
ablend |= TB0A_ARG1_SEL_TEXEL0;
cblend |=
TB0C_ARG1_SEL_TEXEL0 |
@@ -485,30 +485,30 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture,
cblend |= TB0C_ARG1_SEL_ONE;
}
} else {
- if (PICT_FORMAT_A(pSrcPicture->format) != 0) {
+ if (PICT_FORMAT_A(source_picture->format) != 0) {
ablend |= TB0A_ARG1_SEL_TEXEL0;
} else {
ablend |= TB0A_ARG1_SEL_ONE;
}
- if (PICT_FORMAT_RGB(pSrcPicture->format) != 0)
+ if (PICT_FORMAT_RGB(source_picture->format) != 0)
cblend |= TB0C_ARG1_SEL_TEXEL0;
else
cblend |= TB0C_ARG1_SEL_ONE | TB0C_ARG1_INVERT; /* 0.0 */
}
- if (pMask) {
- if (pDstPicture->format != PICT_a8 &&
- (pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format))) {
+ if (mask) {
+ if (dest_picture->format != PICT_a8 &&
+ (mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format))) {
cblend |= TB0C_ARG2_SEL_TEXEL1;
} else {
- if (PICT_FORMAT_A(pMaskPicture->format) != 0)
+ if (PICT_FORMAT_A(mask_picture->format) != 0)
cblend |= TB0C_ARG2_SEL_TEXEL1 |
TB0C_ARG2_REPLICATE_ALPHA;
else
cblend |= TB0C_ARG2_SEL_ONE;
}
- if (PICT_FORMAT_A(pMaskPicture->format) != 0)
+ if (PICT_FORMAT_A(mask_picture->format) != 0)
ablend |= TB0A_ARG2_SEL_TEXEL1;
else
ablend |= TB0A_ARG2_SEL_ONE;
@@ -518,7 +518,7 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture,
}
if (!i830_get_blend_cntl
- (scrn, op, pMaskPicture, pDstPicture->format, &blendctl)) {
+ (scrn, op, mask_picture, dest_picture->format, &blendctl)) {
return FALSE;
}
@@ -617,12 +617,12 @@ static void i830_emit_composite_state(ScrnInfoPtr scrn)
* This function is no longer shared between i830 and i915 generation code.
*/
static void
-i830_emit_composite_primitive(PixmapPtr pDst,
+i830_emit_composite_primitive(PixmapPtr dest,
int srcX, int srcY,
int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
Bool is_affine_src, is_affine_mask = TRUE;
int per_vertex, num_floats;
@@ -801,10 +801,10 @@ i830_emit_composite_primitive(PixmapPtr pDst,
* Do a single rectangle composite operation.
*/
void
-i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
+i830_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
intel_batch_start_atomic(scrn, 58 + /* invarient */
@@ -815,7 +815,7 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
if (intel->needs_render_state_emit)
i830_emit_composite_state(scrn);
- i830_emit_composite_primitive(pDst, srcX, srcY, maskX, maskY, dstX,
+ i830_emit_composite_primitive(dest, srcX, srcY, maskX, maskY, dstX,
dstY, w, h);
intel_batch_end_atomic(scrn);
diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index f94b2c90..a453c330 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -236,34 +236,34 @@ static void i830_uxa_done_solid(PixmapPtr pPixmap)
* - support planemask using FULL_BLT_CMD?
*/
static Bool
-i830_uxa_prepare_copy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
+i830_uxa_prepare_copy(PixmapPtr source, PixmapPtr dest, int xdir,
int ydir, int alu, Pixel planemask)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
- i830_get_pixmap_bo(pSrcPixmap),
- i830_get_pixmap_bo(pDstPixmap),
+ i830_get_pixmap_bo(source),
+ i830_get_pixmap_bo(dest),
};
- if (!UXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask))
+ if (!UXA_PM_IS_SOLID(&source->drawable, planemask))
I830FALLBACK("planemask is not solid");
- if (pDstPixmap->drawable.bitsPerPixel < 8)
+ if (dest->drawable.bitsPerPixel < 8)
I830FALLBACK("under 8bpp pixmaps unsupported\n");
if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table)))
return FALSE;
- i830_exa_check_pitch_2d(pSrcPixmap);
- i830_exa_check_pitch_2d(pDstPixmap);
+ i830_exa_check_pitch_2d(source);
+ i830_exa_check_pitch_2d(dest);
- intel->pSrcPixmap = pSrcPixmap;
+ intel->render_source = source;
intel->BR[13] = I830CopyROP[alu] << 16;
- switch (pSrcPixmap->drawable.bitsPerPixel) {
+ switch (source->drawable.bitsPerPixel) {
case 8:
break;
case 16:
@@ -277,10 +277,10 @@ i830_uxa_prepare_copy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
}
static void
-i830_uxa_copy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1,
+i830_uxa_copy(PixmapPtr dest, int src_x1, int src_y1, int dst_x1,
int dst_y1, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
uint32_t cmd;
int dst_x2, dst_y2;
@@ -289,27 +289,27 @@ i830_uxa_copy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1,
dst_x2 = dst_x1 + w;
dst_y2 = dst_y1 + h;
- dst_pitch = i830_pixmap_pitch(pDstPixmap);
- src_pitch = i830_pixmap_pitch(intel->pSrcPixmap);
+ dst_pitch = i830_pixmap_pitch(dest);
+ src_pitch = i830_pixmap_pitch(intel->render_source);
{
BEGIN_BATCH(8);
cmd = XY_SRC_COPY_BLT_CMD;
- if (pDstPixmap->drawable.bitsPerPixel == 32)
+ if (dest->drawable.bitsPerPixel == 32)
cmd |=
XY_SRC_COPY_BLT_WRITE_ALPHA |
XY_SRC_COPY_BLT_WRITE_RGB;
if (IS_I965G(intel)) {
- if (i830_pixmap_tiled(pDstPixmap)) {
+ if (i830_pixmap_tiled(dest)) {
assert((dst_pitch % 512) == 0);
dst_pitch >>= 2;
cmd |= XY_SRC_COPY_BLT_DST_TILED;
}
- if (i830_pixmap_tiled(intel->pSrcPixmap)) {
+ if (i830_pixmap_tiled(intel->render_source)) {
assert((src_pitch % 512) == 0);
src_pitch >>= 2;
cmd |= XY_SRC_COPY_BLT_SRC_TILED;
@@ -321,20 +321,20 @@ i830_uxa_copy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1,
OUT_BATCH(intel->BR[13] | dst_pitch);
OUT_BATCH((dst_y1 << 16) | (dst_x1 & 0xffff));
OUT_BATCH((dst_y2 << 16) | (dst_x2 & 0xffff));
- OUT_RELOC_PIXMAP(pDstPixmap, I915_GEM_DOMAIN_RENDER,
+ OUT_RELOC_PIXMAP(dest, I915_GEM_DOMAIN_RENDER,
I915_GEM_DOMAIN_RENDER, 0);
OUT_BATCH((src_y1 << 16) | (src_x1 & 0xffff));
OUT_BATCH(src_pitch);
- OUT_RELOC_PIXMAP(intel->pSrcPixmap, I915_GEM_DOMAIN_RENDER, 0,
+ OUT_RELOC_PIXMAP(intel->render_source, I915_GEM_DOMAIN_RENDER, 0,
0);
ADVANCE_BATCH();
}
}
-static void i830_uxa_done_copy(PixmapPtr pDstPixmap)
+static void i830_uxa_done_copy(PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
i830_debug_sync(scrn);
}
@@ -344,9 +344,9 @@ static void i830_uxa_done_copy(PixmapPtr pDstPixmap)
*
* This is shared between i830 through i965.
*/
-void i830_done_composite(PixmapPtr pDst)
+void i830_done_composite(PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
i830_debug_sync(scrn);
}
diff --git a/src/i915_render.c b/src/i915_render.c
index 3382b64d..7aad1621 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -89,7 +89,7 @@ static struct formatinfo i915_tex_formats[] = {
{PICT_a8, MAPSURF_8BIT | MT_8BIT_A8},
};
-static uint32_t i915_get_blend_cntl(int op, PicturePtr pMask,
+static uint32_t i915_get_blend_cntl(int op, PicturePtr mask,
uint32_t dst_format)
{
uint32_t sblend, dblend;
@@ -122,7 +122,7 @@ static uint32_t i915_get_blend_cntl(int op, PicturePtr pMask,
* where the source blend factor is 0, and the source blend value is the
* mask channels multiplied by the source picture's alpha.
*/
- if (pMask && pMask->componentAlpha && PICT_FORMAT_RGB(pMask->format) &&
+ if (mask && mask->componentAlpha && PICT_FORMAT_RGB(mask->format) &&
i915_blend_op[op].src_alpha) {
if (dblend == BLENDFACT_SRC_ALPHA) {
dblend = BLENDFACT_SRC_COLR;
@@ -135,9 +135,9 @@ static uint32_t i915_get_blend_cntl(int op, PicturePtr pMask,
(dblend << S6_CBUF_DST_BLEND_FACT_SHIFT);
}
-static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format)
+static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
{
- switch (pDstPicture->format) {
+ switch (dest_picture->format) {
case PICT_a8r8g8b8:
case PICT_x8r8g8b8:
*dst_format = COLR_BUF_ARGB8888;
@@ -161,59 +161,59 @@ static Bool i915_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format)
ScrnInfoPtr scrn;
scrn =
- xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ xf86Screens[dest_picture->pDrawable->pScreen->myNum];
I830FALLBACK("Unsupported dest format 0x%x\n",
- (int)pDstPicture->format);
+ (int)dest_picture->format);
}
}
return TRUE;
}
-static Bool i915_check_composite_texture(ScrnInfoPtr scrn, PicturePtr pPict,
+static Bool i915_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
int unit)
{
- if (pPict->repeatType > RepeatReflect)
+ if (picture->repeatType > RepeatReflect)
I830FALLBACK("Unsupported picture repeat %d\n",
- pPict->repeatType);
+ picture->repeatType);
- if (pPict->filter != PictFilterNearest &&
- pPict->filter != PictFilterBilinear)
- I830FALLBACK("Unsupported filter 0x%x\n", pPict->filter);
+ if (picture->filter != PictFilterNearest &&
+ picture->filter != PictFilterBilinear)
+ I830FALLBACK("Unsupported filter 0x%x\n", picture->filter);
- if (pPict->pDrawable) {
+ if (picture->pDrawable) {
int w, h, i;
- w = pPict->pDrawable->width;
- h = pPict->pDrawable->height;
+ w = picture->pDrawable->width;
+ h = picture->pDrawable->height;
if ((w > 2048) || (h > 2048))
I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
for (i = 0;
i < sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]);
i++) {
- if (i915_tex_formats[i].fmt == pPict->format)
+ if (i915_tex_formats[i].fmt == picture->format)
break;
}
if (i == sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]))
I830FALLBACK("Unsupported picture format 0x%x\n",
- (int)pPict->format);
+ (int)picture->format);
}
return TRUE;
}
Bool
-i915_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
- PicturePtr pDstPicture)
+i915_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
+ PicturePtr dest_picture)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
uint32_t tmp1;
/* Check for unsupported compositing operations. */
if (op >= sizeof(i915_blend_op) / sizeof(i915_blend_op[0]))
I830FALLBACK("Unsupported Composite op 0x%x\n", op);
- if (pMaskPicture != NULL && pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format)) {
+ if (mask_picture != NULL && mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format)) {
/* Check if it's component alpha that relies on a source alpha
* and on the source value. We can only get one of those
* into the single source value that we get to blend with.
@@ -225,42 +225,42 @@ i915_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
"blending.\n");
}
- if (!i915_check_composite_texture(scrn, pSrcPicture, 0))
+ if (!i915_check_composite_texture(scrn, source_picture, 0))
I830FALLBACK("Check Src picture texture\n");
- if (pMaskPicture != NULL
- && !i915_check_composite_texture(scrn, pMaskPicture, 1))
+ if (mask_picture != NULL
+ && !i915_check_composite_texture(scrn, mask_picture, 1))
I830FALLBACK("Check Mask picture texture\n");
- if (!i915_get_dest_format(pDstPicture, &tmp1))
+ if (!i915_get_dest_format(dest_picture, &tmp1))
I830FALLBACK("Get Color buffer format\n");
return TRUE;
}
-static Bool i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
+static Bool i915_texture_setup(PicturePtr picture, PixmapPtr pPix, int unit)
{
- ScrnInfoPtr scrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[picture->pDrawable->pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
uint32_t format, pitch, filter;
int w, h, i;
uint32_t wrap_mode;
pitch = intel_get_pixmap_pitch(pPix);
- w = pPict->pDrawable->width;
- h = pPict->pDrawable->height;
+ w = picture->pDrawable->width;
+ h = picture->pDrawable->height;
intel->scale_units[unit][0] = pPix->drawable.width;
intel->scale_units[unit][1] = pPix->drawable.height;
for (i = 0; i < sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]);
i++) {
- if (i915_tex_formats[i].fmt == pPict->format)
+ if (i915_tex_formats[i].fmt == picture->format)
break;
}
if (i == sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]))
I830FALLBACK("unknown texture format\n");
format = i915_tex_formats[i].card_fmt;
- switch (pPict->repeatType) {
+ switch (picture->repeatType) {
case RepeatNone:
wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
break;
@@ -274,10 +274,10 @@ static Bool i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
wrap_mode = TEXCOORDMODE_MIRROR;
break;
default:
- FatalError("Unknown repeat type %d\n", pPict->repeatType);
+ FatalError("Unknown repeat type %d\n", picture->repeatType);
}
- switch (pPict->filter) {
+ switch (picture->filter) {
case PictFilterNearest:
filter = (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT) |
(FILTER_NEAREST << SS2_MIN_FILTER_SHIFT);
@@ -288,7 +288,7 @@ static Bool i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
break;
default:
filter = 0;
- I830FALLBACK("Bad filter 0x%x\n", pPict->filter);
+ I830FALLBACK("Bad filter 0x%x\n", picture->filter);
}
/* offset filled in at emit time */
@@ -310,57 +310,57 @@ static Bool i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
intel->samplerstate[unit * 3 + 1] |= unit << SS3_TEXTUREMAP_INDEX_SHIFT;
intel->samplerstate[unit * 3 + 2] = 0x00000000; /* border color */
- intel->transform[unit] = pPict->transform;
+ intel->transform[unit] = picture->transform;
return TRUE;
}
Bool
-i915_prepare_composite(int op, PicturePtr pSrcPicture,
- PicturePtr pMaskPicture, PicturePtr pDstPicture,
- PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
+i915_prepare_composite(int op, PicturePtr source_picture,
+ PicturePtr mask_picture, PicturePtr dest_picture,
+ PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[pSrcPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[source_picture->pDrawable->pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
- i830_get_pixmap_bo(pSrc),
- pMask ? i830_get_pixmap_bo(pMask) : NULL,
- i830_get_pixmap_bo(pDst),
+ i830_get_pixmap_bo(source),
+ mask ? i830_get_pixmap_bo(mask) : NULL,
+ i830_get_pixmap_bo(dest),
};
- intel->render_source_picture = pSrcPicture;
- intel->render_source = pSrc;
- intel->render_mask_picture = pMaskPicture;
- intel->render_mask = pMask;
- intel->render_dest_picture = pDstPicture;
- intel->render_dest = pDst;
+ intel->render_source_picture = source_picture;
+ intel->render_source = source;
+ intel->render_mask_picture = mask_picture;
+ intel->render_mask = mask;
+ intel->render_dest_picture = dest_picture;
+ intel->render_dest = dest;
- i830_exa_check_pitch_3d(pSrc);
- if (pMask)
- i830_exa_check_pitch_3d(pMask);
- i830_exa_check_pitch_3d(pDst);
+ i830_exa_check_pitch_3d(source);
+ if (mask)
+ i830_exa_check_pitch_3d(mask);
+ i830_exa_check_pitch_3d(dest);
- if (!i915_get_dest_format(pDstPicture,
+ if (!i915_get_dest_format(dest_picture,
&intel->i915_render_state.dst_format))
return FALSE;
if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table)))
return FALSE;
- if (!i915_texture_setup(pSrcPicture, pSrc, 0))
+ if (!i915_texture_setup(source_picture, source, 0))
I830FALLBACK("fail to setup src texture\n");
intel->dst_coord_adjust = 0;
intel->src_coord_adjust = 0;
intel->mask_coord_adjust = 0;
- if (pSrcPicture->filter == PictFilterNearest)
+ if (source_picture->filter == PictFilterNearest)
intel->dst_coord_adjust = -0.125;
- if (pMask != NULL) {
- if (!i915_texture_setup(pMaskPicture, pMask, 1))
+ if (mask != NULL) {
+ if (!i915_texture_setup(mask_picture, mask, 1))
I830FALLBACK("fail to setup mask texture\n");
- if (pMaskPicture->filter == PictFilterNearest)
+ if (mask_picture->filter == PictFilterNearest)
intel->dst_coord_adjust = -0.125;
} else {
intel->transform[1] = NULL;
@@ -378,12 +378,12 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
int op = intel->i915_render_state.op;
- PicturePtr pSrcPicture = intel->render_source_picture;
- PicturePtr pMaskPicture = intel->render_mask_picture;
- PicturePtr pDstPicture = intel->render_dest_picture;
- PixmapPtr pSrc = intel->render_source;
- PixmapPtr pMask = intel->render_mask;
- PixmapPtr pDst = intel->render_dest;
+ PicturePtr source_picture = intel->render_source_picture;
+ PicturePtr mask_picture = intel->render_mask_picture;
+ PicturePtr dest_picture = intel->render_dest_picture;
+ PixmapPtr source = intel->render_source;
+ PixmapPtr mask = intel->render_mask;
+ PixmapPtr dest = intel->render_dest;
uint32_t dst_format = intel->i915_render_state.dst_format, dst_pitch;
uint32_t blendctl;
int out_reg = FS_OC;
@@ -395,16 +395,16 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
IntelEmitInvarientState(scrn);
intel->last_3d = LAST_3D_RENDER;
- dst_pitch = intel_get_pixmap_pitch(pDst);
+ dst_pitch = intel_get_pixmap_pitch(dest);
is_affine_src = i830_transform_is_affine(intel->transform[0]);
is_affine_mask = i830_transform_is_affine(intel->transform[1]);
- if (pMask == NULL) {
+ if (mask == NULL) {
BEGIN_BATCH(10);
OUT_BATCH(_3DSTATE_MAP_STATE | 3);
OUT_BATCH(0x00000001); /* map 0 */
- OUT_RELOC_PIXMAP(pSrc, I915_GEM_DOMAIN_SAMPLER, 0, 0);
+ OUT_RELOC_PIXMAP(source, I915_GEM_DOMAIN_SAMPLER, 0, 0);
OUT_BATCH(intel->mapstate[1]);
OUT_BATCH(intel->mapstate[2]);
@@ -418,10 +418,10 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
BEGIN_BATCH(16);
OUT_BATCH(_3DSTATE_MAP_STATE | 6);
OUT_BATCH(0x00000003); /* map 0,1 */
- OUT_RELOC_PIXMAP(pSrc, I915_GEM_DOMAIN_SAMPLER, 0, 0);
+ OUT_RELOC_PIXMAP(source, I915_GEM_DOMAIN_SAMPLER, 0, 0);
OUT_BATCH(intel->mapstate[1]);
OUT_BATCH(intel->mapstate[2]);
- OUT_RELOC_PIXMAP(pMask, I915_GEM_DOMAIN_SAMPLER, 0, 0);
+ OUT_RELOC_PIXMAP(mask, I915_GEM_DOMAIN_SAMPLER, 0, 0);
OUT_BATCH(intel->mapstate[4]);
OUT_BATCH(intel->mapstate[5]);
@@ -442,7 +442,7 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
OUT_BATCH(BUF_3D_ID_COLOR_BACK | BUF_3D_USE_FENCE |
BUF_3D_PITCH(dst_pitch));
- OUT_RELOC_PIXMAP(pDst, I915_GEM_DOMAIN_RENDER,
+ OUT_RELOC_PIXMAP(dest, I915_GEM_DOMAIN_RENDER,
I915_GEM_DOMAIN_RENDER, 0);
OUT_BATCH(_3DSTATE_DST_BUF_VARS_CMD);
@@ -453,7 +453,7 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
ss2 = S2_TEXCOORD_FMT(0,
is_affine_src ? TEXCOORDFMT_2D :
TEXCOORDFMT_4D);
- if (pMask)
+ if (mask)
ss2 |= S2_TEXCOORD_FMT(1,
is_affine_mask ? TEXCOORDFMT_2D :
TEXCOORDFMT_4D);
@@ -469,7 +469,7 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
OUT_BATCH((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE |
S4_CULLMODE_NONE | S4_VFMT_XY);
blendctl =
- i915_get_blend_cntl(op, pMaskPicture, pDstPicture->format);
+ i915_get_blend_cntl(op, mask_picture, dest_picture->format);
OUT_BATCH(0x00000000); /* Disable stencil buffer */
OUT_BATCH(S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE |
(BLENDFUNC_ADD << S6_CBUF_BLEND_FUNC_SHIFT) |
@@ -479,8 +479,8 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
OUT_BATCH(_3DSTATE_DRAW_RECT_CMD);
OUT_BATCH(0x00000000);
OUT_BATCH(0x00000000); /* ymin, xmin */
- OUT_BATCH(DRAW_YMAX(pDst->drawable.height - 1) |
- DRAW_XMAX(pDst->drawable.width - 1));
+ OUT_BATCH(DRAW_YMAX(dest->drawable.height - 1) |
+ DRAW_XMAX(dest->drawable.width - 1));
/* yorig, xorig (relate to color buffer?) */
OUT_BATCH(0x00000000);
OUT_BATCH(MI_NOOP);
@@ -496,13 +496,13 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
* S then T ordering is necessary.
*/
i915_fs_dcl(FS_S0);
- if (pMask)
+ if (mask)
i915_fs_dcl(FS_S1);
i915_fs_dcl(FS_T0);
- if (pMask)
+ if (mask)
i915_fs_dcl(FS_T1);
- /* Load the pSrcPicture texel */
+ /* Load the source_picture texel */
if (is_affine_src) {
i915_fs_texld(FS_R0, FS_S0, FS_T0);
} else {
@@ -510,14 +510,14 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
}
/* If the texture lacks an alpha channel, force the alpha to 1. */
- if (PICT_FORMAT_A(pSrcPicture->format) == 0)
+ if (PICT_FORMAT_A(source_picture->format) == 0)
i915_fs_mov_masked(FS_R0, MASK_W, i915_fs_operand_one());
- if (!pMask) {
+ if (!mask) {
/* No mask, so move to output color */
i915_fs_mov(out_reg, i915_fs_operand_reg(FS_R0));
} else {
- /* Load the pMaskPicture texel */
+ /* Load the mask_picture texel */
if (is_affine_mask) {
i915_fs_texld(FS_R1, FS_S1, FS_T1);
} else {
@@ -525,7 +525,7 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
}
/* If the texture lacks an alpha channel, force the alpha to 1.
*/
- if (PICT_FORMAT_A(pMaskPicture->format) == 0)
+ if (PICT_FORMAT_A(mask_picture->format) == 0)
i915_fs_mov_masked(FS_R1, MASK_W,
i915_fs_operand_one());
@@ -539,8 +539,8 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
* source alpha is unused. Otherwise, we provide the non-CA
* source value (src.X * mask.A).
*/
- if (pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format)) {
+ if (mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format)) {
if (i915_blend_op[op].src_alpha) {
i915_fs_mul(out_reg,
i915_fs_operand(FS_R0, W, W, W, W),
@@ -565,12 +565,12 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn)
* This function is no longer shared between i830 and i915 generation code.
*/
static void
-i915_emit_composite_primitive(PixmapPtr pDst,
+i915_emit_composite_primitive(PixmapPtr dest,
int srcX, int srcY,
int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
Bool is_affine_src, is_affine_mask = TRUE;
int per_vertex, num_floats;
@@ -752,10 +752,10 @@ i915_emit_composite_primitive(PixmapPtr pDst,
}
void
-i915_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
+i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
intel_batch_start_atomic(scrn, 150);
@@ -763,7 +763,7 @@ i915_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
if (intel->needs_render_state_emit)
i915_emit_composite_setup(scrn);
- i915_emit_composite_primitive(pDst, srcX, srcY, maskX, maskY, dstX,
+ i915_emit_composite_primitive(dest, srcX, srcY, maskX, maskY, dstX,
dstY, w, h);
intel_batch_end_atomic(scrn);
diff --git a/src/i965_render.c b/src/i965_render.c
index b253dc94..9ad9d2b0 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -117,7 +117,7 @@ static struct formatinfo i965_tex_formats[] = {
{PICT_a8, BRW_SURFACEFORMAT_A8_UNORM},
};
-static void i965_get_blend_cntl(int op, PicturePtr pMask, uint32_t dst_format,
+static void i965_get_blend_cntl(int op, PicturePtr mask, uint32_t dst_format,
uint32_t * sblend, uint32_t * dblend)
{
@@ -138,7 +138,7 @@ static void i965_get_blend_cntl(int op, PicturePtr pMask, uint32_t dst_format,
* the source blend factor is 0, and the source blend value is the mask
* channels multiplied by the source picture's alpha.
*/
- if (pMask && pMask->componentAlpha && PICT_FORMAT_RGB(pMask->format)
+ if (mask && mask->componentAlpha && PICT_FORMAT_RGB(mask->format)
&& i965_blend_op[op].src_alpha) {
if (*dblend == BRW_BLENDFACTOR_SRC_ALPHA) {
*dblend = BRW_BLENDFACTOR_SRC_COLOR;
@@ -149,11 +149,11 @@ static void i965_get_blend_cntl(int op, PicturePtr pMask, uint32_t dst_format,
}
-static Bool i965_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format)
+static Bool i965_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
- switch (pDstPicture->format) {
+ switch (dest_picture->format) {
case PICT_a8r8g8b8:
case PICT_x8r8g8b8:
*dst_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
@@ -176,59 +176,59 @@ static Bool i965_get_dest_format(PicturePtr pDstPicture, uint32_t * dst_format)
break;
default:
I830FALLBACK("Unsupported dest format 0x%x\n",
- (int)pDstPicture->format);
+ (int)dest_picture->format);
}
return TRUE;
}
-static Bool i965_check_composite_texture(ScrnInfoPtr scrn, PicturePtr pPict,
+static Bool i965_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
int unit)
{
- if (pPict->repeatType > RepeatReflect)
+ if (picture->repeatType > RepeatReflect)
I830FALLBACK("extended repeat (%d) not supported\n",
- pPict->repeatType);
+ picture->repeatType);
- if (pPict->filter != PictFilterNearest &&
- pPict->filter != PictFilterBilinear) {
- I830FALLBACK("Unsupported filter 0x%x\n", pPict->filter);
+ if (picture->filter != PictFilterNearest &&
+ picture->filter != PictFilterBilinear) {
+ I830FALLBACK("Unsupported filter 0x%x\n", picture->filter);
}
- if (pPict->pDrawable) {
+ if (picture->pDrawable) {
int w, h, i;
- w = pPict->pDrawable->width;
- h = pPict->pDrawable->height;
+ w = picture->pDrawable->width;
+ h = picture->pDrawable->height;
if ((w > 8192) || (h > 8192))
I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
for (i = 0;
i < sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]);
i++) {
- if (i965_tex_formats[i].fmt == pPict->format)
+ if (i965_tex_formats[i].fmt == picture->format)
break;
}
if (i == sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]))
I830FALLBACK("Unsupported picture format 0x%x\n",
- (int)pPict->format);
+ (int)picture->format);
}
return TRUE;
}
Bool
-i965_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
- PicturePtr pDstPicture)
+i965_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
+ PicturePtr dest_picture)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
uint32_t tmp1;
/* Check for unsupported compositing operations. */
if (op >= sizeof(i965_blend_op) / sizeof(i965_blend_op[0]))
I830FALLBACK("Unsupported Composite op 0x%x\n", op);
- if (pMaskPicture && pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format)) {
+ if (mask_picture && mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format)) {
/* Check if it's component alpha that relies on a source alpha and on
* the source value. We can only get one of those into the single
* source value that we get to blend with.
@@ -241,13 +241,13 @@ i965_check_composite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
}
}
- if (!i965_check_composite_texture(scrn, pSrcPicture, 0))
+ if (!i965_check_composite_texture(scrn, source_picture, 0))
I830FALLBACK("Check Src picture texture\n");
- if (pMaskPicture != NULL
- && !i965_check_composite_texture(scrn, pMaskPicture, 1))
+ if (mask_picture != NULL
+ && !i965_check_composite_texture(scrn, mask_picture, 1))
I830FALLBACK("Check Mask picture texture\n");
- if (!i965_get_dest_format(pDstPicture, &tmp1))
+ if (!i965_get_dest_format(dest_picture, &tmp1))
I830FALLBACK("Get Color buffer format\n");
return TRUE;
@@ -973,13 +973,13 @@ static drm_intel_bo *gen4_create_cc_unit_state(ScrnInfoPtr scrn)
return cc_state_bo;
}
-static uint32_t i965_get_card_format(PicturePtr pPict)
+static uint32_t i965_get_card_format(PicturePtr picture)
{
int i;
for (i = 0; i < sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]);
i++) {
- if (i965_tex_formats[i].fmt == pPict->format)
+ if (i965_tex_formats[i].fmt == picture->format)
break;
}
assert(i != sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]));
@@ -1021,7 +1021,7 @@ static sampler_state_extend_t sampler_state_extend_from_picture(int repeat_type)
*/
static void
i965_set_picture_surface_state(dri_bo * ss_bo, int ss_index,
- PicturePtr pPicture, PixmapPtr pPixmap,
+ PicturePtr picture, PixmapPtr pPixmap,
Bool is_dst)
{
struct brw_surface_state_padded *ss;
@@ -1039,11 +1039,11 @@ i965_set_picture_surface_state(dri_bo * ss_bo, int ss_index,
uint32_t dst_format = 0;
Bool ret = TRUE;
- ret = i965_get_dest_format(pPicture, &dst_format);
+ ret = i965_get_dest_format(picture, &dst_format);
assert(ret == TRUE);
local_ss.ss0.surface_format = dst_format;
} else {
- local_ss.ss0.surface_format = i965_get_card_format(pPicture);
+ local_ss.ss0.surface_format = i965_get_card_format(picture);
}
local_ss.ss0.data_return_format = BRW_SURFACERETURNFORMAT_FLOAT32;
@@ -1092,10 +1092,10 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
struct gen4_render_state *render_state = intel->gen4_render_state;
gen4_composite_op *composite_op = &render_state->composite_op;
int op = composite_op->op;
- PicturePtr pMaskPicture = intel->render_mask_picture;
- PicturePtr pDstPicture = intel->render_dest_picture;
- PixmapPtr pMask = intel->render_mask;
- PixmapPtr pDst = intel->render_dest;
+ PicturePtr mask_picture = intel->render_mask_picture;
+ PicturePtr dest_picture = intel->render_dest_picture;
+ PixmapPtr mask = intel->render_mask;
+ PixmapPtr dest = intel->render_dest;
sampler_state_filter_t src_filter = composite_op->src_filter;
sampler_state_filter_t mask_filter = composite_op->mask_filter;
sampler_state_extend_t src_extend = composite_op->src_extend;
@@ -1125,7 +1125,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
urb_cs_start = urb_sf_start + urb_sf_size;
urb_cs_size = URB_CS_ENTRIES * URB_CS_ENTRY_SIZE;
- i965_get_blend_cntl(op, pMaskPicture, pDstPicture->format,
+ i965_get_blend_cntl(op, mask_picture, dest_picture->format,
&src_blend, &dst_blend);
/* Begin the long sequence of commands needed to set up the 3D
@@ -1218,7 +1218,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
*/
OUT_BATCH(BRW_3DSTATE_DRAWING_RECTANGLE | 2);
OUT_BATCH(0x00000000); /* ymin, xmin */
- OUT_BATCH(DRAW_YMAX(pDst->drawable.height - 1) | DRAW_XMAX(pDst->drawable.width - 1)); /* ymax, xmax */
+ OUT_BATCH(DRAW_YMAX(dest->drawable.height - 1) | DRAW_XMAX(dest->drawable.width - 1)); /* ymax, xmax */
OUT_BATCH(0x00000000); /* yorigin, xorigin */
/* skip the depth buffer */
@@ -1232,7 +1232,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
OUT_BATCH(BRW_GS_DISABLE); /* disable GS, resulting in passthrough */
OUT_BATCH(BRW_CLIP_DISABLE); /* disable CLIP, resulting in passthrough */
- if (pMask) {
+ if (mask) {
OUT_RELOC(render_state->sf_mask_state_bo,
I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
} else {
@@ -1281,7 +1281,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
/*
* number of extra parameters per vertex
*/
- int nelem = pMask ? 2 : 1;
+ int nelem = mask ? 2 : 1;
/*
* size of extra parameters:
* 3 for homogenous (xyzw)
@@ -1302,7 +1302,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
}
if (IS_IGDNG(intel)) {
- BEGIN_BATCH(pMask ? 9 : 7);
+ BEGIN_BATCH(mask ? 9 : 7);
/*
* The reason to add this extra vertex element in the header is that
* IGDNG has different vertex header definition and origin method to
@@ -1332,7 +1332,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
(BRW_VFCOMPONENT_STORE_0 <<
VE1_VFCOMPONENT_3_SHIFT));
} else {
- BEGIN_BATCH(pMask ? 7 : 5);
+ BEGIN_BATCH(mask ? 7 : 5);
/* Set up our vertex elements, sourced from the single vertex buffer.
* that will be set up later.
*/
@@ -1379,7 +1379,7 @@ static void i965_emit_composite_state(ScrnInfoPtr scrn)
else
OUT_BATCH((BRW_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_0_SHIFT) | (BRW_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT) | (w_component << VE1_VFCOMPONENT_2_SHIFT) | (BRW_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_3_SHIFT) | ((4 + 4) << VE1_DESTINATION_ELEMENT_OFFSET_SHIFT)); /* VUE offset in dwords */
/* u1, v1, w1 */
- if (pMask) {
+ if (mask) {
OUT_BATCH((0 << VE0_VERTEX_BUFFER_INDEX_SHIFT) | VE0_VALID | (src_format << VE0_FORMAT_SHIFT) | (((2 + selem) * 4) << VE0_OFFSET_SHIFT)); /* vb offset in bytes */
if (IS_IGDNG(intel))
@@ -1429,11 +1429,11 @@ static Bool i965_composite_check_aperture(ScrnInfoPtr scrn)
}
Bool
-i965_prepare_composite(int op, PicturePtr pSrcPicture,
- PicturePtr pMaskPicture, PicturePtr pDstPicture,
- PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst)
+i965_prepare_composite(int op, PicturePtr source_picture,
+ PicturePtr mask_picture, PicturePtr dest_picture,
+ PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
- ScrnInfoPtr scrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
struct gen4_render_state *render_state = intel->gen4_render_state;
gen4_composite_op *composite_op = &render_state->composite_op;
@@ -1441,23 +1441,23 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
drm_intel_bo *binding_table_bo, *surface_state_bo;
if (composite_op->src_filter < 0)
- I830FALLBACK("Bad src filter 0x%x\n", pSrcPicture->filter);
+ I830FALLBACK("Bad src filter 0x%x\n", source_picture->filter);
composite_op->src_extend =
- sampler_state_extend_from_picture(pSrcPicture->repeatType);
+ sampler_state_extend_from_picture(source_picture->repeatType);
if (composite_op->src_extend < 0)
- I830FALLBACK("Bad src repeat 0x%x\n", pSrcPicture->repeatType);
+ I830FALLBACK("Bad src repeat 0x%x\n", source_picture->repeatType);
- if (pMaskPicture) {
+ if (mask_picture) {
composite_op->mask_filter =
- sampler_state_filter_from_picture(pMaskPicture->filter);
+ sampler_state_filter_from_picture(mask_picture->filter);
if (composite_op->mask_filter < 0)
I830FALLBACK("Bad mask filter 0x%x\n",
- pMaskPicture->filter);
+ mask_picture->filter);
composite_op->mask_extend =
- sampler_state_extend_from_picture(pMaskPicture->repeatType);
+ sampler_state_extend_from_picture(mask_picture->repeatType);
if (composite_op->mask_extend < 0)
I830FALLBACK("Bad mask repeat 0x%x\n",
- pMaskPicture->repeatType);
+ mask_picture->repeatType);
} else {
composite_op->mask_filter = SAMPLER_STATE_FILTER_NEAREST;
composite_op->mask_extend = SAMPLER_STATE_EXTEND_NONE;
@@ -1473,14 +1473,14 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
}
/* Set up the state buffer for the destination surface */
i965_set_picture_surface_state(surface_state_bo, 0,
- pDstPicture, pDst, TRUE);
+ dest_picture, dest, TRUE);
/* Set up the source surface state buffer */
i965_set_picture_surface_state(surface_state_bo, 1,
- pSrcPicture, pSrc, FALSE);
- if (pMask) {
+ source_picture, source, FALSE);
+ if (mask) {
/* Set up the mask surface state buffer */
i965_set_picture_surface_state(surface_state_bo, 2,
- pMaskPicture, pMask, FALSE);
+ mask_picture, mask, FALSE);
}
dri_bo_unmap(surface_state_bo);
@@ -1508,7 +1508,7 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
sizeof(brw_surface_state_padded),
I915_GEM_DOMAIN_INSTRUCTION, 0);
- if (pMask) {
+ if (mask) {
binding_table[2] = intel_emit_reloc(binding_table_bo,
2 * sizeof(uint32_t),
surface_state_bo,
@@ -1525,38 +1525,38 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
drm_intel_bo_unreference(surface_state_bo);
composite_op->op = op;
- intel->render_source_picture = pSrcPicture;
- intel->render_mask_picture = pMaskPicture;
- intel->render_dest_picture = pDstPicture;
- intel->render_source = pSrc;
- intel->render_mask = pMask;
- intel->render_dest = pDst;
+ intel->render_source_picture = source_picture;
+ intel->render_mask_picture = mask_picture;
+ intel->render_dest_picture = dest_picture;
+ intel->render_source = source;
+ intel->render_mask = mask;
+ intel->render_dest = dest;
drm_intel_bo_unreference(composite_op->binding_table_bo);
composite_op->binding_table_bo = binding_table_bo;
composite_op->src_filter =
- sampler_state_filter_from_picture(pSrcPicture->filter);
+ sampler_state_filter_from_picture(source_picture->filter);
- intel->scale_units[0][0] = pSrc->drawable.width;
- intel->scale_units[0][1] = pSrc->drawable.height;
+ intel->scale_units[0][0] = source->drawable.width;
+ intel->scale_units[0][1] = source->drawable.height;
- intel->transform[0] = pSrcPicture->transform;
+ intel->transform[0] = source_picture->transform;
composite_op->is_affine = i830_transform_is_affine(intel->transform[0]);
- if (!pMask) {
+ if (!mask) {
intel->transform[1] = NULL;
intel->scale_units[1][0] = -1;
intel->scale_units[1][1] = -1;
} else {
- intel->transform[1] = pMaskPicture->transform;
- intel->scale_units[1][0] = pMask->drawable.width;
- intel->scale_units[1][1] = pMask->drawable.height;
+ intel->transform[1] = mask_picture->transform;
+ intel->scale_units[1][0] = mask->drawable.width;
+ intel->scale_units[1][1] = mask->drawable.height;
composite_op->is_affine |=
i830_transform_is_affine(intel->transform[1]);
}
- if (pMask) {
- if (pMaskPicture->componentAlpha &&
- PICT_FORMAT_RGB(pMaskPicture->format)) {
+ if (mask) {
+ if (mask_picture->componentAlpha &&
+ PICT_FORMAT_RGB(mask_picture->format)) {
if (i965_blend_op[op].src_alpha) {
if (composite_op->is_affine)
composite_op->wm_kernel =
@@ -1626,10 +1626,10 @@ static drm_intel_bo *i965_get_vb_space(ScrnInfoPtr scrn)
}
void
-i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
+i965_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int w, int h)
{
- ScrnInfoPtr scrn = xf86Screens[pDst->drawable.pScreen->myNum];
+ ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
struct gen4_render_state *render_state = intel->gen4_render_state;
Bool has_mask;