1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 3bf215546Sopenharmony_ci * 4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 5bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 6bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 7bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the 9bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions: 10bf215546Sopenharmony_ci * 11bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included 12bf215546Sopenharmony_ci * in all copies or substantial portions of the Software. 13bf215546Sopenharmony_ci * 14bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE. 21bf215546Sopenharmony_ci */ 22bf215546Sopenharmony_ci 23bf215546Sopenharmony_ci#ifndef DRI_HELPERS_H 24bf215546Sopenharmony_ci#define DRI_HELPERS_H 25bf215546Sopenharmony_ci 26bf215546Sopenharmony_ci#include "dri_context.h" 27bf215546Sopenharmony_ci#include "dri_screen.h" 28bf215546Sopenharmony_ci 29bf215546Sopenharmony_ci 30bf215546Sopenharmony_cistruct dri2_format_mapping { 31bf215546Sopenharmony_ci int dri_fourcc; 32bf215546Sopenharmony_ci int dri_format; /* image format */ 33bf215546Sopenharmony_ci int dri_components; 34bf215546Sopenharmony_ci enum pipe_format pipe_format; 35bf215546Sopenharmony_ci int nplanes; 36bf215546Sopenharmony_ci struct { 37bf215546Sopenharmony_ci int buffer_index; 38bf215546Sopenharmony_ci int width_shift; 39bf215546Sopenharmony_ci int height_shift; 40bf215546Sopenharmony_ci uint32_t dri_format; /* plane format */ 41bf215546Sopenharmony_ci } planes[3]; 42bf215546Sopenharmony_ci}; 43bf215546Sopenharmony_ci 44bf215546Sopenharmony_ciextern const __DRI2fenceExtension dri2FenceExtension; 45bf215546Sopenharmony_ci 46bf215546Sopenharmony_ciconst struct dri2_format_mapping * 47bf215546Sopenharmony_cidri2_get_mapping_by_fourcc(int fourcc); 48bf215546Sopenharmony_ci 49bf215546Sopenharmony_ciconst struct dri2_format_mapping * 50bf215546Sopenharmony_cidri2_get_mapping_by_format(int format); 51bf215546Sopenharmony_ci 52bf215546Sopenharmony_cienum pipe_format 53bf215546Sopenharmony_cidri2_get_pipe_format_for_dri_format(int format); 54bf215546Sopenharmony_ci 55bf215546Sopenharmony_ciboolean 56bf215546Sopenharmony_cidri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats, 57bf215546Sopenharmony_ci int *count); 58bf215546Sopenharmony_ciboolean 59bf215546Sopenharmony_cidri2_yuv_dma_buf_supported(struct dri_screen *screen, 60bf215546Sopenharmony_ci const struct dri2_format_mapping *map); 61bf215546Sopenharmony_ci 62bf215546Sopenharmony_ci__DRIimage * 63bf215546Sopenharmony_cidri2_lookup_egl_image(struct dri_screen *screen, void *handle); 64bf215546Sopenharmony_ci 65bf215546Sopenharmony_ciboolean 66bf215546Sopenharmony_cidri2_validate_egl_image(struct dri_screen *screen, void *handle); 67bf215546Sopenharmony_ci 68bf215546Sopenharmony_ci__DRIimage * 69bf215546Sopenharmony_cidri2_lookup_egl_image_validated(struct dri_screen *screen, void *handle); 70bf215546Sopenharmony_ci 71bf215546Sopenharmony_ci__DRIimage * 72bf215546Sopenharmony_cidri2_create_image_from_renderbuffer(__DRIcontext *context, 73bf215546Sopenharmony_ci int renderbuffer, void *loaderPrivate); 74bf215546Sopenharmony_ci 75bf215546Sopenharmony_ci__DRIimage * 76bf215546Sopenharmony_cidri2_create_image_from_renderbuffer2(__DRIcontext *context, 77bf215546Sopenharmony_ci int renderbuffer, void *loaderPrivate, 78bf215546Sopenharmony_ci unsigned *error); 79bf215546Sopenharmony_ci 80bf215546Sopenharmony_civoid 81bf215546Sopenharmony_cidri2_destroy_image(__DRIimage *img); 82bf215546Sopenharmony_ci 83bf215546Sopenharmony_ci__DRIimage * 84bf215546Sopenharmony_cidri2_create_from_texture(__DRIcontext *context, int target, unsigned texture, 85bf215546Sopenharmony_ci int depth, int level, unsigned *error, 86bf215546Sopenharmony_ci void *loaderPrivate); 87bf215546Sopenharmony_ci#endif 88bf215546Sopenharmony_ci 89bf215546Sopenharmony_ci/* vim: set sw=3 ts=8 sts=3 expandtab: */ 90