diff options
author | Russell King <rmk@armlinux.org.uk> | 2016-11-24 17:24:53 +0000 |
---|---|---|
committer | Russell King <rmk@armlinux.org.uk> | 2016-11-24 17:24:53 +0000 |
commit | 9b04efcb0084d969dc5b32a352631af8df4fc1c9 (patch) | |
tree | 302e4e58eea4e418d0fc7df1bb4825e59e7492a8 | |
parent | a16ac0daf328d3fd671367c4a4648b9c71b5bb90 (diff) |
etnaviv: etnaviv_workaround_nonalpha() to operate on formats
Rather than taking an etnaviv_pixmap pointer, take a pointer to the
format itself. This will allow us to use this workaround on formats
rather than modifying the state of a pixmap.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r-- | etnaviv/etnaviv_render.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/etnaviv/etnaviv_render.c b/etnaviv/etnaviv_render.c index 3b5420d..86d9d55 100644 --- a/etnaviv/etnaviv_render.c +++ b/etnaviv/etnaviv_render.c @@ -363,17 +363,17 @@ static Bool etnaviv_composite_to_pixmap(CARD8 op, PicturePtr pSrc, * global alpha to replace the alpha channel. The alpha channel subsitution * is performed at this function's callsite. */ -static Bool etnaviv_workaround_nonalpha(struct etnaviv_pixmap *vpix) +static Bool etnaviv_workaround_nonalpha(struct etnaviv_format *fmt) { - switch (vpix->pict_format.format) { + switch (fmt->format) { case DE_FORMAT_X4R4G4B4: - vpix->pict_format.format = DE_FORMAT_A4R4G4B4; + fmt->format = DE_FORMAT_A4R4G4B4; return TRUE; case DE_FORMAT_X1R5G5B5: - vpix->pict_format.format = DE_FORMAT_A1R5G5B5; + fmt->format = DE_FORMAT_A1R5G5B5; return TRUE; case DE_FORMAT_X8R8G8B8: - vpix->pict_format.format = DE_FORMAT_A8R8G8B8; + fmt->format = DE_FORMAT_A8R8G8B8; return TRUE; case DE_FORMAT_R5G6B5: return TRUE; @@ -460,7 +460,7 @@ copy_to_vtemp: copy_op = etnaviv_composite_op[PictOpSrc]; - if (etnaviv_workaround_nonalpha(vSrc)) { + if (etnaviv_workaround_nonalpha(&vSrc->pict_format)) { copy_op.alpha_mode |= VIVS_DE_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_GLOBAL; copy_op.src_alpha = 255; } @@ -575,7 +575,7 @@ static int etnaviv_accel_composite_srconly(PicturePtr pSrc, PicturePtr pDst, * we must always have an alpha format, otherwise the selected * alpha mode (by etnaviv_accel_reduce_mask()) will be ignored. */ - if (etnaviv_workaround_nonalpha(vSrc) && + if (etnaviv_workaround_nonalpha(&vSrc->pict_format) && etnaviv_blend_src_alpha_normal(&state->final_blend)) { state->final_blend.alpha_mode |= VIVS_DE_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_GLOBAL; state->final_blend.src_alpha = 255; @@ -884,7 +884,8 @@ static int etnaviv_accel_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, * is important here: we only need the full workaround for non- * PictOpClear operations, but we still need the format adjustment. */ - if (etnaviv_workaround_nonalpha(state.dst.pix) && op != PictOpClear) { + if (etnaviv_workaround_nonalpha(&state.dst.pix->pict_format) && + op != PictOpClear) { /* * Destination alpha channel subsitution - this needs * to happen before we modify the final blend for any |