#include "util/u_inlines.h"
#include "pipe/p_screen.h"
#include "pipe/p_format.h"
+#include "pipe-loader/pipe_loader.h"
#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
#include "state_tracker/drm_driver.h"
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;
sPriv->extensions = NULL;
driParseOptionInfo(&screen->optionCacheDefaults, gallium_config_options.xml);
driParseConfigFiles(&screen->optionCache,
- &screen->optionCacheDefaults,
+ &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
/* Handle force_s3tc_enable. */
if (!util_format_s3tc_enabled &&
struct dri_context;
struct dri_drawable;
+struct pipe_loader_device;
struct dri_screen
{
/* drm */
int fd;
+ struct pipe_loader_device *dev;
+
/* gallium */
boolean d_depth_bits_last;
boolean sd_depth_bits_last;
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 \
noinst_LTLIBRARIES = libdridrm.la
+libdridrm_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSPLIT_TARGETS=1
+
libdridrm_la_SOURCES = $(C_SOURCES)
xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
])
+env.Append(CPPDEFINES = [('SPLIT_TARGETS', '1')])
+
st_dri = env.ConvenienceLibrary(
target = 'st_dri',
source = env.ParseSourceList('Makefile.sources', 'C_SOURCES')
#include "state_tracker/drm_driver.h"
#include "state_tracker/st_texture.h"
#include "state_tracker/st_context.h"
+#include "pipe-loader/pipe_loader.h"
#include "main/texobj.h"
#include "dri_screen.h"
{
const __DRIconfig **configs;
struct dri_screen *screen;
- struct pipe_screen *pscreen;
+ struct pipe_screen *pscreen = NULL;
const struct drm_conf_ret *throttle_ret = NULL;
const struct drm_conf_ret *dmabuf_ret = NULL;
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);
+
+ throttle_ret = dd_configuration(DRM_CONF_THROTTLE);
+ dmabuf_ret = dd_configuration(DRM_CONF_SHARE_FD);
+#else
+ if (pipe_loader_drm_probe_fd(&screen->dev, screen->fd, true)) {
+ pscreen = pipe_loader_create_screen(screen->dev, PIPE_SEARCH_DIR);
+
+ throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
+ 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;
screen->default_throttle_frames = throttle_ret->val.val_int;
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;
}
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 \
])
env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')])
+env.Append(CPPDEFINES = [('SPLIT_TARGETS', '1')])
st_drisw = env.ConvenienceLibrary(
target = 'st_drisw',