diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-19 19:33:01 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-20 13:49:16 +0100 |
commit | d0362a20bb3ead2fab9401b63209f917bdd72d55 (patch) | |
tree | e8351967ede16845eeee305b5ff1252e9f17e3fe | |
parent | 585667c2f9f88554ed89ff21ae38600f761d964c (diff) |
sna: Bypass the gpu-is-wedged? check for forced bo creation
In order to attach a scanout (and use swrast) on a wedged GPU, we need to
bypass the safety checks for normal pixmap creation.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 23f2cb25..b465a347 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -139,6 +139,21 @@ static uint32_t sna_pixmap_choose_tiling(PixmapPtr pixmap) pixmap->drawable.bitsPerPixel); } +static struct sna_pixmap *_sna_pixmap_attach(PixmapPtr pixmap) +{ + struct sna_pixmap *priv; + + priv = calloc(1, sizeof(*priv)); + if (!priv) + return NULL; + + list_init(&priv->list); + priv->pixmap = pixmap; + + sna_set_pixmap(pixmap, priv); + return priv; +} + struct sna_pixmap *sna_pixmap_attach(PixmapPtr pixmap) { struct sna *sna; @@ -164,15 +179,7 @@ struct sna_pixmap *sna_pixmap_attach(PixmapPtr pixmap) sna_pixmap_choose_tiling(pixmap))) return NULL; - priv = calloc(1, sizeof(*priv)); - if (!priv) - return NULL; - - list_init(&priv->list); - priv->pixmap = pixmap; - - sna_set_pixmap(pixmap, priv); - return priv; + return _sna_pixmap_attach(pixmap); } static PixmapPtr @@ -677,7 +684,7 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap) priv = sna_pixmap(pixmap); if (priv == NULL) { - priv = sna_pixmap_attach(pixmap); + priv = _sna_pixmap_attach(pixmap); if (priv == NULL) return NULL; |