Path: blob/21.2-virgl/src/gallium/auxiliary/driver_rbug/rbug_screen.h
4561 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 above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef RBUG_SCREEN_H28#define RBUG_SCREEN_H2930#include "pipe/p_screen.h"31#include "pipe/p_defines.h"3233#include "os/os_thread.h"3435struct rbug_list {36struct rbug_list *next;37struct rbug_list *prev;38};394041struct rbug_screen42{43struct pipe_screen base;4445struct pipe_screen *screen;46struct pipe_context *private_context;4748/* remote debugger */49struct rbug_rbug *rbug;5051mtx_t list_mutex;52int num_contexts;53int num_resources;54int num_surfaces;55int num_transfers;56struct rbug_list contexts;57struct rbug_list resources;58struct rbug_list surfaces;59struct rbug_list transfers;60};6162static inline struct rbug_screen *63rbug_screen(struct pipe_screen *screen)64{65return (struct rbug_screen *)screen;66}6768#define rbug_screen_add_to_list(scr, name, obj) \69do { \70mtx_lock(&scr->list_mutex); \71insert_at_head(&scr->name, &obj->list); \72scr->num_##name++; \73mtx_unlock(&scr->list_mutex); \74} while (0)7576#define rbug_screen_remove_from_list(scr, name, obj) \77do { \78mtx_lock(&scr->list_mutex); \79remove_from_list(&obj->list); \80scr->num_##name--; \81mtx_unlock(&scr->list_mutex); \82} while (0)83848586/**********************************************************87* rbug_core.c88*/8990struct rbug_rbug;9192struct rbug_rbug *93rbug_start(struct rbug_screen *rb_screen);9495void96rbug_stop(struct rbug_rbug *rbug);979899#endif /* RBUG_SCREEN_H */100101102