[Libva] [PATCH 3/9] vpp: gen7/8/9: add yuv to rgb conversion matrix to registers send to EUs
Zhao Yakui
yakui.zhao at intel.com
Tue Nov 3 16:34:22 PST 2015
On 11/04/2015 12:56 AM, Lionel Landwerlin wrote:
Is it possible to find the unused field to store the corresponding
conversion matrix of YUV<->RGB? Otherwise we need to adjust the register
offset for every VPP shaders.
Even if the constant buffer is increased to hold the conversion matrix,
it will be better that this patch is added after the patch 04(remap the
VPP registers). This will help to reduce the effect of git-bisect.
> ---
> src/gen8_post_processing.c | 12 ++++++------
> src/i965_post_processing.c | 16 ++++++++--------
> src/i965_post_processing.h | 45 +++++++++++++++++++++++++++++++++++----------
> 3 files changed, 49 insertions(+), 24 deletions(-)
>
> diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
> index a5e036d..569232d 100644
> --- a/src/gen8_post_processing.c
> +++ b/src/gen8_post_processing.c
> @@ -713,10 +713,10 @@ gen7_pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context,
> struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)pp_context->private_context;
> struct gen7_pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
>
> - pp_inline_parameter->grf7.destination_block_horizontal_origin = x * 16 + pp_avs_context->dest_x;
> - pp_inline_parameter->grf7.destination_block_vertical_origin = y * 16 + pp_avs_context->dest_y;
> - pp_inline_parameter->grf7.constant_0 = 0xffffffff;
> - pp_inline_parameter->grf7.sampler_load_main_video_x_scaling_step = pp_avs_context->horiz_range / pp_avs_context->src_w;
> + pp_inline_parameter->grf9.destination_block_horizontal_origin = x * 16 + pp_avs_context->dest_x;
> + pp_inline_parameter->grf9.destination_block_vertical_origin = y * 16 + pp_avs_context->dest_y;
> + pp_inline_parameter->grf9.constant_0 = 0xffffffff;
> + pp_inline_parameter->grf9.sampler_load_main_video_x_scaling_step = pp_avs_context->horiz_range / pp_avs_context->src_w;
>
> return 0;
> }
> @@ -1187,7 +1187,7 @@ gen8_pp_interface_descriptor_table(VADriverContextP ctx,
> desc->desc4.binding_table_pointer = (BINDING_TABLE_OFFSET>> 5);
> desc->desc5.constant_urb_entry_read_offset = 0;
>
> - desc->desc5.constant_urb_entry_read_length = 6; /* grf 1-6 */
> + desc->desc5.constant_urb_entry_read_length = 8; /* grf 1-8 */
>
> dri_bo_unmap(bo);
> pp_context->idrt.num_interface_descriptors++;
> @@ -1201,7 +1201,7 @@ gen8_pp_upload_constants(VADriverContextP ctx,
> unsigned char *constant_buffer;
> int param_size;
>
> - assert(sizeof(struct gen7_pp_static_parameter) == 192);
> + assert(sizeof(struct gen7_pp_static_parameter) == 256);
>
> param_size = sizeof(struct gen7_pp_static_parameter);
>
> diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
> index 0d145d8..e1d96d4 100755
> --- a/src/i965_post_processing.c
> +++ b/src/i965_post_processing.c
> @@ -3029,10 +3029,10 @@ gen7_pp_avs_set_block_parameter(struct i965_post_processing_context *pp_context,
> struct pp_avs_context *pp_avs_context = (struct pp_avs_context *)pp_context->private_context;
> struct gen7_pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
>
> - pp_inline_parameter->grf7.destination_block_horizontal_origin = x * 16 + pp_avs_context->dest_x;
> - pp_inline_parameter->grf7.destination_block_vertical_origin = y * 16 + pp_avs_context->dest_y;
> - pp_inline_parameter->grf7.constant_0 = 0xffffffff;
> - pp_inline_parameter->grf7.sampler_load_main_video_x_scaling_step = pp_avs_context->horiz_range / pp_avs_context->src_w;
> + pp_inline_parameter->grf9.destination_block_horizontal_origin = x * 16 + pp_avs_context->dest_x;
> + pp_inline_parameter->grf9.destination_block_vertical_origin = y * 16 + pp_avs_context->dest_y;
> + pp_inline_parameter->grf9.constant_0 = 0xffffffff;
> + pp_inline_parameter->grf9.sampler_load_main_video_x_scaling_step = pp_avs_context->horiz_range / pp_avs_context->src_w;
>
> return 0;
> }
> @@ -3736,8 +3736,8 @@ gen7_pp_dndi_set_block_parameter(struct i965_post_processing_context *pp_context
> {
> struct gen7_pp_inline_parameter *pp_inline_parameter = pp_context->pp_inline_parameter;
>
> - pp_inline_parameter->grf7.destination_block_horizontal_origin = x * 16;
> - pp_inline_parameter->grf7.destination_block_vertical_origin = y * 4;
> + pp_inline_parameter->grf9.destination_block_horizontal_origin = x * 16;
> + pp_inline_parameter->grf9.destination_block_vertical_origin = y * 4;
>
> return 0;
> }
> @@ -4421,7 +4421,7 @@ gen6_pp_interface_descriptor_table(VADriverContextP ctx,
> desc->desc4.constant_urb_entry_read_offset = 0;
>
> if (IS_GEN7(i965->intel.device_info))
> - desc->desc4.constant_urb_entry_read_length = 6; /* grf 1-6 */
> + desc->desc4.constant_urb_entry_read_length = 8; /* grf 1-8 */
> else
> desc->desc4.constant_urb_entry_read_length = 4; /* grf 1-4 */
>
> @@ -4450,7 +4450,7 @@ gen6_pp_upload_constants(VADriverContextP ctx,
> int param_size;
>
> assert(sizeof(struct pp_static_parameter) == 128);
> - assert(sizeof(struct gen7_pp_static_parameter) == 192);
> + assert(sizeof(struct gen7_pp_static_parameter) == 256);
>
> if (IS_GEN7(i965->intel.device_info))
> param_size = sizeof(struct gen7_pp_static_parameter);
> diff --git a/src/i965_post_processing.h b/src/i965_post_processing.h
> index 477f0ca..63e678d 100755
> --- a/src/i965_post_processing.h
> +++ b/src/i965_post_processing.h
> @@ -422,33 +422,58 @@ struct gen7_pp_static_parameter
> float sampler_load_horizontal_frame_origin;
> unsigned int padx[7];
> } grf6;
> +
> + struct {
> + /* r7.0 -> r7.3 */
> + float coef_ry;
> + float coef_ru;
> + float coef_rv;
> + float coef_yd;
> +
> + /* r7.4 -> r7.7 */
> + float coef_gy;
> + float coef_gu;
> + float coef_gv;
> + float coef_ud;
> + } grf7;
> +
> + struct {
> + /* r8.0 -> r8.3 */
> + float coef_by;
> + float coef_bu;
> + float coef_bv;
> + float coef_vd;
> +
> + /* r8.4 -> r8.7 */
> + unsigned int padx[4];
> + } grf8;
> };
>
> struct gen7_pp_inline_parameter
> {
> struct {
> - /* r7.0 */
> + /* r9.0 */
> unsigned int destination_block_horizontal_origin:16;
> unsigned int destination_block_vertical_origin:16;
> - /* r7.1: 0xffffffff */
> + /* r9.1: 0xffffffff */
> unsigned int constant_0;
> - /* r7.2 */
> + /* r9.2 */
> unsigned int pad0;
> - /* r7.3 */
> + /* r9.3 */
> unsigned int pad1;
> - /* r7.4 */
> + /* r9.4 */
> float sampler_load_main_video_x_scaling_step;
> - /* r7.5 */
> + /* r9.5 */
> unsigned int pad2;
> - /* r7.6: must be zero */
> + /* r9.6: must be zero */
> unsigned int avs_vertical_block_number;
> - /* r7.7: 0 */
> + /* r9.7: 0 */
> unsigned int group_id_number;
> - } grf7;
> + } grf9;
>
> struct {
> unsigned int padx[8];
> - } grf8;
> + } grf10;
> };
>
> struct i965_post_processing_context
More information about the Libva
mailing list