sna: Avoid creating a CPU bo for uploads if we already have a large GPU bo
And vice-versa if already have a large CPU bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
a253c95ec6
commit
6fa059330d
|
|
@ -2990,6 +2990,19 @@ static bool upload_inplace(struct sna *sna,
|
|||
struct sna_pixmap *priv,
|
||||
RegionRec *region)
|
||||
{
|
||||
if (priv->create & KGEM_CAN_CREATE_LARGE) {
|
||||
if (priv->gpu_bo) {
|
||||
DBG(("%s: yes, large buffer and already have GPU bo\n",
|
||||
__FUNCTION__));
|
||||
return true;
|
||||
}
|
||||
if (priv->cpu_bo){
|
||||
DBG(("%s: no, large buffer and already have CPU bo\n",
|
||||
__FUNCTION__));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!region_inplace(sna, pixmap, region, priv, true)) {
|
||||
DBG(("%s? no, region not suitable\n", __FUNCTION__));
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue