sna/gen2+: Exclude solids from being classed as requiring an upload
We treat any pixmap that is not attached to either a CPU or GPU bo as requiring the pixel data to be uploaded to the GPU before we can composite. Normally this is true, except for the solid cache. References: https://bugs.freedesktop.org/show_bug.cgi?id=45672 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
f009386de8
commit
f30be6f743
|
|
@ -1523,6 +1523,9 @@ need_upload(PicturePtr p)
|
|||
static bool
|
||||
source_fallback(PicturePtr p)
|
||||
{
|
||||
if (is_solid(p))
|
||||
return false;
|
||||
|
||||
return (has_alphamap(p) ||
|
||||
is_unhandled_gradient(p) ||
|
||||
!gen2_check_filter(p) ||
|
||||
|
|
@ -1572,7 +1575,7 @@ gen2_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (src_pixmap && !is_solid(src) && !source_fallback(src)) {
|
||||
if (src_pixmap && !source_fallback(src)) {
|
||||
priv = sna_pixmap(src_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: src is already on the GPU, try to use GPU\n",
|
||||
|
|
@ -1580,7 +1583,7 @@ gen2_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) {
|
||||
if (mask_pixmap && !source_fallback(mask)) {
|
||||
priv = sna_pixmap(mask_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: mask is already on the GPU, try to use GPU\n",
|
||||
|
|
|
|||
|
|
@ -2435,6 +2435,9 @@ need_upload(PicturePtr p)
|
|||
static bool
|
||||
source_fallback(PicturePtr p)
|
||||
{
|
||||
if (is_solid(p))
|
||||
return false;
|
||||
|
||||
return (has_alphamap(p) ||
|
||||
!gen3_check_xformat(p) ||
|
||||
!gen3_check_filter(p) ||
|
||||
|
|
@ -2494,7 +2497,7 @@ gen3_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (src_pixmap && !is_solid(src) && !source_fallback(src)) {
|
||||
if (src_pixmap && !source_fallback(src)) {
|
||||
priv = sna_pixmap(src_pixmap);
|
||||
if (priv &&
|
||||
((priv->gpu_damage && !priv->cpu_damage) ||
|
||||
|
|
@ -2504,7 +2507,7 @@ gen3_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) {
|
||||
if (mask_pixmap && !source_fallback(mask)) {
|
||||
priv = sna_pixmap(mask_pixmap);
|
||||
if (priv &&
|
||||
((priv->gpu_damage && !priv->cpu_damage) ||
|
||||
|
|
|
|||
|
|
@ -2032,6 +2032,9 @@ need_upload(PicturePtr p)
|
|||
static bool
|
||||
source_fallback(PicturePtr p)
|
||||
{
|
||||
if (is_solid(p))
|
||||
return false;
|
||||
|
||||
return (has_alphamap(p) ||
|
||||
is_gradient(p) ||
|
||||
!gen4_check_filter(p) ||
|
||||
|
|
@ -2082,7 +2085,7 @@ gen4_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (src_pixmap && !is_solid(src) && !source_fallback(src)) {
|
||||
if (src_pixmap && !source_fallback(src)) {
|
||||
priv = sna_pixmap(src_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: src is already on the GPU, try to use GPU\n",
|
||||
|
|
@ -2090,7 +2093,7 @@ gen4_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) {
|
||||
if (mask_pixmap && !source_fallback(mask)) {
|
||||
priv = sna_pixmap(mask_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: mask is already on the GPU, try to use GPU\n",
|
||||
|
|
|
|||
|
|
@ -2060,6 +2060,9 @@ need_upload(PicturePtr p)
|
|||
static bool
|
||||
source_fallback(PicturePtr p)
|
||||
{
|
||||
if (is_solid(p))
|
||||
return false;
|
||||
|
||||
return (has_alphamap(p) ||
|
||||
is_gradient(p) ||
|
||||
!gen5_check_filter(p) ||
|
||||
|
|
@ -2110,7 +2113,7 @@ gen5_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (src_pixmap && !is_solid(src) && !source_fallback(src)) {
|
||||
if (src_pixmap && !source_fallback(src)) {
|
||||
priv = sna_pixmap(src_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: src is already on the GPU, try to use GPU\n",
|
||||
|
|
@ -2118,7 +2121,7 @@ gen5_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) {
|
||||
if (mask_pixmap && !source_fallback(mask)) {
|
||||
priv = sna_pixmap(mask_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: mask is already on the GPU, try to use GPU\n",
|
||||
|
|
|
|||
|
|
@ -2339,6 +2339,9 @@ need_upload(PicturePtr p)
|
|||
static bool
|
||||
source_fallback(PicturePtr p)
|
||||
{
|
||||
if (is_solid(p))
|
||||
return false;
|
||||
|
||||
return (has_alphamap(p) ||
|
||||
is_gradient(p) ||
|
||||
!gen6_check_filter(p) ||
|
||||
|
|
@ -2391,7 +2394,7 @@ gen6_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (src_pixmap && !is_solid(src) && !source_fallback(src)) {
|
||||
if (src_pixmap && !source_fallback(src)) {
|
||||
priv = sna_pixmap(src_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: src is already on the GPU, try to use GPU\n",
|
||||
|
|
@ -2399,7 +2402,7 @@ gen6_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) {
|
||||
if (mask_pixmap && !source_fallback(mask)) {
|
||||
priv = sna_pixmap(mask_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: mask is already on the GPU, try to use GPU\n",
|
||||
|
|
|
|||
|
|
@ -2345,6 +2345,9 @@ need_upload(PicturePtr p)
|
|||
static bool
|
||||
source_fallback(PicturePtr p)
|
||||
{
|
||||
if (is_solid(p))
|
||||
return false;
|
||||
|
||||
return (has_alphamap(p) ||
|
||||
is_gradient(p) ||
|
||||
!gen7_check_filter(p) ||
|
||||
|
|
@ -2397,7 +2400,7 @@ gen7_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (src_pixmap && !is_solid(src) && !source_fallback(src)) {
|
||||
if (src_pixmap && !source_fallback(src)) {
|
||||
priv = sna_pixmap(src_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: src is already on the GPU, try to use GPU\n",
|
||||
|
|
@ -2405,7 +2408,7 @@ gen7_composite_fallback(struct sna *sna,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (mask_pixmap && !is_solid(mask) && !source_fallback(mask)) {
|
||||
if (mask_pixmap && !source_fallback(mask)) {
|
||||
priv = sna_pixmap(mask_pixmap);
|
||||
if (priv && priv->gpu_damage && !priv->cpu_damage) {
|
||||
DBG(("%s: mask is already on the GPU, try to use GPU\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue