i965_drv_video: improved MV quality for VME
[platform/upstream/libva.git] / i965_drv_video / gen6_vme.h
1 /*
2  * Copyright © 2009 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  * SOFTWAR
23  *
24  * Authors:
25  *    Zhou Chang <chang.zhou@intel.com>
26  *
27  */
28
29 #ifndef _GEN6_VME_H_
30 #define _GEN6_VME_H_
31
32 #include <xf86drm.h>
33 #include <drm.h>
34 #include <i915_drm.h>
35 #include <intel_bufmgr.h>
36
37
38 #define MAX_INTERFACE_DESC_GEN6      32
39 #define MAX_MEDIA_SURFACES_GEN6      34
40
41 #define GEN6_VME_KERNEL_NUMBER          2
42
43 struct encode_state;
44 struct gen6_encoder_context;
45
46 struct gen6_vme_context
47 {
48     struct {
49         dri_bo *bo;
50     } surface_state[MAX_MEDIA_SURFACES_GEN6];
51
52     struct {
53         dri_bo *bo;
54     } binding_table;
55
56     struct {
57         dri_bo *bo;
58     } idrt;  /* interface descriptor remap table */
59
60     struct {
61         dri_bo *bo;
62     } curbe;
63
64     struct {
65         unsigned int gpgpu_mode:1;
66         unsigned int max_num_threads:16;
67         unsigned int num_urb_entries:8;
68         unsigned int urb_entry_size:16;
69         unsigned int curbe_allocation_size:16;
70     } vfe_state;
71
72     struct {
73         dri_bo *bo;
74     } vme_state;
75
76     struct {
77         dri_bo *bo;
78         unsigned int num_blocks;
79         unsigned int size_block; /* in bytes */
80         unsigned int pitch;
81     } vme_output;
82
83     struct i965_kernel vme_kernels[GEN6_VME_KERNEL_NUMBER];
84 };
85
86 VAStatus gen6_vme_pipeline(VADriverContextP ctx,
87                            VAProfile profile,
88                            struct encode_state *encode_state,
89                            struct gen6_encoder_context *gen6_encoder_context);
90 Bool gen6_vme_context_init(VADriverContextP ctx, struct gen6_vme_context *vme_context);
91 Bool gen6_vme_context_destroy(struct gen6_vme_context *vme_context);
92
93 #endif /* _GEN6_VME_H_ */