2 * Copyright © 2010 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 * Li Xiaowei <xiaowei.a.li@intel.com>
34 #include <intel_bufmgr.h>
35 #include <va/va_vpp.h>
36 #include "i965_gpe_utils.h"
38 #define MAX_SURF_IN_SUM 5
43 VPP_GPE_SCENE_CHANGE_DETECTION,
47 typedef struct _KernelParameterBase{
48 unsigned short pic_width;
49 unsigned short pic_height;
52 typedef struct _KernelParameterSharpening{
53 KernelParameterBase base;
54 }KernelParameterSharpening;
56 typedef struct _ThreadParameterBase{
57 unsigned int pic_width;
58 unsigned int pic_height;
63 typedef struct _ThreadParameterSharpenig{
64 ThreadParameterBase base;
65 unsigned int l_amount;
66 unsigned int d_amount;
67 }ThreadParameterSharpening;
69 struct vpp_gpe_context{
70 struct intel_batchbuffer *batch;
71 struct i965_gpe_context gpe_ctx;
72 struct i965_buffer_surface vpp_batchbuffer;
73 struct i965_buffer_surface vpp_kernel_return;
75 VAProcPipelineParameterBuffer *pipeline_param;
76 enum VPP_GPE_TYPE filter_type;
77 unsigned int sub_shader_index;
78 unsigned int sub_shader_sum;
80 unsigned char * kernel_param;
81 unsigned int kernel_param_size;
82 unsigned char * thread_param;
83 unsigned int thread_param_size;
84 unsigned int thread_num;
86 VASurfaceID surface_output;
87 VASurfaceID surface_tmp;
88 VASurfaceID surface_input[MAX_SURF_IN_SUM];
89 unsigned int forward_surf_sum;
90 unsigned int backward_surf_sum;
95 unsigned int in_frame_w;
96 unsigned int in_frame_h;
97 unsigned int is_first_frame;
99 void (*vpp_surface2_setup)(VADriverContextP ctx,
100 struct i965_gpe_context *gpe_context,
101 struct object_surface *obj_surface,
102 unsigned long binding_table_offset,
103 unsigned long surface_state_offset);
105 void (*vpp_media_rw_surface_setup)(VADriverContextP ctx,
106 struct i965_gpe_context *gpe_context,
107 struct object_surface *obj_surface,
108 unsigned long binding_table_offset,
109 unsigned long surface_state_offset);
111 void (*vpp_buffer_surface_setup)(VADriverContextP ctx,
112 struct i965_gpe_context *gpe_context,
113 struct i965_buffer_surface *buffer_surface,
114 unsigned long binding_table_offset,
115 unsigned long surface_state_offset);
117 void (*vpp_media_chroma_surface_setup)(VADriverContextP ctx,
118 struct i965_gpe_context *gpe_context,
119 struct object_surface *obj_surface,
120 unsigned long binding_table_offset,
121 unsigned long surface_state_offset);
125 gen75_gpe_context_init(VADriverContextP ctx);
128 gen75_gpe_context_destroy(VADriverContextP ctx,
129 struct vpp_gpe_context* vpp_context);
132 gen75_gpe_process_picture(VADriverContextP ctx,
133 struct vpp_gpe_context * vpp_context);