diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2014-04-19 00:12:42 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-06-06 12:26:43 +0800 |
commit | 7465b1699cbde5fc6227167d6c28995d947f14f2 (patch) | |
tree | b6f5cc3c1a838cfb1b309cde045f147c293b9d9a | |
parent | 60ea472b116a2e245fa8579355c47eb501bfa20a (diff) | |
download | libva-intel-driver-7465b1699cbde5fc6227167d6c28995d947f14f2.tar.gz libva-intel-driver-7465b1699cbde5fc6227167d6c28995d947f14f2.tar.bz2 libva-intel-driver-7465b1699cbde5fc6227167d6c28995d947f14f2.zip |
Remove unnecessary check with IS_GEN8()
It is always true or false
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 42258e128f19b93aa102672d5f61eb73d9f9808f)
-rw-r--r-- | src/gen8_post_processing.c | 32 | ||||
-rw-r--r-- | src/gen8_render.c | 6 | ||||
-rwxr-xr-x | src/i965_post_processing.c | 37 | ||||
-rw-r--r-- | src/i965_render.c | 3 |
4 files changed, 24 insertions, 54 deletions
diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c index cf613cf..2227938 100644 --- a/src/gen8_post_processing.c +++ b/src/gen8_post_processing.c @@ -1234,8 +1234,7 @@ gen8_pp_curbe_load(VADriverContextP ctx, struct i965_driver_data *i965 = i965_driver_data(ctx); int param_size = 64; - if (IS_GEN8(i965->intel.device_info)) - param_size = sizeof(struct gen7_pp_static_parameter); + param_size = sizeof(struct gen7_pp_static_parameter); BEGIN_BATCH(batch, 4); OUT_BATCH(batch, CMD_MEDIA_CURBE_LOAD | (4 - 2)); @@ -1258,8 +1257,6 @@ gen8_pp_object_walker(VADriverContextP ctx, unsigned int *command_ptr; param_size = sizeof(struct gen7_pp_inline_parameter); - if (IS_GEN8(i965->intel.device_info)) - param_size = sizeof(struct gen7_pp_inline_parameter); x_steps = pp_context->pp_x_steps(pp_context->private_context); y_steps = pp_context->pp_y_steps(pp_context->private_context); @@ -1300,14 +1297,12 @@ gen8_pp_object_walker(VADriverContextP ctx, dri_bo_unmap(command_buffer); - if (IS_GEN8(i965->intel.device_info)) { - BEGIN_BATCH(batch, 3); - OUT_BATCH(batch, MI_BATCH_BUFFER_START | (1 << 8) | (1 << 0)); - OUT_RELOC(batch, command_buffer, - I915_GEM_DOMAIN_COMMAND, 0, 0); - OUT_BATCH(batch, 0); - ADVANCE_BATCH(batch); - } + BEGIN_BATCH(batch, 3); + OUT_BATCH(batch, MI_BATCH_BUFFER_START | (1 << 8) | (1 << 0)); + OUT_RELOC(batch, command_buffer, + I915_GEM_DOMAIN_COMMAND, 0, 0); + OUT_BATCH(batch, 0); + ADVANCE_BATCH(batch); dri_bo_unreference(command_buffer); @@ -1427,12 +1422,7 @@ gen8_post_processing_context_init(VADriverContextP ctx, assert(NUM_PP_MODULES == ARRAY_ELEMS(pp_modules_gen8)); - if (IS_GEN8(i965->intel.device_info)) - memcpy(pp_context->pp_modules, pp_modules_gen8, sizeof(pp_context->pp_modules)); - else { - /* should never get here !!! */ - assert(0); - } + memcpy(pp_context->pp_modules, pp_modules_gen8, sizeof(pp_context->pp_modules)); kernel_size = 4096 ; @@ -1481,10 +1471,8 @@ gen8_post_processing_context_init(VADriverContextP ctx, dri_bo_unmap(pp_context->instruction_state.bo); /* static & inline parameters */ - if (IS_GEN8(i965->intel.device_info)) { - pp_context->pp_static_parameter = calloc(sizeof(struct gen7_pp_static_parameter), 1); - pp_context->pp_inline_parameter = calloc(sizeof(struct gen7_pp_inline_parameter), 1); - } + pp_context->pp_static_parameter = calloc(sizeof(struct gen7_pp_static_parameter), 1); + pp_context->pp_inline_parameter = calloc(sizeof(struct gen7_pp_inline_parameter), 1); pp_context->pp_dndi_context.current_out_surface = VA_INVALID_SURFACE; pp_context->pp_dndi_context.current_out_obj_surface = NULL; diff --git a/src/gen8_render.c b/src/gen8_render.c index 074fec4..9c49cbc 100644 --- a/src/gen8_render.c +++ b/src/gen8_render.c @@ -1772,10 +1772,8 @@ gen8_render_init(VADriverContextP ctx) render_state->render_put_subpicture = gen8_render_put_subpicture; render_state->render_terminate = gen8_render_terminate; - if (IS_GEN8(i965->intel.device_info)) { - memcpy(render_state->render_kernels, render_kernels_gen8, - sizeof(render_state->render_kernels)); - } + memcpy(render_state->render_kernels, render_kernels_gen8, + sizeof(render_state->render_kernels)); kernel_size = 4096; diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c index 72279da..8bdea26 100755 --- a/src/i965_post_processing.c +++ b/src/i965_post_processing.c @@ -4194,8 +4194,7 @@ gen6_pp_upload_constants(VADriverContextP ctx, assert(sizeof(struct pp_static_parameter) == 128); assert(sizeof(struct gen7_pp_static_parameter) == 192); - if (IS_GEN7(i965->intel.device_info) || - IS_GEN8(i965->intel.device_info)) + if (IS_GEN7(i965->intel.device_info)) param_size = sizeof(struct gen7_pp_static_parameter); else param_size = sizeof(struct pp_static_parameter); @@ -4278,8 +4277,7 @@ gen6_pp_curbe_load(VADriverContextP ctx, struct i965_driver_data *i965 = i965_driver_data(ctx); int param_size; - if (IS_GEN7(i965->intel.device_info) || - IS_GEN8(i965->intel.device_info)) + if (IS_GEN7(i965->intel.device_info)) param_size = sizeof(struct gen7_pp_static_parameter); else param_size = sizeof(struct pp_static_parameter); @@ -4365,8 +4363,7 @@ gen6_pp_object_walker(VADriverContextP ctx, dri_bo *command_buffer; unsigned int *command_ptr; - if (IS_GEN7(i965->intel.device_info) || - IS_GEN8(i965->intel.device_info)) + if (IS_GEN7(i965->intel.device_info)) param_size = sizeof(struct gen7_pp_inline_parameter); else param_size = sizeof(struct pp_inline_parameter); @@ -4408,23 +4405,13 @@ gen6_pp_object_walker(VADriverContextP ctx, dri_bo_unmap(command_buffer); - if (IS_GEN8(i965->intel.device_info)) { - BEGIN_BATCH(batch, 3); - OUT_BATCH(batch, MI_BATCH_BUFFER_START | (1 << 8) | (1 << 0)); - OUT_RELOC(batch, command_buffer, - I915_GEM_DOMAIN_COMMAND, 0, - 0); - OUT_BATCH(batch, 0); - ADVANCE_BATCH(batch); - } else { - BEGIN_BATCH(batch, 2); - OUT_BATCH(batch, MI_BATCH_BUFFER_START | (1 << 8)); - OUT_RELOC(batch, command_buffer, - I915_GEM_DOMAIN_COMMAND, 0, + BEGIN_BATCH(batch, 2); + OUT_BATCH(batch, MI_BATCH_BUFFER_START | (1 << 8)); + OUT_RELOC(batch, command_buffer, + I915_GEM_DOMAIN_COMMAND, 0, 0); - ADVANCE_BATCH(batch); - } - + ADVANCE_BATCH(batch); + dri_bo_unreference(command_buffer); /* Have to execute the batch buffer here becuase MI_BATCH_BUFFER_END @@ -4567,8 +4554,7 @@ i965_vpp_clear_surface(VADriverContextP ctx, br13 |= pitch; if (IS_GEN6(i965->intel.device_info) || - IS_GEN7(i965->intel.device_info) || - IS_GEN8(i965->intel.device_info)) { + IS_GEN7(i965->intel.device_info)) { intel_batchbuffer_start_atomic_blt(batch, 48); BEGIN_BLT_BATCH(batch, 12); } else { @@ -5252,8 +5238,7 @@ i965_post_processing_context_init(VADriverContextP ctx, } /* static & inline parameters */ - if (IS_GEN7(i965->intel.device_info) || - IS_GEN8(i965->intel.device_info)) { + if (IS_GEN7(i965->intel.device_info)) { pp_context->pp_static_parameter = calloc(sizeof(struct gen7_pp_static_parameter), 1); pp_context->pp_inline_parameter = calloc(sizeof(struct gen7_pp_inline_parameter), 1); } else { diff --git a/src/i965_render.c b/src/i965_render.c index 9d0e846..38f70eb 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -1540,8 +1540,7 @@ i965_clear_dest_region(VADriverContextP ctx) br13 |= pitch; if (IS_GEN6(i965->intel.device_info) || - IS_GEN7(i965->intel.device_info) || - IS_GEN8(i965->intel.device_info)) { + IS_GEN7(i965->intel.device_info)) { intel_batchbuffer_start_atomic_blt(batch, 24); BEGIN_BLT_BATCH(batch, 6); } else { |