st/dri: merge dri/drm and dri/sw backends

Move the driver_name to dri2/drisw and remove all the SPLIT_TAGETS
mayhem. In the next step we'll unify the dri and dri-swrast targets,
completing the gallium DRI megadriver.

v2: Remove leftover st/dri Makefiles from CONFIG_FILES. Spotted by
Thomas Helland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
Emil Velikov 2014-06-17 14:34:52 +01:00
parent f6483aa694
commit 29ca7d2c94
30 changed files with 96 additions and 194 deletions

View File

@ -2189,8 +2189,6 @@ AC_CONFIG_FILES([Makefile
src/gallium/state_trackers/Makefile src/gallium/state_trackers/Makefile
src/gallium/state_trackers/clover/Makefile src/gallium/state_trackers/clover/Makefile
src/gallium/state_trackers/dri/Makefile src/gallium/state_trackers/dri/Makefile
src/gallium/state_trackers/dri/drm/Makefile
src/gallium/state_trackers/dri/sw/Makefile
src/gallium/state_trackers/egl/Makefile src/gallium/state_trackers/egl/Makefile
src/gallium/state_trackers/gbm/Makefile src/gallium/state_trackers/gbm/Makefile
src/gallium/state_trackers/glx/xlib/Makefile src/gallium/state_trackers/glx/xlib/Makefile

View File

@ -28,7 +28,7 @@ GALLIUM_DRIVER_CXXFLAGS = \
GALLIUM_DRI_CFLAGS = \ GALLIUM_DRI_CFLAGS = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/state_trackers/dri/common \ -I$(top_srcdir)/src/gallium/state_trackers/dri \
-I$(top_srcdir)/src/mesa/drivers/dri/common \ -I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_srcdir)/src/gallium/include \ -I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \ -I$(top_srcdir)/src/gallium/auxiliary \

View File

@ -1,4 +1,5 @@
# Copyright © 2012 Intel Corporation # Copyright © 2012 Intel Corporation
# Copyright © 2014 Emil Velikov
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), # copy of this software and associated documentation files (the "Software"),
@ -20,12 +21,39 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
SUBDIRS = include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/gallium/state_trackers/dri/common \
-I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_builddir)/src/mesa/drivers/dri/common \
$(GALLIUM_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
if HAVE_GALLIUM_STATIC_TARGETS
AM_CPPFLAGS += \
-DGALLIUM_STATIC_TARGETS=1
endif # HAVE_GALLIUM_STATIC_TARGETS
noinst_LTLIBRARIES = libdri.la
libdri_la_SOURCES = $(common_SOURCES)
if HAVE_DRISW if HAVE_DRISW
SUBDIRS += sw if !HAVE_DRI2
AM_CPPFLAGS += \
-D__NOT_HAVE_DRM_H
endif
libdri_la_SOURCES += $(drisw_SOURCES)
endif endif
if HAVE_LIBDRM
SUBDIRS += drm if HAVE_DRI2
libdri_la_SOURCES += $(dri2_SOURCES)
endif endif

View File

@ -0,0 +1,14 @@
common_SOURCES := \
dri_context.c \
dri_context.h \
dri_drawable.c \
dri_drawable.h \
dri_screen.c \
dri_screen.h
dri2_SOURCES := \
dri2.c \
dri2_buffer.h
drisw_SOURCES := \
drisw.c

View File

@ -1,6 +1,35 @@
#######################################################################
# SConscript for dri state_tracker
Import('*') Import('*')
SConscript([ env = env.Clone()
'sw/SConscript',
'drm/SConscript', # XXX: If HAVE_DRI2
env.PkgUseModules(['DRM'])
# else
#env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')])
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/gallium/state_trackers/dri/common',
'#/src/mesa/drivers/dri/common',
xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
]) ])
env.Append(CPPDEFINES = [('GALLIUM_STATIC_TARGETS', '1')])
sources = env.ParseSourceList('Makefile.sources', 'common_SOURCES')
# XXX: if HAVE_DRISW
sources.append(env.ParseSourceList('Makefile.sources', 'drisw_SOURCES'))
# XXX: if HAVE_DRI2
sources.append(env.ParseSourceList('Makefile.sources', 'dri2_SOURCES'))
st_dri = env.ConvenienceLibrary(
target = 'st_dri',
source = sources
)
Export('st_dri')

