virgl: move private data to virgl_resource

Move vrend_resource::priv to virgl_resource::private_data.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 5 years ago
parent b16105b25c
commit 29c103d729
  1. 2
      src/virgl_resource.h
  2. 13
      src/virglrenderer.c
  3. 18
      src/vrend_renderer.c
  4. 3
      src/vrend_renderer.h

@ -40,6 +40,8 @@ struct pipe_resource;
struct virgl_resource {
uint32_t res_id;
void *private_data;
struct pipe_resource *pipe_resource;
};

@ -39,6 +39,7 @@
#include "virglrenderer.h"
#include "virgl_context.h"
#include "virgl_resource.h"
#ifdef HAVE_EPOXY_EGL_H
#include "virgl_gbm.h"
@ -68,12 +69,20 @@ int virgl_renderer_resource_import_eglimage(struct virgl_renderer_resource_creat
void virgl_renderer_resource_set_priv(uint32_t res_handle, void *priv)
{
vrend_renderer_resource_set_priv(res_handle, priv);
struct virgl_resource *res = virgl_resource_lookup(res_handle);
if (!res)
return;
res->private_data = priv;
}
void *virgl_renderer_resource_get_priv(uint32_t res_handle)
{
return vrend_renderer_resource_get_priv(res_handle);
struct virgl_resource *res = virgl_resource_lookup(res_handle);
if (!res)
return NULL;
return res->private_data;
}
void virgl_renderer_resource_unref(uint32_t res_handle)

@ -10051,24 +10051,6 @@ void vrend_renderer_get_rect(int res_handle, struct iovec *iov, unsigned int num
vrend_renderer_transfer_iov(&transfer_info, VIRGL_TRANSFER_FROM_HOST);
}
void vrend_renderer_resource_set_priv(uint32_t res_handle, void *priv)
{
struct vrend_resource *res = vrend_renderer_res_lookup(res_handle);
if (!res)
return;
res->priv = priv;
}
void *vrend_renderer_resource_get_priv(uint32_t res_handle)
{
struct vrend_resource *res = vrend_renderer_res_lookup(res_handle);
if (!res)
return NULL;
return res->priv;
}
void vrend_renderer_attach_res_ctx(struct vrend_context *ctx, int resource_id)
{
struct vrend_resource *res;

@ -90,7 +90,6 @@ struct vrend_resource {
GLuint handle;
void *priv;
/* Pointer to system memory storage for this resource. Only valid for
* VREND_RESOURCE_STORAGE_GUEST_ELSE_SYSTEM buffer storage.
*/
@ -186,8 +185,6 @@ struct vrend_renderer_resource_create_args {
int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *args, struct iovec *iov, uint32_t num_iovs, void *image_eos);
void vrend_renderer_resource_unref(uint32_t handle);
void vrend_renderer_resource_set_priv(uint32_t res_handle, void *priv);
void *vrend_renderer_resource_get_priv(uint32_t res_handle);
int vrend_create_surface(struct vrend_context *ctx,
uint32_t handle,

Loading…
Cancel
Save