mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
gallium: Remove drm_api and all references to it
This commit is contained in:
parent
92fde20de3
commit
e47d32d721
11 changed files with 1 additions and 373 deletions
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* This file contain a small backwards compatible shim between
|
||||
* the old depricated drm_api and the drm_driver interface.
|
||||
*/
|
||||
|
||||
#ifndef DRM_API_COMPAT_H
|
||||
#define DRM_API_COMPAT_H
|
||||
|
||||
#ifdef _DRM_API_H_
|
||||
#error "Included drm_api.h before drm_api_compat.h"
|
||||
#endif
|
||||
|
||||
#include "state_tracker/drm_driver.h"
|
||||
|
||||
/*
|
||||
* XXX Hack, can't include both drm_api and drm_driver. Due to name
|
||||
* collition of winsys_handle, just use a define to rename it.
|
||||
*/
|
||||
#define winsys_handle HACK_winsys_handle
|
||||
#include "state_tracker/drm_api.h"
|
||||
#undef winsys_handle
|
||||
|
||||
static INLINE struct pipe_screen *
|
||||
drm_api_compat_create_screen(int fd)
|
||||
{
|
||||
static struct drm_api *api;
|
||||
if (!api)
|
||||
api = drm_api_create();
|
||||
|
||||
if (!api)
|
||||
return NULL;
|
||||
|
||||
return api->create_screen(api, fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instanciate a drm_driver descriptor.
|
||||
*/
|
||||
#define DRM_API_COMPAT_STRUCT(name_str, driver_name_str) \
|
||||
struct drm_driver_descriptor driver_descriptor = { \
|
||||
.name = name_str, \
|
||||
.driver_name = driver_name_str, \
|
||||
.create_screen = drm_api_compat_create_screen, \
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -6,7 +6,6 @@ LIBNAME = identity
|
|||
C_SOURCES = \
|
||||
id_objects.c \
|
||||
id_context.c \
|
||||
id_screen.c \
|
||||
id_drm.c
|
||||
id_screen.c
|
||||
|
||||
include ../../Makefile.template
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ identity = env.ConvenienceLibrary(
|
|||
target = 'identity',
|
||||
source = [
|
||||
'id_context.c',
|
||||
'id_drm.c',
|
||||
'id_objects.c',
|
||||
'id_screen.c',
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,93 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "state_tracker/drm_api.h"
|
||||
|
||||
#include "util/u_memory.h"
|
||||
#include "id_drm.h"
|
||||
#include "id_screen.h"
|
||||
#include "id_public.h"
|
||||
|
||||
struct identity_drm_api
|
||||
{
|
||||
struct drm_api base;
|
||||
|
||||
struct drm_api *api;
|
||||
};
|
||||
|
||||
static INLINE struct identity_drm_api *
|
||||
identity_drm_api(struct drm_api *_api)
|
||||
{
|
||||
return (struct identity_drm_api *)_api;
|
||||
}
|
||||
|
||||
static struct pipe_screen *
|
||||
identity_drm_create_screen(struct drm_api *_api, int fd)
|
||||
{
|
||||
struct identity_drm_api *id_api = identity_drm_api(_api);
|
||||
struct drm_api *api = id_api->api;
|
||||
struct pipe_screen *screen;
|
||||
|
||||
screen = api->create_screen(api, fd);
|
||||
|
||||
return identity_screen_create(screen);
|
||||
}
|
||||
|
||||
static void
|
||||
identity_drm_destroy(struct drm_api *_api)
|
||||
{
|
||||
struct identity_drm_api *id_api = identity_drm_api(_api);
|
||||
struct drm_api *api = id_api->api;
|
||||
api->destroy(api);
|
||||
|
||||
FREE(id_api);
|
||||
}
|
||||
|
||||
struct drm_api *
|
||||
identity_drm_create(struct drm_api *api)
|
||||
{
|
||||
struct identity_drm_api *id_api;
|
||||
|
||||
if (!api)
|
||||
goto error;
|
||||
|
||||
id_api = CALLOC_STRUCT(identity_drm_api);
|
||||
|
||||
if (!id_api)
|
||||
goto error;
|
||||
|
||||
id_api->base.name = api->name;
|
||||
id_api->base.driver_name = api->driver_name;
|
||||
id_api->base.create_screen = identity_drm_create_screen;
|
||||
id_api->base.destroy = identity_drm_destroy;
|
||||
id_api->api = api;
|
||||
|
||||
return &id_api->base;
|
||||
|
||||
error:
|
||||
return api;
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef ID_DRM_H
|
||||
#define ID_DRM_H
|
||||
|
||||
struct drm_api;
|
||||
|
||||
struct drm_api* identity_drm_create(struct drm_api *api);
|
||||
|
||||
#endif /* ID_DRM_H */
|
||||
|
|
@ -8,7 +8,6 @@ C_SOURCES = \
|
|||
tr_dump.c \
|
||||
tr_dump_state.c \
|
||||
tr_screen.c \
|
||||
tr_drm.c \
|
||||
tr_texture.c
|
||||
|
||||
include ../../Makefile.template
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ trace = env.ConvenienceLibrary(
|
|||
target = 'trace',
|
||||
source = [
|
||||
'tr_context.c',
|
||||
'tr_drm.c',
|
||||
'tr_dump.c',
|
||||
'tr_dump_state.c',
|
||||
'tr_screen.c',
|
||||
|
|
|
|||
|
|
@ -1,101 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "state_tracker/drm_api.h"
|
||||
|
||||
#include "util/u_memory.h"
|
||||
#include "rbug/rbug_public.h"
|
||||
#include "tr_drm.h"
|
||||
#include "tr_screen.h"
|
||||
#include "tr_public.h"
|
||||
|
||||
struct trace_drm_api
|
||||
{
|
||||
struct drm_api base;
|
||||
|
||||
struct drm_api *api;
|
||||
};
|
||||
|
||||
static INLINE struct trace_drm_api *
|
||||
trace_drm_api(struct drm_api *_api)
|
||||
{
|
||||
return (struct trace_drm_api *)_api;
|
||||
}
|
||||
|
||||
static struct pipe_screen *
|
||||
trace_drm_create_screen(struct drm_api *_api, int fd)
|
||||
{
|
||||
struct trace_drm_api *tr_api = trace_drm_api(_api);
|
||||
struct drm_api *api = tr_api->api;
|
||||
struct pipe_screen *screen;
|
||||
|
||||
/* TODO trace call */
|
||||
|
||||
screen = api->create_screen(api, fd);
|
||||
|
||||
return trace_screen_create(rbug_screen_create(screen));
|
||||
}
|
||||
|
||||
static void
|
||||
trace_drm_destroy(struct drm_api *_api)
|
||||
{
|
||||
struct trace_drm_api *tr_api = trace_drm_api(_api);
|
||||
struct drm_api *api = tr_api->api;
|
||||
|
||||
if (api->destroy)
|
||||
api->destroy(api);
|
||||
|
||||
FREE(tr_api);
|
||||
}
|
||||
|
||||
struct drm_api *
|
||||
trace_drm_create(struct drm_api *api)
|
||||
{
|
||||
struct trace_drm_api *tr_api;
|
||||
|
||||
if (!api)
|
||||
goto error;
|
||||
|
||||
if (!trace_enabled() && !rbug_enabled())
|
||||
goto error;
|
||||
|
||||
tr_api = CALLOC_STRUCT(trace_drm_api);
|
||||
|
||||
if (!tr_api)
|
||||
goto error;
|
||||
|
||||
tr_api->base.name = api->name;
|
||||
tr_api->base.driver_name = api->driver_name;
|
||||
tr_api->base.create_screen = trace_drm_create_screen;
|
||||
tr_api->base.destroy = trace_drm_destroy;
|
||||
tr_api->api = api;
|
||||
|
||||
return &tr_api->base;
|
||||
|
||||
error:
|
||||
return api;
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef TR_DRM_H
|
||||
#define TR_DRM_H
|
||||
|
||||
struct drm_api;
|
||||
|
||||
struct drm_api* trace_drm_create(struct drm_api *api);
|
||||
|
||||
#endif /* ID_DRM_H */
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
|
||||
#ifndef _DRM_API_H_
|
||||
#define _DRM_API_H_
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
struct pipe_screen;
|
||||
struct pipe_winsys;
|
||||
struct pipe_context;
|
||||
struct pipe_resource;
|
||||
|
||||
#define DRM_API_HANDLE_TYPE_SHARED 0
|
||||
#define DRM_API_HANDLE_TYPE_KMS 1
|
||||
|
||||
/**
|
||||
* For use with pipe_screen::{texture_from_handle|texture_get_handle}.
|
||||
*/
|
||||
struct winsys_handle
|
||||
{
|
||||
/**
|
||||
* Unused for texture_from_handle, always
|
||||
* DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle,
|
||||
* use TEXTURE_USAGE to select handle for kms or ipc.
|
||||
*/
|
||||
unsigned type;
|
||||
/**
|
||||
* Input to texture_from_handle.
|
||||
* Output for texture_get_handle.
|
||||
*/
|
||||
unsigned handle;
|
||||
/**
|
||||
* Input to texture_from_handle.
|
||||
* Output for texture_get_handle.
|
||||
*/
|
||||
unsigned stride;
|
||||
};
|
||||
|
||||
struct drm_api
|
||||
{
|
||||
void (*destroy)(struct drm_api *api);
|
||||
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
* Kernel driver name, as accepted by drmOpenByName.
|
||||
*/
|
||||
const char *driver_name;
|
||||
|
||||
/**
|
||||
* Create a pipe srcreen.
|
||||
*/
|
||||
struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd);
|
||||
};
|
||||
|
||||
extern struct drm_api * drm_api_create(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "state_tracker/drm_api.h"
|
||||
#include "state_tracker/sw_winsys.h"
|
||||
#include "dri_sw_winsys.h"
|
||||
#include "trace/tr_public.h"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue