OSDN Git Service

Silence a bunch of warnings
[android-x86/hardware-intel-common-vaapi.git] / src / gen75_vpp_gpe.h
1 /*
2  * Copyright © 2010 Intel Corporation
3  *
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:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
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.
23  *
24  * Authors:
25  *    Li Xiaowei <xiaowei.a.li@intel.com>
26  *
27  */
28
29 #ifndef GEN75_VPP_GPE
30 #define GEN75_VPP_GPE
31
32 #include <drm.h>
33 #include <i915_drm.h>
34 #include <intel_bufmgr.h>
35 #include <va/va_vpp.h>
36 #include "i965_gpe_utils.h"
37
38 #define MAX_SURF_IN_SUM 5
39
40 enum VPP_GPE_TYPE{
41    VPP_GPE_SHARPENING,
42    VPP_GPE_BLENDING,
43    VPP_GPE_SCENE_CHANGE_DETECTION,
44    VPP_GPE_FILTER_SUM,
45 };
46
47 typedef struct _KernelParameterBase{
48    unsigned short pic_width;
49    unsigned short pic_height;
50 }KernelParameterBase;
51
52 typedef struct _KernelParameterSharpening{
53    KernelParameterBase base;
54 }KernelParameterSharpening;
55
56 typedef struct _ThreadParameterBase{
57   unsigned int pic_width;
58   unsigned int pic_height;
59   unsigned int v_pos;
60   unsigned int h_pos;
61 }ThreadParameterBase;
62
63 typedef struct _ThreadParameterSharpenig{
64    ThreadParameterBase base;
65    unsigned int l_amount;
66    unsigned int d_amount;
67 }ThreadParameterSharpening;
68
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;
74
75     VAProcPipelineParameterBuffer *pipeline_param;
76     enum VPP_GPE_TYPE filter_type;
77     unsigned int sub_shader_index;
78     unsigned int sub_shader_sum;
79   
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;
85
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;
91
92     unsigned int x_step;
93     unsigned int y_step;
94   
95     unsigned int in_frame_w;
96     unsigned int in_frame_h;
97     unsigned int is_first_frame;
98
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);
104         
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);
110         
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);
116
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);
122 };
123
124 struct vpp_gpe_context *
125 gen75_gpe_context_init(VADriverContextP ctx); 
126
127 void 
128 gen75_gpe_context_destroy(VADriverContextP ctx, 
129                           struct vpp_gpe_context* vpp_context);
130
131 VAStatus
132 gen75_gpe_process_picture(VADriverContextP ctx, 
133                     struct vpp_gpe_context * vpp_context); 
134 #endif