xf86-video-intel: Branch 'intel-batchbuffer' - src/i830_render.c src/i915_render.c src/i965_render.c

Kristian Høgsberg krh at kemper.freedesktop.org
Tue Mar 11 10:41:27 PDT 2008


 src/i830_render.c |    3 ++-
 src/i915_render.c |    3 ++-
 src/i965_render.c |    4 ++++
 3 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit abf16e22cc781fa1655508ac87c21dd9845e710a
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Tue Mar 11 13:35:29 2008 -0400

    Silence warnings about possible uninitialize use of dst_format.
    
    Whoa, gcc got a lot smarter about warnings.  If iXXX_get_dest_format()
    doesn't support the picture format passed in it won't initialize the
    uint32_t pointed to by dst_format and return FALSE.
    
    What gcc now can detect is if dst_format is used without checking the
    return value, it might be used uninitialized.  This patch makes sure
    we always check the return value before using dst_format.
    
    However, notice how the fix in i965_render.c checks the return value in
    early on in i965_prepare_composite() so that the unchecked use that
    happens later in i965_set_picture_surface_state() wont get a warning.
    
    I need more coffee.

diff --git a/src/i830_render.c b/src/i830_render.c
index 24ad262..956ab92 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -405,7 +405,8 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture,
     IntelEmitInvarientState(pScrn);
     *pI830->last_3d = LAST_3D_RENDER;
 
-    i830_get_dest_format(pDstPicture, &dst_format);
+    if (!i830_get_dest_format(pDstPicture, &dst_format))
+	return FALSE;
     dst_pitch = intel_get_pixmap_pitch(pDst);
 
     if (!i830_texture_setup(pSrcPicture, pSrc, 0))
diff --git a/src/i915_render.c b/src/i915_render.c
index 151f89d..52c688e 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -322,7 +322,8 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
     IntelEmitInvarientState(pScrn);
     *pI830->last_3d = LAST_3D_RENDER;
 
-    i915_get_dest_format(pDstPicture, &dst_format);
+    if (!i915_get_dest_format(pDstPicture, &dst_format))
+	return FALSE;
     dst_offset = intel_get_pixmap_offset(pDst);
     dst_pitch = intel_get_pixmap_pitch(pDst);
     FS_LOCALS(20);
diff --git a/src/i965_render.c b/src/i965_render.c
index 00463e8..94eb189 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1009,6 +1009,7 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
     CARD32 *binding_table;
     CARD32 src_blend, dst_blend;
     int binding_table_offset;
+    uint32_t dst_format;
 
     /* We cannot handle a flush occuring anytime during the
      * prepare_composite/composite/done_composite handling. So make
@@ -1072,6 +1073,9 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
 			    pI830->exa965->num_ops);
     binding_table = (void *)((char *)surface_map + binding_table_offset);
 
+    if (!i965_get_dest_format(pDstPicture, &dst_format))
+	return FALSE;
+
     /* Set up and bind the state buffer for the destination surface */
     binding_table[0] = i965_set_picture_surface_state(pScrn, 0,
 						      pDstPicture, pDst, TRUE);


More information about the xorg-commit mailing list