#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
+#include "i915simple/i915_screen.h"
+
/* Turn a pipe winsys into an intel/pipe winsys:
*/
static INLINE struct intel_be_device *
*/
boolean
-intel_be_init_device(struct intel_be_device *dev, int fd)
+intel_be_init_device(struct intel_be_device *dev, int fd, unsigned id)
{
dev->fd = fd;
dev->max_batch_size = 16 * 4096;
1, 40, dev->max_batch_size * 16, 0,
dev->fMan);
+ /* Fill in this struct with callbacks that i915simple will need to
+ * communicate with the window system, buffer manager, etc.
+ */
+ dev->screen = i915_create_screen(&dev->base, id);
+
return true;
}
{
struct pipe_winsys base;
+ /**
+ * Hw level screen
+ */
+ struct pipe_screen *screen;
+
int fd; /**< Drm file discriptor */
size_t max_batch_size;
};
boolean
-intel_be_init_device(struct intel_be_device *device, int fd);
+intel_be_init_device(struct intel_be_device *device, int fd, unsigned id);
void
intel_be_destroy_device(struct intel_be_device *dev);
PIPE_DRIVERS = \
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
- $(TOP)/src/gallium/drivers/i915simple/libi915simple.a \
- $(TOP)/src/gallium/winsys/common/intel_drm/libinteldrm.a
+ $(TOP)/src/gallium/winsys/common/intel_drm/libinteldrm.a \
+ $(TOP)/src/gallium/drivers/i915simple/libi915simple.a
+
DRIVER_SOURCES = \
intel_winsys_softpipe.c \
-/**
- * Create i915 hardware rendering context.
- */
-static struct pipe_context *
-intel_create_i915simple(struct intel_context *intel,
- struct pipe_winsys *winsys)
-{
- struct pipe_screen *screen;
-
- /* Fill in this struct with callbacks that i915simple will need to
- * communicate with the window system, buffer manager, etc.
- */
- screen = i915_create_screen(winsys, intel->intelScreen->deviceID);
-
- /* Create the i915simple context:
- */
- return i915_create_context(screen, winsys, &intel->base.base );
-}
-
static void
intel_lock_hardware(struct intel_be_context *context)
{
case PCI_CHIP_Q35_G:
case PCI_CHIP_I915_G:
case PCI_CHIP_I915_GM:
- pipe = intel_create_i915simple( intel, &intelScreen->base.base );
+ pipe = i915_create_context(intelScreen->base.screen,
+ &intelScreen->base.base,
+ &intel->base.base);
break;
default:
fprintf(stderr, "Unknown PCIID %x in %s, using software driver\n",
struct pipe_surface *surf,
void *context_private)
{
- struct intel_context *intel = (struct intel_context *) context_private;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ //struct intel_context *intel = (struct intel_context *) context_private;
+ //__DRIdrawablePrivate *dPriv = intel->driDrawable;
- intelDisplaySurface(dPriv, surf, NULL);
+ assert((int)"Doesn't work currently" & 0);
+
+ //intelDisplaySurface(dPriv, surf, NULL);
}
static boolean
(*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
}
- intel_be_init_device(&intelScreen->base, sPriv->fd);
intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
intelScreen->base.base.get_name = intel_get_name;
+ intel_be_init_device(&intelScreen->base, sPriv->fd, intelScreen->deviceID);
return GL_TRUE;
}