--- /dev/null
+
+#ifndef I915_PUBLIC_H
+#define I915_PUBLIC_H
+
+struct i915_winsys;
+struct pipe_screen;
+
+/**
+ * Create i915 pipe_screen.
+ */
+struct pipe_screen * i915_screen_create(struct i915_winsys *iws);
+
+#endif
#include "i915_surface.h"
#include "i915_resource.h"
#include "i915_winsys.h"
+#include "i915_public.h"
/*
void (*destroy)(struct i915_winsys *iws);
};
-
-/**
- * Create i915 pipe_screen.
- */
-struct pipe_screen *i915_screen_create(struct i915_winsys *iws);
-
-
#endif
-#include "target-helpers/drm_api_compat.h"
+#include "state_tracker/drm_driver.h"
+#include "i915/drm/i915_drm_public.h"
+#include "i915/i915_public.h"
-DRM_API_COMPAT_STRUCT("i915", "i915")
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct i915_winsys *iws;
+ iws = i915_drm_winsys_create(fd);
+ if (!iws)
+ return NULL;
+
+ return i915_screen_create(iws);
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
-#include "target-helpers/drm_api_compat.h"
+#include "state_tracker/drm_driver.h"
+#include "i915/drm/i915_drm_public.h"
+#include "i915/i915_public.h"
-DRM_API_COMPAT_STRUCT("i915", "i915")
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct i915_winsys *iws;
+ iws = i915_drm_winsys_create(fd);
+ if (!iws)
+ return NULL;
+
+ return i915_screen_create(iws);
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
/* A poor man's --whole-archive for EGL drivers */
void *_eglMain(void *);
-#include "target-helpers/drm_api_compat.h"
+#include "state_tracker/drm_driver.h"
+#include "i915/drm/i915_drm_public.h"
+#include "i915/i915_public.h"
-DRM_API_COMPAT_STRUCT("modesetting", "i915")
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct i915_winsys *iws;
+ iws = i915_drm_winsys_create(fd);
+ if (!iws)
+ return NULL;
+
+ return i915_screen_create(iws);
+}
+
+DRM_DRIVER_DESCRIPTOR("i915", "i915", create_screen)
-#include "state_tracker/drm_api.h"
+#include "state_tracker/drm_driver.h"
#include "i915_drm_winsys.h"
#include "util/u_memory.h"
--- /dev/null
+
+#ifndef I915_DRM_PUBLIC_H
+#define I915_DRM_PUBLIC_H
+
+struct i915_winsys;
+
+struct i915_winsys * i915_drm_winsys_create(int drmFD);
+
+#endif
#include <stdio.h>
-#include "state_tracker/drm_api.h"
+#include "state_tracker/drm_driver.h"
#include "i915_drm_winsys.h"
+#include "i915_drm_public.h"
#include "util/u_memory.h"
-#include "i915/i915_context.h"
-#include "i915/i915_screen.h"
-
-#include "trace/tr_drm.h"
/*
* Helper functions
FREE(idws);
}
-static struct pipe_screen *
-i915_drm_create_screen(struct drm_api *api, int drmFD)
+struct i915_winsys *
+i915_drm_winsys_create(int drmFD)
{
struct i915_drm_winsys *idws;
unsigned int deviceID;
idws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE);
- return i915_screen_create(&idws->base);
-}
-
-static struct drm_api i915_drm_api =
-{
- .name = "i915",
- .driver_name = "i915",
- .create_screen = i915_drm_create_screen,
- .destroy = NULL,
-};
-
-struct drm_api *
-drm_api_create()
-{
- return trace_drm_create(&i915_drm_api);
+ return &idws->base;
}
return (struct i915_drm_winsys *)iws;
}
-struct i915_drm_winsys * i915_drm_winsys_create(int fd, unsigned pci_id);
struct pipe_fence_handle * i915_drm_fence_create(drm_intel_bo *bo);
void i915_drm_winsys_init_batchbuffer_functions(struct i915_drm_winsys *idws);
--- /dev/null
+
+#ifndef I915_SW_PUBLIC_H
+#define I915_SW_PUBLIC_H
+
+struct i915_winsys;
+
+struct i915_winsys * i915_sw_winsys_create(void);
+
+#endif
#include "i915_sw_winsys.h"
+#include "i915_sw_public.h"
#include "util/u_memory.h"
*/
-struct pipe_screen *
-i915_sw_create_screen()
+struct i915_winsys *
+i915_sw_winsys_create()
{
struct i915_sw_winsys *isws;
unsigned int deviceID;
isws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE);
- /* XXX so this will leak winsys:es */
- return i915_screen_create(&isws->base);
+ return &isws->base;
}
return (struct i915_sw_winsys *)iws;
}
-struct pipe_screen* i915_sw_create_screen(void);
struct pipe_fence_handle * i915_sw_fence_create(void);
void i915_sw_winsys_init_batchbuffer_functions(struct i915_sw_winsys *idws);