summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-15 14:04:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-15 15:14:47 +0100
commit6fa059330decd1437eef4928d732ec91fd4e17e7 (patch)
treead85a945fdba5d34554e0dff958be14b1a0ae92a
parenta253c95ec63b2b075e66ae7380fed6a73469eba5 (diff)
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>
-rw-r--r--src/sna/sna_accel.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index bc73dee1..1734a8f9 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -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;