View File

@ -1241,14 +1241,6 @@ dri2_init_screen(__DRIscreen * sPriv)
sPriv->driverPrivate = (void *)screen; sPriv->driverPrivate = (void *)screen;
#if SPLIT_TARGETS
pscreen = driver_descriptor.create_screen(screen->fd);
if (driver_descriptor.configuration) {
throttle_ret = driver_descriptor.configuration(DRM_CONF_THROTTLE);
dmabuf_ret = driver_descriptor.configuration(DRM_CONF_SHARE_FD);
}
#else
#if GALLIUM_STATIC_TARGETS #if GALLIUM_STATIC_TARGETS
pscreen = dd_create_screen(screen->fd); pscreen = dd_create_screen(screen->fd);
@ -1262,7 +1254,6 @@ dri2_init_screen(__DRIscreen * sPriv)
dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD); dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
} }
#endif // GALLIUM_STATIC_TARGETS #endif // GALLIUM_STATIC_TARGETS
#endif // SPLIT_TARGETS
if (throttle_ret && throttle_ret->val.val_int != -1) { if (throttle_ret && throttle_ret->val.val_int != -1) {
screen->throttling_enabled = TRUE; screen->throttling_enabled = TRUE;
@ -1283,7 +1274,11 @@ dri2_init_screen(__DRIscreen * sPriv)
/* dri_init_screen_helper checks pscreen for us */ /* dri_init_screen_helper checks pscreen for us */
configs = dri_init_screen_helper(screen, pscreen); #if GALLIUM_STATIC_TARGETS
configs = dri_init_screen_helper(screen, pscreen, dd_driver_name());
#else
configs = dri_init_screen_helper(screen, pscreen, screen->dev->driver_name);
#endif // GALLIUM_STATIC_TARGETS
if (!configs) if (!configs)
goto fail; goto fail;
@ -1294,12 +1289,10 @@ dri2_init_screen(__DRIscreen * sPriv)
return configs; return configs;
fail: fail:
dri_destroy_screen_helper(screen); dri_destroy_screen_helper(screen);
#if !SPLIT_TARGETS
#if !GALLIUM_STATIC_TARGETS #if !GALLIUM_STATIC_TARGETS
if (screen->dev) if (screen->dev)
pipe_loader_release(&screen->dev, 1); pipe_loader_release(&screen->dev, 1);
#endif // !GALLIUM_STATIC_TARGETS #endif // !GALLIUM_STATIC_TARGETS
#endif // !SPLIT_TARGETS
FREE(screen); FREE(screen);
return NULL; return NULL;
} }

View File

@ -388,11 +388,9 @@ dri_destroy_screen(__DRIscreen * sPriv)
dri_destroy_screen_helper(screen); dri_destroy_screen_helper(screen);
#if !SPLIT_TARGETS
#if !GALLIUM_STATIC_TARGETS #if !GALLIUM_STATIC_TARGETS
pipe_loader_release(&screen->dev, 1); pipe_loader_release(&screen->dev, 1);
#endif // !GALLIUM_STATIC_TARGETS #endif // !GALLIUM_STATIC_TARGETS
#endif // !SPLIT_TARGETS
free(screen); free(screen);
sPriv->driverPrivate = NULL; sPriv->driverPrivate = NULL;
@ -412,7 +410,8 @@ dri_postprocessing_init(struct dri_screen *screen)
const __DRIconfig ** const __DRIconfig **
dri_init_screen_helper(struct dri_screen *screen, dri_init_screen_helper(struct dri_screen *screen,
struct pipe_screen *pscreen) struct pipe_screen *pscreen,
const char* driver_name)
{ {
screen->base.screen = pscreen; screen->base.screen = pscreen;
if (!screen->base.screen) { if (!screen->base.screen) {
@ -437,15 +436,7 @@ dri_init_screen_helper(struct dri_screen *screen,
driParseConfigFiles(&screen->optionCache, driParseConfigFiles(&screen->optionCache,
&screen->optionCacheDefaults, &screen->optionCacheDefaults,
screen->sPriv->myNum, screen->sPriv->myNum,
#if SPLIT_TARGETS driver_name);
driver_descriptor.name);
#else
#if GALLIUM_STATIC_TARGETS
dd_driver_name());
#else
screen->dev->driver_name);
#endif // GALLIUM_STATIC_TARGETS
#endif // SPLIT_TARGETS
/* Handle force_s3tc_enable. */ /* Handle force_s3tc_enable. */
if (!util_format_s3tc_enabled && if (!util_format_s3tc_enabled &&

View File

@ -137,7 +137,8 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
const __DRIconfig ** const __DRIconfig **
dri_init_screen_helper(struct dri_screen *screen, dri_init_screen_helper(struct dri_screen *screen,
struct pipe_screen *pscreen); struct pipe_screen *pscreen,
const char* driver_name);
void void
dri_destroy_screen_helper(struct dri_screen * screen); dri_destroy_screen_helper(struct dri_screen * screen);

View File

@ -361,7 +361,7 @@ drisw_init_screen(__DRIscreen * sPriv)
pscreen = drisw_create_screen(&drisw_lf); pscreen = drisw_create_screen(&drisw_lf);
/* dri_init_screen_helper checks pscreen for us */ /* dri_init_screen_helper checks pscreen for us */
configs = dri_init_screen_helper(screen, pscreen); configs = dri_init_screen_helper(screen, pscreen, "swrast");
if (!configs) if (!configs)
goto fail; goto fail;

View File

@ -1,46 +0,0 @@
# Copyright © 2012 Intel Corporation
#
# 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, sublicense,
# 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
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS 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 Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/gallium/state_trackers/dri/common \
-I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_builddir)/src/mesa/drivers/dri/common \
$(GALLIUM_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
if HAVE_GALLIUM_STATIC_TARGETS
AM_CPPFLAGS += \
-DGALLIUM_STATIC_TARGETS=1
endif # HAVE_GALLIUM_STATIC_TARGETS
noinst_LTLIBRARIES = libdridrm.la
libdridrm_la_SOURCES = $(C_SOURCES)

View File

@ -1,5 +0,0 @@
C_SOURCES := \
dri_context.c \
dri_screen.c \
dri_drawable.c \
dri2.c

View File

@ -1,24 +0,0 @@
#######################################################################
# SConscript for dri state_tracker
Import('*')
env = env.Clone()
env.PkgUseModules(['DRM'])
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/gallium/state_trackers/dri/common',
'#/src/mesa/drivers/dri/common',
xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
])
env.Append(CPPDEFINES = [('GALLIUM_STATIC_TARGETS', '1')])
st_dri = env.ConvenienceLibrary(
target = 'st_dri',
source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
)
Export('st_dri')

View File

@ -1 +0,0 @@
../common/dri_context.c

View File

@ -1 +0,0 @@
../common/dri_drawable.c

View File

@ -1 +0,0 @@
../common/dri_screen.c

View File

@ -1,42 +0,0 @@
# Copyright © 2012 Intel Corporation
#
# 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, sublicense,
# 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
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS 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 Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \
$(GALLIUM_PIPE_LOADER_DEFINES) \
-DPIPE_SEARCH_DIR=\"$(libdir)/gallium-pipe\" \
-DSPLIT_TARGETS=1 \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/gallium/state_trackers/dri/common \
-I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_builddir)/src/mesa/drivers/dri/common \
$(GALLIUM_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS) \
-D__NOT_HAVE_DRM_H
noinst_LTLIBRARIES = libdrisw.la
libdrisw_la_SOURCES = $(C_SOURCES)

View File

@ -1,5 +0,0 @@
C_SOURCES := \
dri_context.c \
dri_screen.c \
dri_drawable.c \
drisw.c

View File

@ -1,23 +0,0 @@
#######################################################################
# SConscript for dri state_tracker
Import('*')
env = env.Clone()
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
'#/src/gallium/state_trackers/dri/common',
'#/src/mesa/drivers/dri/common',
xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
])
env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')])
env.Append(CPPDEFINES = [('SPLIT_TARGETS', '1')])
st_drisw = env.ConvenienceLibrary(
target = 'st_drisw',
source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
)
Export('st_drisw')

View File

@ -1 +0,0 @@
../common/dri_context.c

View File

@ -1 +0,0 @@
../common/dri_drawable.c

View File

@ -1 +0,0 @@
../common/dri_screen.c

View File

@ -40,7 +40,7 @@ swrast_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
swrast_dri_la_LIBADD = \ swrast_dri_la_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \ $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \ $(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \
$(top_builddir)/src/gallium/state_trackers/dri/sw/libdrisw.la \ $(top_builddir)/src/gallium/state_trackers/dri/libdri.la \
$(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \ $(top_builddir)/src/gallium/winsys/sw/dri/libswdri.la \
$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \ $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \ $(top_builddir)/src/gallium/drivers/trace/libtrace.la \

View File

@ -7,11 +7,11 @@ env.Append(CPPPATH = [
'#/src/mapi', '#/src/mapi',
'#/src/mesa', '#/src/mesa',
'#/src/mesa/drivers/dri/common', '#/src/mesa/drivers/dri/common',
'#/src/gallium/state_trackers/dri/common', '#/src/gallium/state_trackers/dri',
]) ])
env.Prepend(LIBS = [ env.Prepend(LIBS = [
st_drisw, st_dri,
ws_dri, ws_dri,
trace, trace,
rbug, rbug,

View File

@ -4,7 +4,7 @@ AM_CFLAGS = \
-I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa \ -I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/mesa/drivers/dri/common \ -I$(top_srcdir)/src/mesa/drivers/dri/common \
-I$(top_srcdir)/src/gallium/state_trackers/dri/common \ -I$(top_srcdir)/src/gallium/state_trackers/dri \
$(GALLIUM_TARGET_CFLAGS) $(GALLIUM_TARGET_CFLAGS)
AM_CPPFLAGS = \ AM_CPPFLAGS = \
@ -33,12 +33,11 @@ gallium_dri_la_LDFLAGS += \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym -Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
endif # HAVE_LD_VERSION_SCRIPT endif # HAVE_LD_VERSION_SCRIPT
# XXX: Fold libdridrm/libdrisw as drivers become megadriver (__dri*DriverExtension) aware
gallium_dri_la_LIBADD = \ gallium_dri_la_LIBADD = \
$(top_builddir)/src/mesa/libmesagallium.la \ $(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \ $(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
$(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \ $(top_builddir)/src/mesa/drivers/dri/common/libmegadriver_stub.la \
$(top_builddir)/src/gallium/state_trackers/dri/drm/libdridrm.la \ $(top_builddir)/src/gallium/state_trackers/dri/libdri.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \ $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \ $(top_builddir)/src/gallium/drivers/galahad/libgalahad.la \
$(top_builddir)/src/gallium/drivers/noop/libnoop.la \ $(top_builddir)/src/gallium/drivers/noop/libnoop.la \

View File

@ -11,7 +11,7 @@ env.Append(CPPPATH = [
'#/src/mapi', '#/src/mapi',
'#/src/mesa', '#/src/mesa',
'#/src/mesa/drivers/dri/common', '#/src/mesa/drivers/dri/common',
'#/src/gallium/state_trackers/dri/common', '#/src/gallium/state_trackers/dri',
]) ])
if env['build'] == 'release': if env['build'] == 'release':