i965: Delete the intel_regions.c code.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_regions.h
1 /**************************************************************************
2 *
3 * Copyright 2006 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef INTEL_REGIONS_H
29 #define INTEL_REGIONS_H
30
31 /** @file intel_regions.h
32 *
33 * Structure definitions and prototypes for intel_region handling,
34 * which is the basic structure for rectangular collections of pixels
35 * stored in a drm_intel_bo.
36 */
37
38 #include <stdbool.h>
39 #include <xf86drm.h>
40
41 #include "main/mtypes.h"
42 #include "intel_bufmgr.h"
43 #include <GL/internal/dri_interface.h>
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 /**
50 * Used with images created with image_from_names
51 * to help support planar images.
52 */
53 struct intel_image_format {
54 int fourcc;
55 int components;
56 int nplanes;
57 struct {
58 int buffer_index;
59 int width_shift;
60 int height_shift;
61 uint32_t dri_format;
62 int cpp;
63 } planes[3];
64 };
65
66 struct __DRIimageRec {
67 drm_intel_bo *bo;
68 uint32_t pitch; /**< in bytes */
69 GLenum internal_format;
70 uint32_t dri_format;
71 GLuint format;
72 uint32_t offset;
73
74 /*
75 * Need to save these here between calls to
76 * image_from_names and calls to image_from_planar.
77 */
78 uint32_t strides[3];
79 uint32_t offsets[3];
80 struct intel_image_format *planar_format;
81
82 /* particular miptree level */
83 GLuint width;
84 GLuint height;
85 GLuint tile_x;
86 GLuint tile_y;
87 bool has_depthstencil;
88
89 /**
90 * Provided by EGL_EXT_image_dma_buf_import.
91 *
92 * The flag is set in order to restrict the use of the image later on.
93 *
94 * See intel_image_target_texture_2d()
95 */
96 bool dma_buf_imported;
97 enum __DRIYUVColorSpace yuv_color_space;
98 enum __DRISampleRange sample_range;
99 enum __DRIChromaSiting horizontal_siting;
100 enum __DRIChromaSiting vertical_siting;
101
102 void *data;
103 };
104
105 #ifdef __cplusplus
106 }
107 #endif
108
109 #endif