gallium/drm: Deduplicate screen creation for the dynamic (clover) pipe loader.

We can just reuse drm_helper.h, which has either the real code or the stub
for all pipe_screens based on the GALLIUM_* driver defines, and the
dynamic pipe loader's .c build will only define one GALLIUM_* driver
define.  The remaining stubs should get GCed by the linker.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6751>
This commit is contained in:
Eric Anholt 2020-09-16 08:54:12 -07:00
parent 472a20c5fc
commit 9ec28b8d22
8 changed files with 14 additions and 114 deletions

View File

@ -4,24 +4,5 @@
#include "i915/drm/i915_drm_public.h"
#include "i915/i915_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct i915_winsys *iws;
struct pipe_screen *screen;
iws = i915_drm_winsys_create(fd);
if (!iws)
return NULL;
screen = i915_screen_create(iws);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("i915", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("i915", NULL, pipe_i915_create_screen)

View File

@ -3,19 +3,5 @@
#include "frontend/drm_driver.h"
#include "kmsro/drm/kmsro_drm_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
screen = kmsro_drm_screen_create(fd, config);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("kmsro", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("kmsro", NULL, pipe_kmsro_create_screen)

View File

@ -1,21 +1,8 @@
#include "target-helpers/drm_helper.h"
#include "target-helpers/inline_debug_helper.h"
#include "frontend/drm_driver.h"
#include "freedreno/drm/freedreno_drm_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
screen = fd_drm_screen_create(fd, NULL);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("msm", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("msm", NULL, pipe_freedreno_create_screen)

View File

@ -1,21 +1,8 @@
#include "target-helpers/drm_helper.h"
#include "target-helpers/inline_debug_helper.h"
#include "frontend/drm_driver.h"
#include "nouveau/drm/nouveau_drm_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
screen = nouveau_drm_screen_create(fd);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("nouveau", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("nouveau", NULL, pipe_nouveau_create_screen)

View File

@ -1,17 +1,9 @@
#include "target-helpers/drm_helper.h"
#include "target-helpers/inline_debug_helper.h"
#include "frontend/drm_driver.h"
#include "radeon/drm/radeon_drm_public.h"
#include "radeon/radeon_winsys.h"
#include "r300/r300_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *sws;
sws = radeon_drm_winsys_create(fd, config, r300_screen_create);
return sws ? debug_screen_wrap(sws->screen) : NULL;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("r300", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("r300", NULL, pipe_r300_create_screen)

View File

@ -1,17 +1,9 @@
#include "frontend/drm_driver.h"
#include "target-helpers/drm_helper.h"
#include "target-helpers/inline_debug_helper.h"
#include "radeon/drm/radeon_drm_public.h"
#include "radeon/radeon_winsys.h"
#include "r600/r600_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct radeon_winsys *rw;
rw = radeon_drm_winsys_create(fd, config, r600_screen_create);
return rw ? debug_screen_wrap(rw->screen) : NULL;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("r600", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("r600", NULL, pipe_r600_create_screen)

View File

@ -1,19 +1,12 @@
#include "frontend/drm_driver.h"
#include "target-helpers/drm_helper.h"
#include "target-helpers/inline_debug_helper.h"
#include "radeonsi/si_public.h"
#include "util/driconf.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen = radeonsi_screen_create(fd, config);
return screen ? debug_screen_wrap(screen) : NULL;
}
static const char *driconf_xml =
#include "radeonsi/si_driinfo.h"
;
PUBLIC
DRM_DRIVER_DESCRIPTOR("radeonsi", &driconf_xml, create_screen)
DRM_DRIVER_DESCRIPTOR("radeonsi", &driconf_xml, pipe_radeonsi_create_screen)

View File

@ -1,27 +1,9 @@
#include "target-helpers/inline_debug_helper.h"
#include "target-helpers/drm_helper.h"
#include "frontend/drm_driver.h"
#include "svga/drm/svga_drm_public.h"
#include "svga/svga_public.h"
static struct pipe_screen *
create_screen(int fd, const struct pipe_screen_config *config)
{
struct svga_winsys_screen *sws;
struct pipe_screen *screen;
sws = svga_drm_winsys_screen_create(fd);
if (!sws)
return NULL;
screen = svga_screen_create(sws);
if (!screen)
return NULL;
screen = debug_screen_wrap(screen);
return screen;
}
PUBLIC
DRM_DRIVER_DESCRIPTOR("vmwgfx", NULL, create_screen)
DRM_DRIVER_DESCRIPTOR("vmwgfx", NULL, pipe_vmwgfx_create_screen)