Mesa (mesa_7_7_branch): st/xorg: fix a rare video crash

Zack Rusin zack at kemper.freedesktop.org
Mon Jan 11 22:56:56 UTC 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: 3447d545d99c450c6a13d8a37e9cb9f5463a40eb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3447d545d99c450c6a13d8a37e9cb9f5463a40eb

Author: Zack Rusin <zackr at vmware.com>
Date:   Mon Jan 11 18:03:49 2010 -0500

st/xorg: fix a rare video crash

sometimes dst isn't present if a window is in a middle of a resize, stop
crashing in those cases and just ignore a frame.

---

 src/gallium/state_trackers/xorg/xorg_xv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index 19c5005..666ff10 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -486,7 +486,7 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
    Bool hdtv;
    int x, y, w, h;
    struct exa_pixmap_priv *dst = exaGetPixmapDriverPrivate(pPixmap);
-   struct pipe_surface *dst_surf = xorg_gpu_surface(pPriv->r->pipe->screen, dst);
+   struct pipe_surface *dst_surf = NULL;
 
    if (dst && !dst->tex) {
 	xorg_exa_set_shared_usage(pPixmap);
@@ -496,6 +496,7 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
    if (!dst || !dst->tex)
       XORG_FALLBACK("Xv destination %s", !dst ? "!dst" : "!dst->tex");
 
+   dst_surf = xorg_gpu_surface(pPriv->r->pipe->screen, dst);
    hdtv = ((src_w >= RES_720P_X) && (src_h >= RES_720P_Y));
 
    REGION_TRANSLATE(pScrn->pScreen, dstRegion, -pPixmap->screen_x,




More information about the mesa-commit mailing list