summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-01-25 12:07:39 +0800
committerChia-I Wu <olvaffe@gmail.com>2010-01-25 12:07:54 +0800
commite626a737bdbc9449db52b9447f81bd7c54ebc176 (patch)
tree18b1940b329d049f0e65697c2e5a56eb23b14765
parent0ea9ac2c69f70168a2bd8b22ecc31c03014485ca (diff)
Simplify lock_resource/unlock_resource.
They were designed for future extension without breaking the ABI. Let's keep it simple for now.
-rw-r--r--DESIGN10
-rw-r--r--st_api.h50
2 files changed, 4 insertions, 56 deletions
diff --git a/DESIGN b/DESIGN
index e9d3956..e16ae52 100644
--- a/DESIGN
+++ b/DESIGN
@@ -32,16 +32,6 @@ Issues
lock/unlock a bad name. But it does has the benefit to track the access
to the resources.
- The prototypes of lock_resource/unlock_resource is designed for flexibility.
- It allows future extension without breaking the ABI. If that is not a
- concern (see issue 5),
-
- void *(*lock_resource)(res_type, void *res);
- void (*unlock_resource)(res_type, void *res);
-
- suffice. And struct st_*_resouce can be removed. It is a possible
- simplification.
-
Another approach is to provide a single lookup_resource call, and make
functions like eglCreatePbufferFromClientBuffer, which requires a real
locking mechanism, special cases.
diff --git a/st_api.h b/st_api.h
index c217aff..d241eac 100644
--- a/st_api.h
+++ b/st_api.h
@@ -166,26 +166,6 @@ struct st_framebuffer
};
/**
- * Represent a state tracker context resource.
- *
- * The input and output depend on the resource type.
- */
-struct st_context_resource
-{
- enum st_context_resource_type type;
-
- const union {
- unsigned int u;
- long l;
- void *ptr;
- } in;
-
- union {
- struct pipe_texture *pipe_texture;
- } out;
-};
-
-/**
* Represent a rendering context.
*
* This entity is created from st_api and used by the state tracker manager.
@@ -198,10 +178,8 @@ struct st_context
* This gives access to the underlying data structure of a state tracker
* context resource.
*/
- boolean (*lock_resource)(struct st_context *ctx,
- struct st_context_resource *res);
- void (*unlock_resource)(struct st_context *ctx,
- const struct st_context_resource *res);
+ void *(*lock_resource)(struct st_context *ctx, void *res);
+ void (*unlock_resource)(struct st_context *ctx, void *res);
/**
* Invalidate the current textures that was taken from a framebuffer.
@@ -293,24 +271,6 @@ struct st_api
};
/**
- * Represent a state tracker manager resource.
- *
- * The input and output depend on the resource type.
- */
-struct st_manager_resource
-{
- enum st_manager_resource_type type;
-
- const union {
- void *ptr;
- } in;
-
- union {
- struct pipe_texture *pipe_texture;
- } out;
-};
-
-/**
* Represent a state tracker manager.
*
* This interface is implemented by the state tracker manager.
@@ -323,10 +283,8 @@ struct st_manager_api
* This gives access to the underlying data structure of a state tracker
* manager resource.
*/
- boolean (*lock_resource)(const struct st_manager_api *smapi,
- struct st_manager_resource *smres);
- void (*unlock_resource)(const struct st_manager_api *smapi,
- const struct st_manager_resource *smres);
+ void *(*lock_resource)(const struct st_manager_api *smapi, void *res);
+ void (*unlock_resource)(const struct st_manager_api *smapi, void *res);
};
/**