summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/identity
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/identity')
-rw-r--r--src/gallium/drivers/identity/id_context.c2
-rw-r--r--src/gallium/drivers/identity/id_context.h4
-rw-r--r--src/gallium/drivers/identity/id_drm.c17
-rw-r--r--src/gallium/drivers/identity/id_public.h3
-rw-r--r--src/gallium/drivers/identity/id_screen.c16
5 files changed, 21 insertions, 21 deletions
diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c
index f9063d90fb..40962a3ccf 100644
--- a/src/gallium/drivers/identity/id_context.c
+++ b/src/gallium/drivers/identity/id_context.c
@@ -692,7 +692,7 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
id_pipe->base.winsys = NULL;
id_pipe->base.screen = _screen;
- id_pipe->base.priv = pipe->priv;
+ id_pipe->base.priv = pipe->priv; /* expose wrapped data */
id_pipe->base.draw = NULL;
id_pipe->base.destroy = identity_destroy;
diff --git a/src/gallium/drivers/identity/id_context.h b/src/gallium/drivers/identity/id_context.h
index 75b73fc7df..6d3c1899d5 100644
--- a/src/gallium/drivers/identity/id_context.h
+++ b/src/gallium/drivers/identity/id_context.h
@@ -39,6 +39,10 @@ struct identity_context {
};
+struct pipe_context *
+identity_context_create(struct pipe_screen *screen, struct pipe_context *pipe);
+
+
static INLINE struct identity_context *
identity_context(struct pipe_context *pipe)
{
diff --git a/src/gallium/drivers/identity/id_drm.c b/src/gallium/drivers/identity/id_drm.c
index 14f68ac0d0..12b516b445 100644
--- a/src/gallium/drivers/identity/id_drm.c
+++ b/src/gallium/drivers/identity/id_drm.c
@@ -63,22 +63,6 @@ identity_drm_create_screen(struct drm_api *_api, int fd,
return identity_screen_create(screen);
}
-static struct pipe_context *
-identity_drm_create_context(struct drm_api *_api,
- struct pipe_screen *_screen)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_drm_api *id_api = identity_drm_api(_api);
- struct pipe_screen *screen = id_screen->screen;
- struct drm_api *api = id_api->api;
- struct pipe_context *pipe;
-
- pipe = api->create_context(api, screen);
-
- pipe = identity_context_create(_screen, pipe);
-
- return pipe;
-}
static struct pipe_texture *
identity_drm_texture_from_shared_handle(struct drm_api *_api,
@@ -159,7 +143,6 @@ identity_drm_create(struct drm_api *api)
goto error;
id_api->base.create_screen = identity_drm_create_screen;
- id_api->base.create_context = identity_drm_create_context;
id_api->base.texture_from_shared_handle = identity_drm_texture_from_shared_handle;
id_api->base.shared_handle_from_texture = identity_drm_shared_handle_from_texture;
id_api->base.local_handle_from_texture = identity_drm_local_handle_from_texture;
diff --git a/src/gallium/drivers/identity/id_public.h b/src/gallium/drivers/identity/id_public.h
index 3d2862eaa0..d0d5847c61 100644
--- a/src/gallium/drivers/identity/id_public.h
+++ b/src/gallium/drivers/identity/id_public.h
@@ -34,7 +34,4 @@ struct pipe_context;
struct pipe_screen *
identity_screen_create(struct pipe_screen *screen);
-struct pipe_context *
-identity_context_create(struct pipe_screen *screen, struct pipe_context *pipe);
-
#endif /* ID_PUBLIC_H */
diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c
index 53eae3ef54..b85492114a 100644
--- a/src/gallium/drivers/identity/id_screen.c
+++ b/src/gallium/drivers/identity/id_screen.c
@@ -32,6 +32,7 @@
#include "id_public.h"
#include "id_screen.h"
+#include "id_context.h"
#include "id_objects.h"
@@ -103,6 +104,20 @@ identity_screen_is_format_supported(struct pipe_screen *_screen,
geom_flags);
}
+static struct pipe_context *
+identity_screen_context_create(struct pipe_screen *_screen,
+ void *priv)
+{
+ struct identity_screen *id_screen = identity_screen(_screen);
+ struct pipe_screen *screen = id_screen->screen;
+ struct pipe_context *result;
+
+ result = screen->context_create(screen, priv);
+ if (result)
+ return identity_context_create(_screen, result);
+ return NULL;
+}
+
static struct pipe_texture *
identity_screen_texture_create(struct pipe_screen *_screen,
const struct pipe_texture *templat)
@@ -478,6 +493,7 @@ identity_screen_create(struct pipe_screen *screen)
id_screen->base.get_param = identity_screen_get_param;
id_screen->base.get_paramf = identity_screen_get_paramf;
id_screen->base.is_format_supported = identity_screen_is_format_supported;
+ id_screen->base.context_create = identity_screen_context_create;
id_screen->base.texture_create = identity_screen_texture_create;
id_screen->base.texture_blanket = identity_screen_texture_blanket;
id_screen->base.texture_destroy = identity_screen_texture_destroy;