diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-10 10:03:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-15 12:43:12 +0000 |
commit | 84d7a82122530a62ab9a2f4bba3044c23a0db9b0 (patch) | |
tree | e33c725b92481422dabbab96a03063305e24469a /src/intel_uxa.c | |
parent | 1b1016624ad16cf5063e88a1d422e28865a9e87f (diff) |
uxa: Simplify allocation of backing pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_uxa.c')
-rw-r--r-- | src/intel_uxa.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/intel_uxa.c b/src/intel_uxa.c index 446befd5..0b1a3696 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -640,6 +640,9 @@ void intel_set_pixmap_bo(PixmapPtr pixmap, dri_bo * bo) dri_bo_unreference(priv->bo); list_del(&priv->batch); + + free(priv); + priv = NULL; } if (bo != NULL) { @@ -647,13 +650,11 @@ void intel_set_pixmap_bo(PixmapPtr pixmap, dri_bo * bo) uint32_t swizzle_mode; int ret; - if (priv == NULL) { - priv = calloc(1, sizeof (struct intel_pixmap)); - if (priv == NULL) - goto BAIL; + priv = calloc(1, sizeof (struct intel_pixmap)); + if (priv == NULL) + goto BAIL; - list_init(&priv->batch); - } + list_init(&priv->batch); dri_bo_reference(bo); priv->bo = bo; @@ -668,11 +669,6 @@ void intel_set_pixmap_bo(PixmapPtr pixmap, dri_bo * bo) priv->tiling = tiling; priv->busy = -1; priv->offscreen = 1; - } else { - if (priv != NULL) { - free(priv); - priv = NULL; - } } BAIL: |