Path: blob/21.2-virgl/src/gallium/frontends/dri/dri_helpers.h
4565 views
/*1* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included11* in all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS14* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*/2122#ifndef DRI_HELPERS_H23#define DRI_HELPERS_H2425#include "dri_context.h"26#include "dri_screen.h"272829struct dri2_format_mapping {30int dri_fourcc;31int dri_format; /* image format */32int dri_components;33enum pipe_format pipe_format;34int nplanes;35struct {36int buffer_index;37int width_shift;38int height_shift;39uint32_t dri_format; /* plane format */40} planes[3];41};4243extern const __DRI2fenceExtension dri2FenceExtension;4445const struct dri2_format_mapping *46dri2_get_mapping_by_fourcc(int fourcc);4748const struct dri2_format_mapping *49dri2_get_mapping_by_format(int format);5051enum pipe_format52dri2_get_pipe_format_for_dri_format(int format);5354boolean55dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,56int *count);57boolean58dri2_yuv_dma_buf_supported(struct dri_screen *screen,59const struct dri2_format_mapping *map);6061__DRIimage *62dri2_lookup_egl_image(struct dri_screen *screen, void *handle);6364__DRIimage *65dri2_create_image_from_renderbuffer(__DRIcontext *context,66int renderbuffer, void *loaderPrivate);6768__DRIimage *69dri2_create_image_from_renderbuffer2(__DRIcontext *context,70int renderbuffer, void *loaderPrivate,71unsigned *error);7273void74dri2_destroy_image(__DRIimage *img);7576__DRIimage *77dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture,78int depth, int level, unsigned *error,79void *loaderPrivate);80#endif8182/* vim: set sw=3 ts=8 sts=3 expandtab: */838485