xvmc: Get rid of unused variables.
PATCH 1/5 xvmc: Get rid of unused variables.
--- src/xvmc/i915_xvmc.c | 3 +-- src/xvmc/intel_batchbuffer.c | 2 -- src/xvmc/intel_xvmc.c | 13 ------------- src/xvmc/xvmc_vld.c | 1 - 4 files changed, 1 insertions(+), 18 deletions(-)
src/xvmc/i915_xvmc.c +1 -2
@@ -391,7 +391,6 @@ static void i915_mc_static_indirect_state_set(XvMCContext * context,i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;struct intel_xvmc_surface *intel_surf = dest->privData;struct i915_mc_static_indirect_state_buffer *buffer_info; -unsigned int w = dest->width;drm_intel_gem_bo_map_gtt (pI915XvMC->sis_bo); buffer_info = pI915XvMC->sis_bo->virtual;
@@ -688,7 +687,7 @@ static void i915_mc_load_indirect_render_emit(XvMCContext * context) {i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;int mem_select; -uint32_t load_indirect, buffer_address; +uint32_t load_indirect;BATCH_LOCALS ;BEGIN_BATCH (5 );
src/xvmc/intel_batchbuffer.c +0 -2
@@ -64,8 +64,6 @@ static void i965_end_batch(void)Bool intelInitBatchBuffer (void ) { -int i; -if ((xvmc_driver->batch.buf =drm_intel_bo_alloc (xvmc_driver->bufmgr,"batch buffer" ,BATCH_SIZE ,0x1000 )) ==NULL ) {
src/xvmc/intel_xvmc.c +0 -13
@@ -105,8 +105,6 @@ unsigned int mb_bytes_420[] = {void LOCK_HARDWARE (drm_context_t ctx) { -char __ret =0 ; -PPTHREAD_MUTEX_LOCK ();assert (!xvmc_driver->locked);
@@ -218,11 +216,6 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,int error_base;int event_base;int priv_count; -int isCapable; -int screen =DefaultScreen (display); -intel_xvmc_context_ptr intel_ctx; -int fd; -char *driverName =NULL , *deviceName =NULL ;/* Verify Obvious things first */ if (!display || !context)
@@ -482,7 +475,6 @@ _X_EXPORT Status XvMCCreateBlocks(Display * display, XvMCContext * context, unsigned int num_blocks, XvMCBlockArray * block) { - Status ret;if (!display || !context || !num_blocks || !block)return BadValue;
@@ -505,7 +497,6 @@ _X_EXPORT Status XvMCCreateBlocks(Display * display, XvMCContext * context,*/ _X_EXPORT Status XvMCDestroyBlocks(Display * display, XvMCBlockArray * block) { -Status ret;if (!display || !block)return BadValue;
@@ -679,7 +670,6 @@ _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface, _X_EXPORT Status XvMCSyncSurface(Display * display, XvMCSurface * surface) {Status ret; -int stat =0 ;if (!display || !surface)return XvMCBadSurface;
@@ -739,9 +729,6 @@ _X_EXPORT Status XvMCGetSurfaceStatus(Display * display, XvMCSurface * surface,*/ _X_EXPORT Status XvMCHideSurface(Display * display, XvMCSurface * surface) { -int stat =0 ; -Status ret; -if (!display || !surface)return XvMCBadSurface;
src/xvmc/xvmc_vld.c +0 -1
@@ -785,7 +785,6 @@ static Status begin_surface(Display * display, XvMCContext * context,XvMCSurface * future, const XvMCMpegControl * control) { - struct i965_xvmc_contex *i965_ctx; struct intel_xvmc_surface *priv_target, *priv_past, *priv_future;intel_xvmc_context_ptr intel_ctx = context->privData;Status ret;
Signature · 1 line
1.7.2.3
PATCH 2/5 xvmc: Silence gcc, add parentheses around assignment.
Get rid of the following with CFLAGS="-Wall -Werror":
| CC intel_xvmc_dump.lo | cc1: warnings being treated as errors | intel_xvmc_dump.c: In function ‘intel_xvmc_dump_open’: | intel_xvmc_dump.c:41: error: suggest parentheses around assignment used as truth value
--- src/xvmc/intel_xvmc_dump.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
src/xvmc/intel_xvmc_dump.c +1 -1
@@ -38,7 +38,7 @@ void intel_xvmc_dump_open(void)if (xvmc_dump)return ; -if (d =getenv ("INTEL_XVMC_DUMP" )) +if ((d =getenv ("INTEL_XVMC_DUMP" ))) xvmc_dump =1 ;if (xvmc_dump) {
Signature · 6 lines
1.7.2.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/5 xvmc: Silence gcc, add parentheses around arithmetic.
In reply to Cyril BruleboisGet rid of those accordingly with CFLAGS="-Wall -Werror":
| CC i915_xvmc.lo | cc1: warnings being treated as errors | i915_xvmc.c: In function ‘i915_mc_one_time_state_emit’: | i915_xvmc.c:369: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:374: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:379: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c: In function ‘i915_mc_load_indirect_render_emit’: | i915_xvmc.c:708: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:713: error: suggest parentheses around arithmetic in operand of ‘|’
--- src/xvmc/i915_xvmc.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
src/xvmc/i915_xvmc.c +5 -5
@@ -367,17 +367,17 @@ static void i915_mc_one_time_state_emit(XvMCContext * context)/* Sample state buffer */ OUT_RELOC (pI915XvMC->ssb_bo,I915_GEM_DOMAIN_INSTRUCTION ,0 , -STATE_VALID |STATE_FORCE ); + (STATE_VALID |STATE_FORCE ));OUT_BATCH (7 );/* 8 - 1 */ /* Pixel shader program buffer */ OUT_RELOC (pI915XvMC->psp_bo,I915_GEM_DOMAIN_INSTRUCTION ,0 , -STATE_VALID |STATE_FORCE ); + (STATE_VALID |STATE_FORCE ));OUT_BATCH (66 );/* 4 + 16 + 16 + 31 - 1 */ /* Pixel shader constant buffer */ OUT_RELOC (pI915XvMC->psc_bo,I915_GEM_DOMAIN_INSTRUCTION ,0 , -STATE_VALID |STATE_FORCE ); + (STATE_VALID |STATE_FORCE ));OUT_BATCH (5 );/* 6 - 1 */ ADVANCE_BATCH (); }
@@ -705,12 +705,12 @@ static void i915_mc_load_indirect_render_emit(XvMCContext * context)/* Static Indirect state buffer (dest buffer info) */ OUT_RELOC (pI915XvMC->sis_bo,I915_GEM_DOMAIN_INSTRUCTION ,0 , -STATE_VALID |STATE_FORCE ); + (STATE_VALID |STATE_FORCE ));OUT_BATCH (16 );/* 4 * 3 + 2 + 3 - 1 */ /* Map state buffer (reference buffer info) */ OUT_RELOC (pI915XvMC->msb_bo,I915_GEM_DOMAIN_INSTRUCTION ,0 , -STATE_VALID |STATE_FORCE ); + (STATE_VALID |STATE_FORCE ));OUT_BATCH (23 );/* 3 * 8 - 1 */ ADVANCE_BATCH (); }
Signature · 6 lines
1.7.2.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic.
Quoted 10 lines · Cyril Brulebois
Get rid of those accordingly with CFLAGS="-Wall -Werror":
| CC i915_xvmc.lo | cc1: warnings being treated as errors | i915_xvmc.c: In function ‘i915_mc_one_time_state_emit’: | i915_xvmc.c:369: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:374: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:379: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c: In function ‘i915_mc_load_indirect_render_emit’: | i915_xvmc.c:708: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:713: error: suggest parentheses around arithmetic in operand of ‘|’
Fix the macro instead.
src/xvmc/intel_batchbuffer.h +1 -1
@@ -24,7 +24,7 @@ extern int VERBOSE;#define OUT_RELOC (bo,read_domains,write_domains,delta) \ do { \ - *(unsigned int *)batch_ptr = delta + bo->offset; \ + *(unsigned int *)batch_ptr = (delta) + bo->offset; \ intel_batch_emit_reloc(bo, read_domains, write_domains, delta, batch_pt batch_ptr +=4 ; \ }while (0 )
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic.
In reply to Cyril BruleboisQuoted 11 lines · Cyril Brulebois
Get rid of those accordingly with CFLAGS="-Wall -Werror":
| CC i915_xvmc.lo | cc1: warnings being treated as errors | i915_xvmc.c: In function ‘i915_mc_one_time_state_emit’: | i915_xvmc.c:369: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:374: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:379: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c: In function ‘i915_mc_load_indirect_render_emit’: | i915_xvmc.c:708: error: suggest parentheses around arithmetic in operand of ‘|’ | i915_xvmc.c:713: error: suggest parentheses around arithmetic in operand of ‘|’
Quoted 5 lines
Signed-off-by Cyril Brulebois <[email protected]>--- src/xvmc/i915_xvmc.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
Could do:
src/xvmc/intel_batchbuffer.h +1 -1
@@ -24,7 +24,7 @@ extern int VERBOSE;#define OUT_RELOC (bo,read_domains,write_domains,delta) \ do { \ - *(unsigned int *)batch_ptr = delta + bo->offset; \ + *(unsigned int *)batch_ptr = (delta) + (bo)->offset; \ intel_batch_emit_reloc(bo, read_domains, write_domains, delta, batch_ptr); \ batch_ptr += 4; \ } while (0)
instead?
Cheers,
Julien
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/5 xvmc: Silence gcc, adding a cast to work around signedness issues.
In reply to Cyril BruleboisBoth exported XvMCPutSlice/XvMCPutSlice2 functions have a prototype with a parameter whose signedness differs from the one in the put_slice/put_slice2 functions they call. Make it unsigned through a cast.
Get rid of this accordingly with CFLAGS="-Wall -Werror":
| CC intel_xvmc.lo | cc1: warnings being treated as errors | intel_xvmc.c: In function ‘XvMCSyncSurface’: | intel_xvmc.c:677: error: ‘ret’ may be used uninitialized in this function | intel_xvmc.c:672: note: ‘ret’ was declared here
--- src/xvmc/intel_xvmc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
src/xvmc/intel_xvmc.c +2 -2
@@ -1058,7 +1058,7 @@ _X_EXPORT Status XvMCLoadQMatrix(Display * display, XvMCContext * context, _X_EXPORT Status XvMCPutSlice(Display * display, XvMCContext * context,char *slice,int nbytes) { -if (xvmc_driver->put_slice (display, context, slice, nbytes)) { +if (xvmc_driver->put_slice (display, context, (unsigned char *) slice, nbytes)) {XVMC_ERR ("PutSlice fail\n" );return BadValue; }
@@ -1069,7 +1069,7 @@ _X_EXPORT Status XvMCPutSlice2(Display * display, XvMCContext * context, char *slice, int nbytes, int slice_code) { if (xvmc_driver->put_slice2 - (display, context, slice, nbytes, slice_code)) { + (display, context, (unsigned char *) slice, nbytes, slice_code)) { XVMC_ERR("PutSlice2 fail\n");return BadValue; }
Signature · 6 lines
1.7.2.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/5 xvmc: Stop using uninitialized variable.
In reply to Cyril BruleboisThe actual code was removed in 5f64122551, where the get_surface_status driver callback was dropped. Just return Success if there were no issues with the parameter.
Get rid of the following with CFLAGS="-Wall -Werror":
| CC intel_xvmc.lo | cc1: warnings being treated as errors | intel_xvmc.c: In function ‘XvMCSyncSurface’: | intel_xvmc.c:677: error: ‘ret’ may be used uninitialized in this function | intel_xvmc.c:672: note: ‘ret’ was declared here
--- src/xvmc/intel_xvmc.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
src/xvmc/intel_xvmc.c +1 -3
@@ -669,12 +669,10 @@ _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface,*/ _X_EXPORT Status XvMCSyncSurface(Display * display, XvMCSurface * surface) { -Status ret; -if (!display || !surface)return XvMCBadSurface; -return ret; +return Success; }/*
Signature · 6 lines
1.7.2.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/5] xvmc: Stop using uninitialized variable.
Trival fix to 3/5 applied (hope you don't mind taking the credit/blame ;-) and pushed.
Thanks,
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre