a63bc18a27b1048b8789d04c7c47738d7668f3ca
[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 struct encode_state;
42 struct gen6_encoder_context;
43
44 struct gen6_vme_context
45 {
46     struct {
47         dri_bo *bo;
48     } surface_state[MAX_MEDIA_SURFACES_GEN6];
49
50     struct {
51         dri_bo *bo;
52     } binding_table;
53
54     struct {
55         dri_bo *bo;
56     } idrt;  /* interface descriptor remap table */
57
58     struct {
59         dri_bo *bo;
60     } curbe;
61
62     struct {
63         unsigned int gpgpu_mode:1;
64         unsigned int max_num_threads:16;
65         unsigned int num_urb_entries:8;
66         unsigned int urb_entry_size:16;
67         unsigned int curbe_allocation_size:16;
68     } vfe_state;
69
70     struct {
71         dri_bo *bo;
72     } vme_state;
73
74     struct {
75         dri_bo *bo;
76         unsigned int num_blocks;
77         unsigned int size_block; /* in bytes */
78         unsigned int pitch;
79     } vme_output;
80 };
81
82 VAStatus gen6_vme_pipeline(VADriverContextP ctx,
83                            VAProfile profile,
84                            struct encode_state *encode_state,
85                            struct gen6_encoder_context *gen6_encoder_context);
86 Bool gen6_vme_context_init(VADriverContextP ctx, struct gen6_vme_context *vme_context);
87 Bool gen6_vme_context_destroy(struct gen6_vme_context *vme_context);
88
89 #endif /* _GEN6_VME_H_ */