diff options
Diffstat (limited to 'src/gallium/winsys/drm/intel')
-rw-r--r-- | src/gallium/winsys/drm/intel/dri/Makefile (renamed from src/gallium/winsys/drm/intel/dri2/Makefile) | 7 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_api.h | 3 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_context.c | 14 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_device.c | 47 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_device.h | 2 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/xorg/Makefile | 3 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/xorg/intel_xorg.c | 9 |
7 files changed, 65 insertions, 20 deletions
diff --git a/src/gallium/winsys/drm/intel/dri2/Makefile b/src/gallium/winsys/drm/intel/dri/Makefile index 1a02109274..a4704bc050 100644 --- a/src/gallium/winsys/drm/intel/dri2/Makefile +++ b/src/gallium/winsys/drm/intel/dri/Makefile @@ -4,8 +4,9 @@ include $(TOP)/configs/current LIBNAME = i915_dri.so PIPE_DRIVERS = \ - $(TOP)/src/gallium/state_trackers/dri2/libdri2drm.a \ + $(TOP)/src/gallium/state_trackers/dri/libdridrm.a \ $(TOP)/src/gallium/winsys/drm/intel/gem/libinteldrm.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ $(TOP)/src/gallium/drivers/i915simple/libi915simple.a @@ -19,4 +20,6 @@ include ../../Makefile.template DRI_LIB_DEPS += -ldrm_intel -symlinks: +symlinks: $(TOP)/$(LIB_DIR)/gallium + @rm -f $(TOP)/lib/gallium/i965_dri.so + ln -s i915_dri.so $(TOP)/lib/gallium/i965_dri.so diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.h b/src/gallium/winsys/drm/intel/gem/intel_be_api.h index 73e458d4ba..1c622f3b97 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_api.h +++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.h @@ -8,7 +8,8 @@ #include "intel_be_device.h" -struct pipe_screen *intel_be_create_screen(int drmFD, int pciID); +struct pipe_screen *intel_be_create_screen(int drmFD, + struct drm_create_screen_arg *arg); struct pipe_context *intel_be_create_context(struct pipe_screen *screen); #endif diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_context.c b/src/gallium/winsys/drm/intel/gem/intel_be_context.c index bb6f1b916c..fe0b138fbe 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_context.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_context.c @@ -1,6 +1,8 @@ #include "pipe/p_screen.h" +#include "softpipe/sp_winsys.h" + #include "intel_be_device.h" #include "intel_be_context.h" #include "intel_be_batchbuffer.h" @@ -106,13 +108,13 @@ intel_be_create_context(struct pipe_screen *screen) intel_be_init_context(intel, device); -#if 0 - pipe = intel_create_softpipe(intel, screen->winsys); -#else - pipe = i915_create_context(screen, &device->base, &intel->base); -#endif + if (device->softpipe) + pipe = softpipe_create(screen); + else + pipe = i915_create_context(screen, &device->base, &intel->base); - pipe->priv = intel; + if (pipe) + pipe->priv = intel; return pipe; } diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.c b/src/gallium/winsys/drm/intel/gem/intel_be_device.c index 0f6300323b..907ac86637 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c @@ -6,12 +6,15 @@ #include "pipe/p_state.h" #include "pipe/p_inlines.h" #include "util/u_memory.h" +#include "util/u_debug.h" #include "intel_be_fence.h" #include "i915simple/i915_winsys.h" +#include "softpipe/sp_winsys.h" #include "intel_be_api.h" +#include <stdio.h> /* * Buffer @@ -175,8 +178,6 @@ intel_be_handle_from_buffer(struct pipe_screen *screen, struct pipe_buffer *buffer, unsigned *handle) { - drm_intel_bo *bo; - if (!buffer) return FALSE; @@ -285,14 +286,47 @@ intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id) dev->pools.gem = drm_intel_bufmgr_gem_init(dev->fd, dev->max_batch_size); + dev->softpipe = debug_get_bool_option("INTEL_SOFTPIPE", FALSE); + return true; } +static void +intel_be_get_device_id(unsigned int *device_id) +{ + char path[512]; + FILE *file; + + /* + * FIXME: Fix this up to use a drm ioctl or whatever. + */ + + snprintf(path, sizeof(path), "/sys/class/drm/card0/device/device"); + file = fopen(path, "r"); + if (!file) { + return; + } + + fgets(path, sizeof(path), file); + sscanf(path, "%x", device_id); + fclose(file); +} + struct pipe_screen * -intel_be_create_screen(int drmFD, int deviceID) +intel_be_create_screen(int drmFD, struct drm_create_screen_arg *arg) { struct intel_be_device *dev; struct pipe_screen *screen; + unsigned int deviceID; + + if (arg != NULL) { + switch(arg->mode) { + case DRM_CREATE_NORMAL: + break; + default: + return NULL; + } + } /* Allocate the private area */ dev = malloc(sizeof(*dev)); @@ -300,9 +334,14 @@ intel_be_create_screen(int drmFD, int deviceID) return NULL; memset(dev, 0, sizeof(*dev)); + intel_be_get_device_id(&deviceID); intel_be_init_device(dev, drmFD, deviceID); - screen = i915_create_screen(&dev->base, deviceID); + if (dev->softpipe) { + screen = softpipe_create_screen(&dev->base); + drm_api_hooks.buffer_from_texture = softpipe_get_texture_buffer; + } else + screen = i915_create_screen(&dev->base, deviceID); return screen; } diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.h b/src/gallium/winsys/drm/intel/gem/intel_be_device.h index 47d2176cb4..b32637ece2 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h @@ -16,6 +16,8 @@ struct intel_be_device { struct pipe_winsys base; + boolean softpipe; + int fd; /**< Drm file discriptor */ unsigned id; diff --git a/src/gallium/winsys/drm/intel/xorg/Makefile b/src/gallium/winsys/drm/intel/xorg/Makefile index a45ca570db..b1b6b9362b 100644 --- a/src/gallium/winsys/drm/intel/xorg/Makefile +++ b/src/gallium/winsys/drm/intel/xorg/Makefile @@ -21,6 +21,7 @@ LIBS = \ $(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a \ $(GALLIUMDIR)/winsys/drm/intel/gem/libinteldrm.a \ $(TOP)/src/gallium/drivers/i915simple/libi915simple.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ $(GALLIUM_AUXILIARIES) ############################################# @@ -29,7 +30,7 @@ LIBS = \ all default: $(TARGET) -$(TARGET): $(OBJECTS) Makefile $(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a +$(TARGET): $(OBJECTS) Makefile $(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a $(LIBS) $(TOP)/bin/mklib -noprefix -o $@ \ $(OBJECTS) $(LIBS) $(shell pkg-config --libs libdrm) -ldrm_intel diff --git a/src/gallium/winsys/drm/intel/xorg/intel_xorg.c b/src/gallium/winsys/drm/intel/xorg/intel_xorg.c index aea39247e5..46a7971f60 100644 --- a/src/gallium/winsys/drm/intel/xorg/intel_xorg.c +++ b/src/gallium/winsys/drm/intel/xorg/intel_xorg.c @@ -37,20 +37,17 @@ static Bool intel_xorg_pci_probe(DriverPtr driver, intptr_t match_data); static const struct pci_id_match intel_xorg_device_match[] = { - {0x8086, 0x2592, 0xffff, 0xffff, 0, 0, 0}, - {0x8086, 0x27A2, 0xffff, 0xffff, 0, 0, 0}, + {0x8086, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0}, {0, 0, 0}, }; static SymTabRec intel_xorg_chipsets[] = { - {0x2592, "Intel Graphics Device"}, - {0x27A2, "Intel Graphics Device"}, + {PCI_MATCH_ANY, "Intel Graphics Device"}, {-1, NULL} }; static PciChipsets intel_xorg_pci_devices[] = { - {0x2592, 0x2592, RES_SHARED_VGA}, - {0x27A2, 0x27A2, RES_SHARED_VGA}, + {PCI_MATCH_ANY, PCI_MATCH_ANY, RES_SHARED_VGA}, {-1, -1, RES_UNDEFINED} }; |