Path: blob/21.2-virgl/src/gallium/winsys/sw/null/null_sw_winsys.c
4573 views
/**************************************************************************1*2* Copyright 2010 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,17* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR18* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE19* USE OR OTHER DEALINGS IN THE SOFTWARE.20*21* The above copyright notice and this permission notice (including the22* next paragraph) shall be included in all copies or substantial portions23* of the Software.24*25**************************************************************************/2627/**28* @file29* Null software rasterizer winsys.30*31* There is no present support. Framebuffer data needs to be obtained via32* transfers.33*34* @author Jose Fonseca35*/3637#include <stdio.h>3839#include "pipe/p_format.h"40#include "util/u_memory.h"41#include "frontend/sw_winsys.h"42#include "null_sw_winsys.h"434445static bool46null_sw_is_displaytarget_format_supported(struct sw_winsys *ws,47unsigned tex_usage,48enum pipe_format format )49{50return false;51}525354static void *55null_sw_displaytarget_map(struct sw_winsys *ws,56struct sw_displaytarget *dt,57unsigned flags )58{59assert(0);60return NULL;61}626364static void65null_sw_displaytarget_unmap(struct sw_winsys *ws,66struct sw_displaytarget *dt )67{68assert(0);69}707172static void73null_sw_displaytarget_destroy(struct sw_winsys *winsys,74struct sw_displaytarget *dt)75{76assert(0);77}787980static struct sw_displaytarget *81null_sw_displaytarget_create(struct sw_winsys *winsys,82unsigned tex_usage,83enum pipe_format format,84unsigned width, unsigned height,85unsigned alignment,86const void *front_private,87unsigned *stride)88{89fprintf(stderr, "null_sw_displaytarget_create() returning NULL\n");90return NULL;91}929394static struct sw_displaytarget *95null_sw_displaytarget_from_handle(struct sw_winsys *winsys,96const struct pipe_resource *templat,97struct winsys_handle *whandle,98unsigned *stride)99{100return NULL;101}102103104static bool105null_sw_displaytarget_get_handle(struct sw_winsys *winsys,106struct sw_displaytarget *dt,107struct winsys_handle *whandle)108{109assert(0);110return false;111}112113114static void115null_sw_displaytarget_display(struct sw_winsys *winsys,116struct sw_displaytarget *dt,117void *context_private,118struct pipe_box *box)119{120assert(0);121}122123124static void125null_sw_destroy(struct sw_winsys *winsys)126{127FREE(winsys);128}129130131struct sw_winsys *132null_sw_create(void)133{134static struct sw_winsys *winsys;135136winsys = CALLOC_STRUCT(sw_winsys);137if (!winsys)138return NULL;139140winsys->destroy = null_sw_destroy;141winsys->is_displaytarget_format_supported = null_sw_is_displaytarget_format_supported;142winsys->displaytarget_create = null_sw_displaytarget_create;143winsys->displaytarget_from_handle = null_sw_displaytarget_from_handle;144winsys->displaytarget_get_handle = null_sw_displaytarget_get_handle;145winsys->displaytarget_map = null_sw_displaytarget_map;146winsys->displaytarget_unmap = null_sw_displaytarget_unmap;147winsys->displaytarget_display = null_sw_displaytarget_display;148winsys->displaytarget_destroy = null_sw_displaytarget_destroy;149150return winsys;151}152153154