drm_api: Remove type argument from create screen callback
authorJakob Bornecrantz <jakob@vmware.com>
Tue, 25 May 2010 17:58:33 +0000 (18:58 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Tue, 25 May 2010 18:05:07 +0000 (19:05 +0100)
With the removal of DRI1 support there where no use of this argument,
some drivers didn't even properly check it.

12 files changed:
src/gallium/drivers/identity/id_drm.c
src/gallium/drivers/trace/tr_drm.c
src/gallium/include/state_tracker/drm_api.h
src/gallium/state_trackers/dri/drm/dri2.c
src/gallium/state_trackers/egl/x11/native_dri2.c
src/gallium/state_trackers/xorg/xorg_driver.c
src/gallium/winsys/i915/drm/i915_drm_api.c
src/gallium/winsys/i965/drm/i965_drm_api.c
src/gallium/winsys/radeon/drm/radeon_drm.c
src/gallium/winsys/radeon/drm/radeon_drm.h
src/gallium/winsys/svga/drm/vmw_screen_dri.c
src/gallium/winsys/sw/drm/sw_drm_api.c

index a9d41af18c7d7887721fc43e0a457414270f8209..15d01519f8023b5ed9fac17aab56e5fbf6010dab 100644 (file)
@@ -46,17 +46,13 @@ identity_drm_api(struct drm_api *_api)
 }
 
 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);
 }
index 9c7d39201a9bfe5cc197022bc6f7b2d833acdfbc..e6850332121d31f2931eb76fb05df510ad24e6b6 100644 (file)
@@ -47,8 +47,7 @@ trace_drm_api(struct drm_api *_api)
 }
 
 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;
@@ -56,11 +55,7 @@ trace_drm_create_screen(struct drm_api *_api, int fd,
 
    /* 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));
 }
index 8fd0995444dde5f96b7d07d0ad90b777e988ca6b..4572c7e04235d78fe3e292f2e8ddee6c19f326fc 100644 (file)
@@ -9,13 +9,6 @@ struct pipe_winsys;
 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
 
@@ -42,15 +35,6 @@ struct winsys_handle
        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);
@@ -65,8 +49,7 @@ struct drm_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);
index 6c022f4bbf3dcdfa908b1ecd63f55df308abf52f..f4cc8d77ebdb1cb4932cb4ca3a2fbb730732c163 100644 (file)
@@ -518,7 +518,7 @@ dri2_init_screen(__DRIscreen * sPriv)
    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);
index 63877ed5e51f6181711c95b57cacbbfe0ec50b76..3f802dd713f0d2be8393b11bacaeeab8cf41af7a 100644 (file)
@@ -718,7 +718,7 @@ dri2_display_init_screen(struct native_display *ndpy)
    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;
index 44520b81b663a52d0d2f8583be254fc60bf1bfd7..84c0545b1b76db51a13c0213ac3b45c548eff5e3 100644 (file)
@@ -311,7 +311,7 @@ drv_init_resource_management(ScrnInfoPtr pScrn)
        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;
index 5dfd5a787983be9993a78bfb8dc5455a6fc02d6a..b95df40e86c42f2263a07b7a6930ba8b6ba08bca 100644 (file)
@@ -49,21 +49,11 @@ i915_drm_winsys_destroy(struct i915_winsys *iws)
 }
 
 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;
index bd4dcfc9be7b63cc2cdf1adb39b3034475cc2f1a..87ee8070b1d0907f9d4d7b2ab6bafed21027e578 100644 (file)
@@ -53,23 +53,13 @@ i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws)
 }
 
 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;
index 8d981b22e3d5a46023d6a2f7af14cf3e549b5593..59f1b10230e3af915c7f296143832e350001e724 100644 (file)
@@ -153,9 +153,7 @@ static void do_ioctls(int fd, struct radeon_libdrm_winsys* winsys)
 }
 
 /* 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;
index 78451b6f011c0f11cefb6655b723d5ba3c6d9025..3544c926d9975c07328151b53e37abb4c50d66f9 100644 (file)
@@ -33,9 +33,7 @@
 #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);
 
index 4a710564b435c39dc2c065bfcf911751c8258d59..fe285226918cd26fb3cc9ac22f47c1d98e6309e3 100644 (file)
@@ -89,44 +89,31 @@ vmw_dri1_check_version(const struct dri1_api_version *cur,
  * 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)
index 2ccde610e606eed9facdc9c49135ff52449b3708..7b86382619ea90341c9d6b0318399e80907bd67c 100644 (file)
@@ -56,15 +56,14 @@ sw_drm_api(struct drm_api *api)
 
 
 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;