From 2f09139036968392c102ba3cf653c165f11d8106 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 8 Aug 2014 11:30:25 +0200 Subject: vebox: silence compilation warning. Silence the following compilation warning: CC i965_drv_video_la-gen75_vpp_vebox.lo gen75_vpp_vebox.c: In function 'bdw_veb_dndi_iecp_command': gen75_vpp_vebox.c:1537:5: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] Also simplify the calculation of the VEB_DI_IECP::endingX variable with existing helper macros. v2: renamed endingX to width64, which represents the width aligned on to 64 columns, dropped obsolete startingX [Yakui] Signed-off-by: Gwenole Beauchesne --- src/gen75_vpp_vebox.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c index 1113c90a..4188794f 100644 --- a/src/gen75_vpp_vebox.c +++ b/src/gen75_vpp_vebox.c @@ -805,8 +805,7 @@ void hsw_veb_dndi_iecp_command(VADriverContextP ctx, struct intel_vebox_context { struct intel_batchbuffer *batch = proc_ctx->batch; unsigned char frame_ctrl_bits = 0; - unsigned int startingX = 0; - unsigned int endingX = (proc_ctx->width_input + 63 ) / 64 * 64; + const unsigned int width64 = ALIGN(proc_ctx->width_input, 64); /* s1:update the previous and current input */ /* tempFrame = proc_ctx->frame_store[FRAME_IN_PREVIOUS]; @@ -829,9 +828,7 @@ void hsw_veb_dndi_iecp_command(VADriverContextP ctx, struct intel_vebox_context /*s3:set reloc buffer address */ BEGIN_VEB_BATCH(batch, 10); OUT_VEB_BATCH(batch, VEB_DNDI_IECP_STATE | (10 - 2)); - OUT_VEB_BATCH(batch, - startingX << 16 | - (endingX-1)); + OUT_VEB_BATCH(batch, (width64 - 1)); OUT_RELOC(batch, proc_ctx->frame_store[FRAME_IN_CURRENT].obj_surface->bo, I915_GEM_DOMAIN_RENDER, 0, frame_ctrl_bits); @@ -1532,14 +1529,11 @@ void bdw_veb_dndi_iecp_command(VADriverContextP ctx, struct intel_vebox_context { struct intel_batchbuffer *batch = proc_ctx->batch; unsigned char frame_ctrl_bits = 0; - unsigned int startingX = 0; - unsigned int endingX = (proc_ctx->width_input + 63 ) / 64 * 64; + const unsigned int width64 = ALIGN(proc_ctx->width_input, 64); BEGIN_VEB_BATCH(batch, 0x14); OUT_VEB_BATCH(batch, VEB_DNDI_IECP_STATE | (0x14 - 2));//DWord 0 - OUT_VEB_BATCH(batch, - startingX << 16 | - endingX -1);//DWord 1 + OUT_VEB_BATCH(batch, (width64 - 1)); OUT_RELOC(batch, proc_ctx->frame_store[FRAME_IN_CURRENT].obj_surface->bo, -- cgit v1.2.1