}
static struct pipe_screen *
-identity_drm_create_screen(struct drm_api *_api, int fd,
- struct drm_create_screen_arg *arg)
+identity_drm_create_screen(struct drm_api *_api, int fd)
{
struct identity_drm_api *id_api = identity_drm_api(_api);
struct drm_api *api = id_api->api;
struct pipe_screen *screen;
- if (arg && arg->mode != DRM_CREATE_NORMAL)
- return NULL;
-
- screen = api->create_screen(api, fd, arg);
+ screen = api->create_screen(api, fd);
return identity_screen_create(screen);
}
}
static struct pipe_screen *
-trace_drm_create_screen(struct drm_api *_api, int fd,
- struct drm_create_screen_arg *arg)
+trace_drm_create_screen(struct drm_api *_api, int fd)
{
struct trace_drm_api *tr_api = trace_drm_api(_api);
struct drm_api *api = tr_api->api;
/* TODO trace call */
- if (arg && arg->mode != DRM_CREATE_NORMAL)
- return NULL;
-
- screen = api->create_screen(api, fd, arg);
-
+ screen = api->create_screen(api, fd);
return trace_screen_create(rbug_screen_create(screen));
}
struct pipe_context;
struct pipe_resource;
-enum drm_create_screen_mode {
- DRM_CREATE_NORMAL = 0,
- DRM_CREATE_DRI1,
- DRM_CREATE_DRIVER = 1024,
- DRM_CREATE_MAX
-};
-
#define DRM_API_HANDLE_TYPE_SHARED 0
#define DRM_API_HANDLE_TYPE_KMS 1
unsigned stride;
};
-/**
- * Modes other than DRM_CREATE_NORMAL derive from this struct.
- */
-/*@{*/
-struct drm_create_screen_arg {
- enum drm_create_screen_mode mode;
-};
-/*@}*/
-
struct drm_api
{
void (*destroy)(struct drm_api *api);
/**
* Create a pipe srcreen.
*/
- struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd,
- struct drm_create_screen_arg *arg);
+ struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd);
};
extern struct drm_api * drm_api_create(void);
sPriv->private = (void *)screen;
sPriv->extensions = dri_screen_extensions;
- pscreen = screen->api->create_screen(screen->api, screen->fd, NULL);
+ pscreen = screen->api->create_screen(screen->api, screen->fd);
/* dri_init_screen_helper checks pscreen for us */
configs = dri_init_screen_helper(screen, pscreen, 32);
if (fd < 0)
return FALSE;
- dri2dpy->base.screen = dri2dpy->api->create_screen(dri2dpy->api, fd, NULL);
+ dri2dpy->base.screen = dri2dpy->api->create_screen(dri2dpy->api, fd);
if (!dri2dpy->base.screen) {
_eglLog(_EGL_WARNING, "failed to create DRM screen");
return FALSE;
return TRUE;
if (ms->api) {
- ms->screen = ms->api->create_screen(ms->api, ms->fd, NULL);
+ ms->screen = ms->api->create_screen(ms->api, ms->fd);
if (ms->screen)
return TRUE;
}
static struct pipe_screen *
-i915_drm_create_screen(struct drm_api *api, int drmFD,
- struct drm_create_screen_arg *arg)
+i915_drm_create_screen(struct drm_api *api, int drmFD)
{
struct i915_drm_winsys *idws;
unsigned int deviceID;
- if (arg != NULL) {
- switch(arg->mode) {
- case DRM_CREATE_NORMAL:
- break;
- default:
- return NULL;
- }
- }
-
idws = CALLOC_STRUCT(i915_drm_winsys);
if (!idws)
return NULL;
}
static struct pipe_screen *
-i965_libdrm_create_screen(struct drm_api *api, int drmFD,
- struct drm_create_screen_arg *arg)
+i965_libdrm_create_screen(struct drm_api *api, int drmFD)
{
struct i965_libdrm_winsys *idws;
unsigned int deviceID;
debug_printf("%s\n", __FUNCTION__);
- if (arg != NULL) {
- switch(arg->mode) {
- case DRM_CREATE_NORMAL:
- break;
- default:
- return NULL;
- }
- }
-
idws = CALLOC_STRUCT(i965_libdrm_winsys);
if (!idws)
return NULL;
}
/* Create a pipe_screen. */
-struct pipe_screen* radeon_create_screen(struct drm_api* api,
- int drmFB,
- struct drm_create_screen_arg *arg)
+struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB)
{
struct radeon_libdrm_winsys* rws;
boolean ret;
#include "state_tracker/drm_api.h"
-struct pipe_screen* radeon_create_screen(struct drm_api* api,
- int drmFB,
- struct drm_create_screen_arg *arg);
+struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB);
void radeon_destroy_drm_api(struct drm_api* api);
* bottom of the file.
*/
static struct pipe_screen *
-vmw_drm_create_screen(struct drm_api *drm_api,
- int fd,
- struct drm_create_screen_arg *arg)
+vmw_drm_create_screen(struct drm_api *drm_api, int fd)
{
struct vmw_winsys_screen *vws;
struct pipe_screen *screen;
boolean use_old_scanout_flag = FALSE;
- if (!arg || arg->mode == DRM_CREATE_NORMAL) {
- struct dri1_api_version drm_ver;
- drmVersionPtr ver;
+ struct dri1_api_version drm_ver;
+ drmVersionPtr ver;
- ver = drmGetVersion(fd);
- if (ver == NULL)
- return NULL;
+ ver = drmGetVersion(fd);
+ if (ver == NULL)
+ return NULL;
- drm_ver.major = ver->version_major;
- drm_ver.minor = ver->version_minor;
- drm_ver.patch_level = 0; /* ??? */
+ drm_ver.major = ver->version_major;
+ drm_ver.minor = ver->version_minor;
+ drm_ver.patch_level = 0; /* ??? */
- drmFreeVersion(ver);
- if (!vmw_dri1_check_version(&drm_ver, &drm_required,
- &drm_compat, "vmwgfx drm driver"))
- return NULL;
+ drmFreeVersion(ver);
+ if (!vmw_dri1_check_version(&drm_ver, &drm_required,
+ &drm_compat, "vmwgfx drm driver"))
+ return NULL;
- if (!vmw_dri1_check_version(&drm_ver, &drm_scanout,
- &drm_compat, "use old scanout field (not a error)"))
- use_old_scanout_flag = TRUE;
- }
-
- if (arg != NULL) {
- switch (arg->mode) {
- case DRM_CREATE_NORMAL:
- break;
- default:
- return NULL;
- }
- }
+ if (!vmw_dri1_check_version(&drm_ver, &drm_scanout,
+ &drm_compat, "use old scanout field (not a error)"))
+ use_old_scanout_flag = TRUE;
vws = vmw_winsys_create( fd, use_old_scanout_flag );
if (!vws)
static struct pipe_screen *
-sw_drm_create_screen(struct drm_api *_api, int drmFD,
- struct drm_create_screen_arg *arg)
+sw_drm_create_screen(struct drm_api *_api, int drmFD)
{
struct sw_drm_api *swapi = sw_drm_api(_api);
struct drm_api *api = swapi->api;
struct sw_winsys *sww;
struct pipe_screen *screen;
- screen = api->create_screen(api, drmFD, arg);
+ screen = api->create_screen(api, drmFD);
if (!screen)
return NULL;