* [PATCH 1/5] xvmc: Get rid of unused variables.
@ 2011-01-31 5:22 Cyril Brulebois
2011-01-31 5:22 ` [PATCH 2/5] xvmc: Silence gcc, add parentheses around assignment Cyril Brulebois
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Cyril Brulebois @ 2011-01-31 5:22 UTC (permalink / raw)
To: intel-gfx
Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
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(-)
diff --git a/src/xvmc/i915_xvmc.c b/src/xvmc/i915_xvmc.c
index 21a1149..fbd4555 100644
--- a/src/xvmc/i915_xvmc.c
+++ b/src/xvmc/i915_xvmc.c
@@ -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);
diff --git a/src/xvmc/intel_batchbuffer.c b/src/xvmc/intel_batchbuffer.c
index 337b2ce..2b5526c 100644
--- a/src/xvmc/intel_batchbuffer.c
+++ b/src/xvmc/intel_batchbuffer.c
@@ -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) {
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index 6cbec80..339c133 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -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;
diff --git a/src/xvmc/xvmc_vld.c b/src/xvmc/xvmc_vld.c
index addc7c9..d72e105 100644
--- a/src/xvmc/xvmc_vld.c
+++ b/src/xvmc/xvmc_vld.c
@@ -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;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] xvmc: Silence gcc, add parentheses around assignment.
2011-01-31 5:22 [PATCH 1/5] xvmc: Get rid of unused variables Cyril Brulebois
@ 2011-01-31 5:22 ` Cyril Brulebois
2011-01-31 5:22 ` [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic Cyril Brulebois
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Cyril Brulebois @ 2011-01-31 5:22 UTC (permalink / raw)
To: intel-gfx
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
Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
src/xvmc/intel_xvmc_dump.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/xvmc/intel_xvmc_dump.c b/src/xvmc/intel_xvmc_dump.c
index 974bcbb..d22d311 100644
--- a/src/xvmc/intel_xvmc_dump.c
+++ b/src/xvmc/intel_xvmc_dump.c
@@ -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) {
--
1.7.2.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic.
2011-01-31 5:22 [PATCH 1/5] xvmc: Get rid of unused variables Cyril Brulebois
2011-01-31 5:22 ` [PATCH 2/5] xvmc: Silence gcc, add parentheses around assignment Cyril Brulebois
@ 2011-01-31 5:22 ` Cyril Brulebois
2011-01-31 9:50 ` Chris Wilson
2011-01-31 9:55 ` Julien Cristau
2011-01-31 5:22 ` [PATCH 4/5] xvmc: Silence gcc, adding a cast to work around signedness issues Cyril Brulebois
2011-01-31 5:22 ` [PATCH 5/5] xvmc: Stop using uninitialized variable Cyril Brulebois
3 siblings, 2 replies; 8+ messages in thread
From: Cyril Brulebois @ 2011-01-31 5:22 UTC (permalink / raw)
To: intel-gfx
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 ‘|’
Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
src/xvmc/i915_xvmc.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/xvmc/i915_xvmc.c b/src/xvmc/i915_xvmc.c
index fbd4555..dc3b593 100644
--- a/src/xvmc/i915_xvmc.c
+++ b/src/xvmc/i915_xvmc.c
@@ -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();
}
--
1.7.2.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] xvmc: Silence gcc, adding a cast to work around signedness issues.
2011-01-31 5:22 [PATCH 1/5] xvmc: Get rid of unused variables Cyril Brulebois
2011-01-31 5:22 ` [PATCH 2/5] xvmc: Silence gcc, add parentheses around assignment Cyril Brulebois
2011-01-31 5:22 ` [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic Cyril Brulebois
@ 2011-01-31 5:22 ` Cyril Brulebois
2011-01-31 5:22 ` [PATCH 5/5] xvmc: Stop using uninitialized variable Cyril Brulebois
3 siblings, 0 replies; 8+ messages in thread
From: Cyril Brulebois @ 2011-01-31 5:22 UTC (permalink / raw)
To: intel-gfx
Both 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
Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
src/xvmc/intel_xvmc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index 339c133..d89cda2 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -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;
}
--
1.7.2.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] xvmc: Stop using uninitialized variable.
2011-01-31 5:22 [PATCH 1/5] xvmc: Get rid of unused variables Cyril Brulebois
` (2 preceding siblings ...)
2011-01-31 5:22 ` [PATCH 4/5] xvmc: Silence gcc, adding a cast to work around signedness issues Cyril Brulebois
@ 2011-01-31 5:22 ` Cyril Brulebois
2011-01-31 10:05 ` Chris Wilson
3 siblings, 1 reply; 8+ messages in thread
From: Cyril Brulebois @ 2011-01-31 5:22 UTC (permalink / raw)
To: intel-gfx
The 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
Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
src/xvmc/intel_xvmc.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index d89cda2..1b96945 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -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;
}
/*
--
1.7.2.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic.
2011-01-31 5:22 ` [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic Cyril Brulebois
@ 2011-01-31 9:50 ` Chris Wilson
2011-01-31 9:55 ` Julien Cristau
1 sibling, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2011-01-31 9:50 UTC (permalink / raw)
To: Cyril Brulebois, intel-gfx
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
On Mon, 31 Jan 2011 06:22:37 +0100, Cyril Brulebois <kibi@debian.org> wrote:
> 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.
diff --git a/src/xvmc/intel_batchbuffer.h b/src/xvmc/intel_batchbuffer.h
index 6fa1c05..888abeb 100644
--- a/src/xvmc/intel_batchbuffer.h
+++ b/src/xvmc/intel_batchbuffer.h
@@ -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)
--
Chris Wilson, Intel Open Source Technology Centre
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic.
2011-01-31 5:22 ` [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic Cyril Brulebois
2011-01-31 9:50 ` Chris Wilson
@ 2011-01-31 9:55 ` Julien Cristau
1 sibling, 0 replies; 8+ messages in thread
From: Julien Cristau @ 2011-01-31 9:55 UTC (permalink / raw)
To: Cyril Brulebois; +Cc: intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 1584 bytes --]
On Mon, Jan 31, 2011 at 06:22:37 +0100, Cyril Brulebois wrote:
> 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 ‘|’
>
> Signed-off-by: Cyril Brulebois <kibi@debian.org>
> ---
> src/xvmc/i915_xvmc.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
Could do:
diff --git a/src/xvmc/intel_batchbuffer.h b/src/xvmc/intel_batchbuffer.h
index 6fa1c05..ceb328c 100644
--- a/src/xvmc/intel_batchbuffer.h
+++ b/src/xvmc/intel_batchbuffer.h
@@ -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
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] xvmc: Stop using uninitialized variable.
2011-01-31 5:22 ` [PATCH 5/5] xvmc: Stop using uninitialized variable Cyril Brulebois
@ 2011-01-31 10:05 ` Chris Wilson
0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2011-01-31 10:05 UTC (permalink / raw)
To: Cyril Brulebois, intel-gfx
Trival fix to 3/5 applied (hope you don't mind taking the credit/blame ;-)
and pushed.
Thanks,
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-01-31 10:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 5:22 [PATCH 1/5] xvmc: Get rid of unused variables Cyril Brulebois
2011-01-31 5:22 ` [PATCH 2/5] xvmc: Silence gcc, add parentheses around assignment Cyril Brulebois
2011-01-31 5:22 ` [PATCH 3/5] xvmc: Silence gcc, add parentheses around arithmetic Cyril Brulebois
2011-01-31 9:50 ` Chris Wilson
2011-01-31 9:55 ` Julien Cristau
2011-01-31 5:22 ` [PATCH 4/5] xvmc: Silence gcc, adding a cast to work around signedness issues Cyril Brulebois
2011-01-31 5:22 ` [PATCH 5/5] xvmc: Stop using uninitialized variable Cyril Brulebois
2011-01-31 10:05 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox