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:
parent
f6483aa694
commit
29ca7d2c94
|
@ -2189,8 +2189,6 @@ AC_CONFIG_FILES([Makefile
|
|||
src/gallium/state_trackers/Makefile
|
||||
src/gallium/state_trackers/clover/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/gbm/Makefile
|
||||
src/gallium/state_trackers/glx/xlib/Makefile
|
||||
|
|
|
@ -28,7 +28,7 @@ GALLIUM_DRIVER_CXXFLAGS = \
|
|||
|
||||
GALLIUM_DRI_CFLAGS = \
|
||||
-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/gallium/include \
|
||||
-I$(top_srcdir)/src/gallium/auxiliary \
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# Copyright © 2012 Intel Corporation
|
||||
# Copyright © 2014 Emil Velikov
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# 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
|
||||
# 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
|
||||
SUBDIRS += sw
|
||||
if !HAVE_DRI2
|
||||
AM_CPPFLAGS += \
|
||||
-D__NOT_HAVE_DRM_H
|
||||
endif
|
||||
libdri_la_SOURCES += $(drisw_SOURCES)
|
||||
endif
|
||||
|
||||
if HAVE_LIBDRM
|
||||
SUBDIRS += drm
|
||||
|
||||
if HAVE_DRI2
|
||||
libdri_la_SOURCES += $(dri2_SOURCES)
|
||||
endif
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,35 @@
|
|||
#######################################################################
|
||||
# SConscript for dri state_tracker
|
||||
|
||||
Import('*')
|
||||
|
||||
SConscript([
|
||||
'sw/SConscript',
|
||||
'drm/SConscript',
|
||||
env = env.Clone()
|
||||
|
||||
# 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')
|
||||
|
|
|
@ -1241,14 +1241,6 @@ dri2_init_screen(__DRIscreen * sPriv)
|
|||
|
||||
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
|
||||
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);
|
||||
}
|
||||
#endif // GALLIUM_STATIC_TARGETS
|
||||
#endif // SPLIT_TARGETS
|
||||
|
||||
if (throttle_ret && throttle_ret->val.val_int != -1) {
|
||||
screen->throttling_enabled = TRUE;
|
||||
|
@ -1283,7 +1274,11 @@ dri2_init_screen(__DRIscreen * sPriv)
|
|||
|
||||
/* 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)
|
||||
goto fail;
|
||||
|
||||
|
@ -1294,12 +1289,10 @@ dri2_init_screen(__DRIscreen * sPriv)
|
|||
return configs;
|
||||
fail:
|
||||
dri_destroy_screen_helper(screen);
|
||||
#if !SPLIT_TARGETS
|
||||
#if !GALLIUM_STATIC_TARGETS
|
||||
if (screen->dev)
|
||||
pipe_loader_release(&screen->dev, 1);
|
||||
#endif // !GALLIUM_STATIC_TARGETS
|
||||
#endif // !SPLIT_TARGETS
|
||||
FREE(screen);
|
||||
return NULL;
|
||||
}
|
|
@ -388,11 +388,9 @@ dri_destroy_screen(__DRIscreen * sPriv)
|
|||
|
||||
dri_destroy_screen_helper(screen);
|
||||
|
||||
#if !SPLIT_TARGETS
|
||||
#if !GALLIUM_STATIC_TARGETS
|
||||
pipe_loader_release(&screen->dev, 1);
|
||||
#endif // !GALLIUM_STATIC_TARGETS
|
||||
#endif // !SPLIT_TARGETS
|
||||
|
||||
free(screen);
|
||||
sPriv->driverPrivate = NULL;
|
||||
|
@ -412,7 +410,8 @@ dri_postprocessing_init(struct dri_screen *screen)
|
|||
|
||||
const __DRIconfig **
|
||||
dri_init_screen_helper(struct dri_screen *screen,
|
||||
struct pipe_screen *pscreen)
|
||||
struct pipe_screen *pscreen,
|
||||
const char* driver_name)
|
||||
{
|
||||
screen->base.screen = pscreen;
|
||||
if (!screen->base.screen) {
|
||||
|
@ -437,15 +436,7 @@ dri_init_screen_helper(struct dri_screen *screen,
|
|||
driParseConfigFiles(&screen->optionCache,
|
||||
&screen->optionCacheDefaults,
|
||||
screen->sPriv->myNum,
|
||||
#if SPLIT_TARGETS
|
||||
driver_descriptor.name);
|
||||
#else
|
||||
#if GALLIUM_STATIC_TARGETS
|
||||
dd_driver_name());
|
||||
#else
|
||||
screen->dev->driver_name);
|
||||
#endif // GALLIUM_STATIC_TARGETS
|
||||
#endif // SPLIT_TARGETS
|
||||
driver_name);
|
||||
|
||||
/* Handle force_s3tc_enable. */
|
||||
if (!util_format_s3tc_enabled &&
|
|
@ -137,7 +137,8 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
|
|||
|
||||
const __DRIconfig **
|
||||
dri_init_screen_helper(struct dri_screen *screen,
|
||||
struct pipe_screen *pscreen);
|
||||
struct pipe_screen *pscreen,
|
||||
const char* driver_name);
|
||||
|
||||
void
|
||||
dri_destroy_screen_helper(struct dri_screen * screen);
|
|
@ -361,7 +361,7 @@ drisw_init_screen(__DRIscreen * sPriv)
|
|||
pscreen = drisw_create_screen(&drisw_lf);
|
||||
/* 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)
|
||||
goto fail;
|
||||
|
|
@ -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)
|
|
@ -1,5 +0,0 @@
|
|||
C_SOURCES := \
|
||||
dri_context.c \
|
||||
dri_screen.c \
|
||||
dri_drawable.c \
|
||||
dri2.c
|
|
@ -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')
|
|
@ -1 +0,0 @@
|
|||
../common/dri_context.c
|
|
@ -1 +0,0 @@
|
|||
../common/dri_drawable.c
|
|
@ -1 +0,0 @@
|
|||
../common/dri_screen.c
|
|
@ -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)
|
|
@ -1,5 +0,0 @@
|
|||
C_SOURCES := \
|
||||
dri_context.c \
|
||||
dri_screen.c \
|
||||
dri_drawable.c \
|
||||
drisw.c
|
|
@ -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')
|
|
@ -1 +0,0 @@
|
|||
../common/dri_context.c
|
|
@ -1 +0,0 @@
|
|||
../common/dri_drawable.c
|
|
@ -1 +0,0 @@
|
|||
../common/dri_screen.c
|
|
@ -40,7 +40,7 @@ swrast_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
|
|||
swrast_dri_la_LIBADD = \
|
||||
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.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/drivers/softpipe/libsoftpipe.la \
|
||||
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
|
||||
|
|
|
@ -7,11 +7,11 @@ env.Append(CPPPATH = [
|
|||
'#/src/mapi',
|
||||
'#/src/mesa',
|
||||
'#/src/mesa/drivers/dri/common',
|
||||
'#/src/gallium/state_trackers/dri/common',
|
||||
'#/src/gallium/state_trackers/dri',
|
||||
])
|
||||
|
||||
env.Prepend(LIBS = [
|
||||
st_drisw,
|
||||
st_dri,
|
||||
ws_dri,
|
||||
trace,
|
||||
rbug,
|
||||
|
|
|
@ -4,7 +4,7 @@ AM_CFLAGS = \
|
|||
-I$(top_srcdir)/src/mapi \
|
||||
-I$(top_srcdir)/src/mesa \
|
||||
-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)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
|
@ -33,12 +33,11 @@ gallium_dri_la_LDFLAGS += \
|
|||
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
|
||||
endif # HAVE_LD_VERSION_SCRIPT
|
||||
|
||||
# XXX: Fold libdridrm/libdrisw as drivers become megadriver (__dri*DriverExtension) aware
|
||||
gallium_dri_la_LIBADD = \
|
||||
$(top_builddir)/src/mesa/libmesagallium.la \
|
||||
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.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/drivers/galahad/libgalahad.la \
|
||||
$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
|
||||
|
|
|
@ -11,7 +11,7 @@ env.Append(CPPPATH = [
|
|||
'#/src/mapi',
|
||||
'#/src/mesa',
|
||||
'#/src/mesa/drivers/dri/common',
|
||||
'#/src/gallium/state_trackers/dri/common',
|
||||
'#/src/gallium/state_trackers/dri',
|
||||
])
|
||||
|
||||
if env['build'] == 'release':
|
||||
|
|
Loading…
Reference in New Issue