Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  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_VEBOX_H
  30. #define _GEN75_VPP_VEBOX_H
  31.  
  32. #include <xf86drm.h>
  33. #include <drm.h>
  34. #include <i915_drm.h>
  35. #include <intel_bufmgr.h>
  36. #include "i965_drv_video.h"
  37.  
  38. #define INPUT_SURFACE  0
  39. #define OUTPUT_SURFACE 1
  40.  
  41. #define VPP_DNDI_DN        0x00000001
  42. #define VPP_DNDI_DI        0x00000002
  43. #define VPP_IECP_STD_STE   0x00000100
  44. #define VPP_IECP_ACE       0x00000200
  45. #define VPP_IECP_TCC       0x00000400
  46. #define VPP_IECP_PRO_AMP   0x00000800
  47. #define VPP_IECP_CSC       0x00001000
  48. #define VPP_IECP_AOI       0x00002000
  49. #define MAX_FILTER_SUM     8
  50.  
  51. enum {
  52.     FRAME_IN_CURRENT = 0,
  53.     FRAME_IN_PREVIOUS,
  54.     FRAME_IN_STMM,
  55.     FRAME_OUT_STMM,
  56.     FRAME_OUT_CURRENT_DN,
  57.     FRAME_OUT_CURRENT,
  58.     FRAME_OUT_PREVIOUS,
  59.     FRAME_OUT_STATISTIC,
  60.     FRAME_STORE_SUM,
  61. };
  62.  
  63. enum SURFACE_FORMAT{
  64.     YCRCB_NORMAL = 0,
  65.     YCRCB_SWAPUVY,
  66.     YCRCB_SWAPUV,
  67.     YCRCB_SWAPY,
  68.     PLANAR_420_8,  //NV12
  69.     PACKED_444A_8,
  70.     PACKED_422_16,
  71.     R10G10B10A2_UNORM_SRGB,
  72.     R8G8B8A8_UNORM_SRGB,
  73.     PACKED_444_16,
  74.     PLANAR_422_16,
  75.     Y8_UNORM,
  76.     PLANAR_420_16,
  77.     R16G16B16A16,
  78.     SURFACE_FORMAT_SUM
  79. };
  80.  
  81. typedef struct veb_frame_store {
  82.     VASurfaceID surface_id;
  83.     dri_bo  *bo;
  84.     unsigned char  is_internal_surface;
  85. } VEBFrameStore;
  86.  
  87. typedef struct veb_buffer {
  88.     dri_bo  *bo;
  89.     void *  ptr;
  90.     unsigned char  valid;
  91. } VEBBuffer;
  92.  
  93. struct intel_vebox_context
  94. {
  95.     struct intel_batchbuffer *batch;
  96.  
  97.     VASurfaceID surface_input;
  98.     VASurfaceID surface_output;
  99.     unsigned int fourcc_input;
  100.     unsigned int fourcc_output;
  101.     unsigned int pic_width;
  102.     unsigned int pic_height;
  103.  
  104.     VEBFrameStore frame_store[FRAME_STORE_SUM];
  105.  
  106.     VEBBuffer dndi_state_table;
  107.     VEBBuffer iecp_state_table;
  108.     VEBBuffer gamut_state_table;
  109.     VEBBuffer vertex_state_table;
  110.  
  111.     unsigned int  filters_mask;
  112.     unsigned char is_first_frame;
  113.  
  114.     /*
  115.     VAProcPipelineParameterBuffer * pipeline_param;
  116.     void * filter_dn;
  117.     void * filter_di;
  118.     void * filter_iecp_std;
  119.     void * filter_iecp_ace;
  120.     void * filter_iecp_tcc;
  121.     void * filter_iecp_amp;
  122.     void * filter_iecp_csc;
  123.     */
  124. };
  125.  
  126. VAStatus gen75_vebox_process_picture(VADriverContextP ctx,
  127.                          struct intel_vebox_context *proc_ctx);
  128.  
  129. void gen75_vebox_context_destroy(VADriverContextP ctx,
  130.                           struct intel_vebox_context *proc_ctx);
  131.  
  132. struct intel_vebox_context * gen75_vebox_context_init(VADriverContextP ctx);
  133.  
  134. #endif
  135.