diff options
Diffstat (limited to 'src/gallium/targets')
-rw-r--r-- | src/gallium/targets/Makefile.dri | 6 | ||||
-rw-r--r-- | src/gallium/targets/Makefile.egl | 12 | ||||
-rw-r--r-- | src/gallium/targets/Makefile.xorg | 72 | ||||
-rw-r--r-- | src/gallium/targets/SConscript | 23 | ||||
-rw-r--r-- | src/gallium/targets/SConscript.dri | 5 | ||||
-rw-r--r-- | src/gallium/targets/dri-r600/Makefile | 22 | ||||
-rw-r--r-- | src/gallium/targets/dri-r600/SConscript | 27 | ||||
-rw-r--r-- | src/gallium/targets/dri-r600/dummy.c | 0 | ||||
-rw-r--r-- | src/gallium/targets/egl-apis/SConscript | 33 | ||||
-rw-r--r-- | src/gallium/targets/egl-swrast/SConscript | 30 | ||||
-rw-r--r-- | src/gallium/targets/egl-swrast/swrast_glue.c | 6 | ||||
-rw-r--r-- | src/gallium/targets/xorg-vmwgfx/Makefile | 62 | ||||
-rw-r--r-- | src/gallium/targets/xorg-vmwgfx/vmw_screen.c | 44 |
13 files changed, 273 insertions, 69 deletions
diff --git a/src/gallium/targets/Makefile.dri b/src/gallium/targets/Makefile.dri index 3eff07538f..de05f96d23 100644 --- a/src/gallium/targets/Makefile.dri +++ b/src/gallium/targets/Makefile.dri @@ -57,6 +57,8 @@ SHARED_INCLUDES = \ -I$(TOP)/src/egl/drivers/dri \ $(LIBDRM_CFLAGS) +LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) + ##### RULES ##### @@ -69,7 +71,7 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: depend symlinks $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) +default: depend symlinks $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING) $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \ $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o @@ -88,7 +90,7 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \ $(TOP)/$(LIB_DIR)/gallium: mkdir -p $@ -$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium +$(LIBNAME_STAGING): $(LIBNAME) $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) diff --git a/src/gallium/targets/Makefile.egl b/src/gallium/targets/Makefile.egl index 4f8641e056..4fa13e85ce 100644 --- a/src/gallium/targets/Makefile.egl +++ b/src/gallium/targets/Makefile.egl @@ -33,10 +33,20 @@ endif kms_ST = $(TOP)/src/gallium/state_trackers/egl/libeglkms.a kms_LIBS = $(common_LIBS) +### Include directories +INCLUDES = \ + -I$(TOP)/include \ + -I$(TOP)/src/gallium/include \ + -I$(TOP)/src/gallium/auxiliary \ + -I$(TOP)/src/gallium/drivers \ + -I$(TOP)/src/gallium/winsys \ + -I$(TOP)/src/egl/main \ + $(LIBDRM_CFLAGS) + ##### RULES ##### .c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(CC) -c $(INCLUDES) $(CFLAGS) $(EGL_DRIVER_DEFINES) $< -o $@ ##### TARGETS ##### diff --git a/src/gallium/targets/Makefile.xorg b/src/gallium/targets/Makefile.xorg new file mode 100644 index 0000000000..f638fbe455 --- /dev/null +++ b/src/gallium/targets/Makefile.xorg @@ -0,0 +1,72 @@ +# src/gallium/targets/Makefile.xorg + +# Template makefile for gallium xorg drivers. +# +# Usage: +# The minimum that the including makefile needs to define +# is TOP, LIBNAME and one of of the *_SOURCES. +# +# Optional defines: +# DRIVER_INCLUDES are appended to the list of includes directories. +# DRIVER_DEFINES is not used for makedepend, but for compilation. +# DRIVER_LINKS are flags given to the linker + +### Basic defines ### + +OBJECTS = $(C_SOURCES:.c=.o) \ + $(CPP_SOURCES:.cpp=.o) \ + $(ASM_SOURCES:.S=.o) + +INCLUDES = \ + $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \ + -I$(TOP)/src/gallium/include \ + -I$(TOP)/src/gallium/drivers \ + -I$(TOP)/src/gallium/auxiliary \ + $(DRIVER_INCLUDES) + +LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET) + + +##### TARGETS ##### + +default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING) + +$(LIBNAME): $(OBJECTS) Makefile $(LIBS) + $(MKLIB) -noprefix -o $@ $(OBJECTS) $(DRIVER_LINKS) + +depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES) + rm -f depend + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null + +$(LIBNAME_STAGING): $(LIBNAME) + $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium + +$(TOP)/$(LIB_DIR)/gallium: + mkdir -p $@ + +clean: + rm -f $(OBJECTS) $(GENERATED_SOURCES) $(LIBNAME).a depend depend.bak + +install: + $(INSTALL) -d $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR) + $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR) + + +##### RULES ##### + +%.s: %.c + $(CC) -S $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + +%.o: %.c + $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + +%.o: %.cpp + $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@ + +%.o: %.S + $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + +sinclude depend + +.PHONY: default clean install diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript index 9077cbf6a4..b61a4855af 100644 --- a/src/gallium/targets/SConscript +++ b/src/gallium/targets/SConscript @@ -3,15 +3,16 @@ Import('*') # Compatibility with old build scripts: # -if 'xlib' in env['winsys']: - SConscript([ - 'libgl-xlib/SConscript', - ]) +if 'mesa' in env['statetrackers']: + if 'xlib' in env['winsys']: + SConscript([ + 'libgl-xlib/SConscript', + ]) -if 'gdi' in env['winsys']: - SConscript([ - 'libgl-gdi/SConscript', - ]) + if 'gdi' in env['winsys']: + SConscript([ + 'libgl-gdi/SConscript', + ]) if not 'graw-xlib' in env['targets'] and not env['msvc']: # XXX: disable until MSVC can link correctly @@ -29,6 +30,12 @@ if 'xorg' in env['statetrackers']: 'xorg-vmwgfx/SConscript', ]) +if 'egl' in env['statetrackers']: + SConscript([ + 'egl-swrast/SConscript', + 'egl-apis/SConscript', + ]) + # Ideally all non-target directories would produce convenience # libraries, and the actual shared libraries and other installables # would be finally assembled in the targets subtree: diff --git a/src/gallium/targets/SConscript.dri b/src/gallium/targets/SConscript.dri index 4bbb16c227..74b53e5023 100644 --- a/src/gallium/targets/SConscript.dri +++ b/src/gallium/targets/SConscript.dri @@ -99,3 +99,8 @@ if 'radeon' in env['winsys']: SConscript([ 'dri-radeong/SConscript', ]) + +if 'r600' in env['winsys']: + SConscript([ + 'dri-r600/SConscript', + ]) diff --git a/src/gallium/targets/dri-r600/Makefile b/src/gallium/targets/dri-r600/Makefile new file mode 100644 index 0000000000..0213200fbc --- /dev/null +++ b/src/gallium/targets/dri-r600/Makefile @@ -0,0 +1,22 @@ +TOP = ../../../.. +include $(TOP)/configs/current + +LIBNAME = r600_dri.so + +PIPE_DRIVERS = \ + $(TOP)/src/gallium/state_trackers/dri/drm/libdridrm.a \ + $(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ + $(TOP)/src/gallium/drivers/trace/libtrace.a \ + $(TOP)/src/gallium/drivers/rbug/librbug.a \ + $(TOP)/src/gallium/drivers/r600/libr600.a + +C_SOURCES = \ + $(COMMON_GALLIUM_SOURCES) \ + $(DRIVER_SOURCES) + +include ../Makefile.dri + +DRI_LIB_DEPS += -ldrm_radeon + +symlinks: diff --git a/src/gallium/targets/dri-r600/SConscript b/src/gallium/targets/dri-r600/SConscript new file mode 100644 index 0000000000..6c23c050eb --- /dev/null +++ b/src/gallium/targets/dri-r600/SConscript @@ -0,0 +1,27 @@ +Import('*') + +if not 'r600' in env['drivers']: + print 'warning: r600 pipe driver not built skipping r600_dri.so' + Return() + +env = drienv.Clone() + +env.ParseConfig('pkg-config --cflags --libs libdrm_radeon') + +env.Prepend(LIBS = [ + st_dri, + r600drm, + r600, + trace, + rbug, + mesa, + glsl, + gallium, + COMMON_DRI_DRM_OBJECTS +]) + +env.SharedLibrary( + target ='r600_dri.so', + source = 'dummy.c', + SHLIBPREFIX = '', +) diff --git a/src/gallium/targets/dri-r600/dummy.c b/src/gallium/targets/dri-r600/dummy.c new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/gallium/targets/dri-r600/dummy.c diff --git a/src/gallium/targets/egl-apis/SConscript b/src/gallium/targets/egl-apis/SConscript new file mode 100644 index 0000000000..0ca3d1fb9e --- /dev/null +++ b/src/gallium/targets/egl-apis/SConscript @@ -0,0 +1,33 @@ +####################################################################### +# SConscript for egl-apis target + +Import('*') + +if env['platform'] == 'windows': + + env = env.Clone() + + env.Append(CPPPATH = [ + '#/src/gallium/state_trackers/vega', + ]) + + env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', + ]) + + env['no_import_lib'] = 1 + + api_libs = { + 'OpenVG': vgapi + st_vega, + } + + for name in api_libs.keys(): + api = env.SharedLibrary( + target = 'api_' + name, + source = ['api_' + name + '.c'], + LIBS = api_libs[name] + gallium + env['LIBS'], + ) + env.InstallSharedLibrary(api) diff --git a/src/gallium/targets/egl-swrast/SConscript b/src/gallium/targets/egl-swrast/SConscript new file mode 100644 index 0000000000..213e5b3e6c --- /dev/null +++ b/src/gallium/targets/egl-swrast/SConscript @@ -0,0 +1,30 @@ +####################################################################### +# SConscript for egl-swrast target + +Import('*') + +if env['platform'] == 'windows': + + env = env.Clone() + + env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', + ]) + + drivers = [softpipe] + if env['llvm']: + drivers += [llvmpipe] + drivers += [identity, trace, rbug] + + env['no_import_lib'] = 1 + + egl_gdi_swrast = env.SharedLibrary( + target ='egl_gdi_swrast', + source = 'swrast_glue.c', + LIBS = st_egl_gdi + ws_gdi + drivers + gallium + egl + env['LIBS'], + ) + + env.InstallSharedLibrary(egl_gdi_swrast) diff --git a/src/gallium/targets/egl-swrast/swrast_glue.c b/src/gallium/targets/egl-swrast/swrast_glue.c index 9db8089a66..defd11c687 100644 --- a/src/gallium/targets/egl-swrast/swrast_glue.c +++ b/src/gallium/targets/egl-swrast/swrast_glue.c @@ -1,14 +1,8 @@ #include "state_tracker/drm_api.h" -static struct drm_api swrast_drm_api = -{ - .name = "swrast", -}; - struct drm_api * drm_api_create() { - (void) swrast_drm_api; return NULL; } diff --git a/src/gallium/targets/xorg-vmwgfx/Makefile b/src/gallium/targets/xorg-vmwgfx/Makefile index 01a10b6f19..c0ff999116 100644 --- a/src/gallium/targets/xorg-vmwgfx/Makefile +++ b/src/gallium/targets/xorg-vmwgfx/Makefile @@ -1,72 +1,30 @@ TOP = ../../../.. include $(TOP)/configs/current -TARGET = vmwgfx_drv.so +LIBNAME = vmwgfx_drv.so -CFILES = \ +C_SOURCES = \ vmw_xorg.c \ vmw_video.c \ vmw_ioctl.c \ vmw_ctrl.c \ vmw_screen.c -OBJECTS = $(patsubst %.c,%.o,$(CFILES)) - -INCLUDES = \ - $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \ - -I$(TOP)/src/gallium/include \ - -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/src/gallium/auxiliary \ +DRIVER_INCLUDES = \ -I$(TOP)/src/gallium -LIBS = \ +DRIVER_DEFINES = \ + -std=gnu99 \ + -DHAVE_CONFIG_H + +DRIVER_LINKS = \ $(TOP)/src/gallium/state_trackers/xorg/libxorgtracker.a \ $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \ $(TOP)/src/gallium/drivers/trace/libtrace.a \ $(TOP)/src/gallium/drivers/rbug/librbug.a \ $(TOP)/src/gallium/drivers/svga/libsvga.a \ - $(GALLIUM_AUXILIARIES) - -LINKS = \ + $(GALLIUM_AUXILIARIES) \ $(shell pkg-config --libs --silence-errors libkms) \ $(shell pkg-config --libs libdrm) -DRIVER_DEFINES = \ - -std=gnu99 \ - -DHAVE_CONFIG_H - -TARGET_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET) - -############################################# - - - -all default: $(TARGET) $(TARGET_STAGING) - -$(TARGET): $(OBJECTS) Makefile $(LIBS) - $(MKLIB) -noprefix -o $@ $(OBJECTS) $(LIBS) $(LINKS) - -$(TOP)/$(LIB_DIR)/gallium: - mkdir -p $@ - -$(TARGET_STAGING): $(TARGET) $(TOP)/$(LIB_DIR)/gallium - $(INSTALL) $(TARGET) $(TOP)/$(LIB_DIR)/gallium - -clean: - rm -rf $(OBJECTS) $(TARGET) - -install: - $(INSTALL) -d $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR) - $(MINSTALL) -m 755 $(TARGET) $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR) - - -############################################## - - -.c.o: - $(CC) -c $(CFLAGS) $(INCLUDES) $(DRIVER_DEFINES) $< -o $@ - - -############################################## - -.PHONY = all clean install +include ../Makefile.xorg diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_screen.c b/src/gallium/targets/xorg-vmwgfx/vmw_screen.c index 5e4ef41688..e0edf32adb 100644 --- a/src/gallium/targets/xorg-vmwgfx/vmw_screen.c +++ b/src/gallium/targets/xorg-vmwgfx/vmw_screen.c @@ -32,9 +32,14 @@ #include "vmw_hook.h" #include "vmw_driver.h" +#include <pipe/p_context.h> #include "cursorstr.h" +void vmw_winsys_screen_set_throttling(struct pipe_screen *screen, + uint32_t throttle_us); + + /* modified version of crtc functions */ xf86CrtcFuncsRec vmw_screen_crtc_funcs; @@ -83,12 +88,51 @@ vmw_screen_cursor_close(struct vmw_customizer *vmw) config->crtc[i]->funcs = vmw->cursor_priv; } +static void +vmw_context_throttle(CustomizerPtr cust, + struct pipe_context *pipe, + enum xorg_throttling_reason reason) +{ + switch (reason) { + case THROTTLE_RENDER: + vmw_winsys_screen_set_throttling(pipe->screen, 20000); + break; + default: + vmw_winsys_screen_set_throttling(pipe->screen, 0); + } +} + +static void +vmw_context_no_throttle(CustomizerPtr cust, + struct pipe_context *pipe, + enum xorg_throttling_reason reason) +{ + vmw_winsys_screen_set_throttling(pipe->screen, 0); +} + static Bool vmw_screen_init(CustomizerPtr cust, int fd) { struct vmw_customizer *vmw = vmw_customizer(cust); + drmVersionPtr ver; vmw->fd = fd; + ver = drmGetVersion(fd); + if (ver == NULL || + (ver->version_major == 1 && ver->version_minor < 1)) { + cust->swap_throttling = TRUE; + cust->dirty_throttling = TRUE; + cust->winsys_context_throttle = vmw_context_no_throttle; + } else { + cust->swap_throttling = TRUE; + cust->dirty_throttling = FALSE; + cust->winsys_context_throttle = vmw_context_throttle; + debug_printf("%s: Enabling kernel throttling.\n", __func__); + } + + if (ver) + drmFreeVersion(ver); + vmw_screen_cursor_init(vmw); vmw_ctrl_ext_init(vmw); |