diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-09-15 18:30:58 +0200 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-09-15 18:30:58 +0200 |
commit | 45cf2696ca2ad5f2ef77a3c35ee1d0ab1709b1da (patch) | |
tree | f80f5223b005e94edabc5ea5d229738440db4d35 /src/gallium | |
parent | be94a1d3bc147320ac7bfd98235783359bfada5c (diff) |
st/xorg: Explicitly check whether the driver supports the pixmap formats.
Rather than arbitrarily checking for pixmap depth < 15.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_exa.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index d6241aa19e..88149b9d5c 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -284,15 +284,17 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) #if 0 debug_printf("ExaPrepareSolid - test\n"); #endif - if (pPixmap->drawable.depth < 15) - return FALSE; - if (!EXA_PM_IS_SOLID(&pPixmap->drawable, planeMask)) return FALSE; if (!priv || !priv->tex) return FALSE; + if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, + priv->tex->target, + PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) + return FALSE; + if (alu != GXcopy) return FALSE; @@ -358,15 +360,20 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, if (alu != GXcopy) return FALSE; - if (pSrcPixmap->drawable.depth < 15 || pDstPixmap->drawable.depth < 15) - return FALSE; - if (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planeMask)) return FALSE; if (!priv || !src_priv) return FALSE; + if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format, + priv->tex->target, + PIPE_TEXTURE_USAGE_RENDER_TARGET, 0) || + !exa->scrn->is_format_supported(exa->scrn, src_priv->tex->format, + src_priv->tex->target, + PIPE_TEXTURE_USAGE_SAMPLER, 0)) + return FALSE; + if (!priv->tex || !src_priv->tex) return FALSE; |