16173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */ 26173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 36173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark/* 46173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * Copyright (C) 2012 Rob Clark <robclark@freedesktop.org> 56173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * 66173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * Permission is hereby granted, free of charge, to any person obtaining a 76173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * copy of this software and associated documentation files (the "Software"), 86173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * to deal in the Software without restriction, including without limitation 96173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * the rights to use, copy, modify, merge, publish, distribute, sublicense, 106173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * and/or sell copies of the Software, and to permit persons to whom the 116173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * Software is furnished to do so, subject to the following conditions: 126173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * 136173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * The above copyright notice and this permission notice (including the next 146173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * paragraph) shall be included in all copies or substantial portions of the 156173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * Software. 166173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * 176173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 186173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 196173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 206173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 216173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 226173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 236173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * SOFTWARE. 246173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * 256173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * Authors: 266173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark * Rob Clark <robclark@freedesktop.org> 276173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark */ 286173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 296173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark#ifndef FREEDRENO_SURFACE_H_ 306173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark#define FREEDRENO_SURFACE_H_ 316173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 326173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark#include "pipe/p_state.h" 336173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 346173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clarkstruct fd_surface { 356173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark struct pipe_surface base; 366173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark uint32_t offset; 376173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark uint32_t pitch; 386173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark uint32_t width; 396173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark uint16_t height; 406173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark uint16_t depth; 416173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark}; 426173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 43a2a1a5805fd617e7f3cc8be44dd79b50da07ebb9Ilia Mirkinstatic inline struct fd_surface * 446173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clarkfd_surface(struct pipe_surface *psurf) 456173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark{ 466173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark return (struct fd_surface *)psurf; 476173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark} 486173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 496173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clarkstruct pipe_surface* fd_create_surface(struct pipe_context *pctx, 506173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark struct pipe_resource *ptex, 516173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark const struct pipe_surface *surf_tmpl); 526173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clarkvoid fd_surface_destroy(struct pipe_context *pctx, struct pipe_surface *psurf); 536173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark 546173cc19c45d92ef0b7bc6aa008aa89bb29abbdaRob Clark#endif /* FREEDRENO_SURFACE_H_ */ 55