summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vivante_accel.c15
-rw-r--r--src/vivante_accel.h1
-rw-r--r--src/vivante_utils.c26
-rw-r--r--src/vivante_utils.h1
4 files changed, 39 insertions, 4 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index 121acc1..e3ea856 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -1326,11 +1326,12 @@ static struct vivante_pixmap *vivante_acquire_src(struct vivante *vivante,
if (!vSrc)
return NULL;
+ vSrc->pict_format = vivante_pict_format(pict->format, FALSE);
if (pict->repeat == RepeatNone &&
- transform_is_integer_translation(pict->transform, &tx, &ty)) {
+ transform_is_integer_translation(pict->transform, &tx, &ty) &&
+ vivante_format_valid(vivante, vSrc->pict_format)) {
*xout = ox + x + tx + drawable->x;
*yout = ox + y + ty + drawable->y;
- vSrc->pict_format = vivante_pict_format(pict->format, FALSE);
} else {
PictFormatPtr f;
PicturePtr dest;
@@ -1427,7 +1428,7 @@ static int vivante_accel_final_blend(struct vivante *vivante,
* global alpha to replace the alpha channel. The alpha channel subsitution
* is performed at this function's callsite.
*/
-static Bool vivante_workaround_nonalpha(struct etnaviv_pixmap *vpix)
+static Bool vivante_workaround_nonalpha(struct vivante_pixmap *vpix)
{
switch (vpix->pict_format) {
case gcvSURF_X4R4G4B4:
@@ -1469,8 +1470,9 @@ static Bool vivante_workaround_nonalpha(struct etnaviv_pixmap *vpix)
case gcvSURF_R5G6B5:
case gcvSURF_B5G6R5:
return TRUE;
+ default:
+ return FALSE;
}
- return FALSE;
}
int vivante_accel_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
@@ -1505,6 +1507,8 @@ int vivante_accel_Composite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
return FALSE;
vDst->pict_format = vivante_pict_format(pDst->format, FALSE);
+ if (!vivante_format_valid(vivante, vDst->pict_format))
+ return FALSE;
final_op = vivante_composite_op[op];
@@ -1864,6 +1868,9 @@ Bool vivante_accel_init(struct vivante *vivante)
return FALSE;
}
+ vivante->pe20 = gcoHAL_IsFeatureAvailable(vivante->hal,
+ gcvFEATURE_2DPE20);
+
xf86DrvMsg(vivante->scrnIndex, X_PROBED,
"Vivante GC%x GPU revision %x\n", model, rev);
diff --git a/src/vivante_accel.h b/src/vivante_accel.h
index 51bbdbf..7ac48ae 100644
--- a/src/vivante_accel.h
+++ b/src/vivante_accel.h
@@ -61,6 +61,7 @@ struct vivante {
Bool need_stall;
#endif
+ Bool pe20;
Bool need_commit;
Bool force_fallback;
#ifdef RENDER
diff --git a/src/vivante_utils.c b/src/vivante_utils.c
index 8a61133..e2839d3 100644
--- a/src/vivante_utils.c
+++ b/src/vivante_utils.c
@@ -298,6 +298,32 @@ gceSURF_FORMAT vivante_pict_format(PictFormatShort format, Bool force)
}
#endif
+Bool vivante_format_valid(struct vivante *vivante, gceSURF_FORMAT fmt)
+{
+ switch (fmt) {
+ case gcvSURF_A8R8G8B8:
+ case gcvSURF_X8R8G8B8:
+ case gcvSURF_R5G6B5:
+ case gcvSURF_A1R5G5B5:
+ case gcvSURF_X1R5G5B5:
+ case gcvSURF_A4R4G4B4:
+ case gcvSURF_X4R4G4B4:
+ return TRUE;
+ case gcvSURF_A8B8G8R8:
+ case gcvSURF_X8B8G8R8:
+ case gcvSURF_B8G8R8A8:
+ case gcvSURF_B8G8R8X8:
+ case gcvSURF_B5G6R5:
+ case gcvSURF_A1B5G5R5:
+ case gcvSURF_X1B5G5R5:
+ case gcvSURF_A4B4G4R4:
+ case gcvSURF_X4B4G4R4:
+ case gcvSURF_A8:
+ return vivante->pe20;
+ default:
+ return FALSE;
+ }
+}
#if 1 //def DEBUG
#include <stdarg.h>
diff --git a/src/vivante_utils.h b/src/vivante_utils.h
index da8ef2c..3ccbf7b 100644
--- a/src/vivante_utils.h
+++ b/src/vivante_utils.h
@@ -48,6 +48,7 @@ void vivante_finish_drawable(DrawablePtr pDrawable, int access);
void vivante_prepare_drawable(DrawablePtr pDrawable, int access);
gceSURF_FORMAT vivante_pict_format(PictFormatShort format, Bool force);
+Bool vivante_format_valid(struct vivante *vivante, gceSURF_FORMAT fmt);
/*
* The following functions are here to allow the compiler to inline them