Commit bf3d41cc authored by Thierry Reding's avatar Thierry Reding

gpu: host1x: Store pointer to client in jobs

Rather than storing some identifier derived from the application
context that can't be used concretely anywhere, store a pointer to the
client directly so that accesses can be made directly through that
client object.
Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
Tested-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 24c94e16
...@@ -325,6 +325,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, ...@@ -325,6 +325,7 @@ int tegra_drm_submit(struct tegra_drm_context *context,
struct drm_tegra_submit *args, struct drm_device *drm, struct drm_tegra_submit *args, struct drm_device *drm,
struct drm_file *file) struct drm_file *file)
{ {
struct host1x_client *client = &context->client->base;
unsigned int num_cmdbufs = args->num_cmdbufs; unsigned int num_cmdbufs = args->num_cmdbufs;
unsigned int num_relocs = args->num_relocs; unsigned int num_relocs = args->num_relocs;
struct drm_tegra_cmdbuf __user *user_cmdbufs; struct drm_tegra_cmdbuf __user *user_cmdbufs;
...@@ -356,8 +357,8 @@ int tegra_drm_submit(struct tegra_drm_context *context, ...@@ -356,8 +357,8 @@ int tegra_drm_submit(struct tegra_drm_context *context,
return -ENOMEM; return -ENOMEM;
job->num_relocs = args->num_relocs; job->num_relocs = args->num_relocs;
job->client = (u32)args->context; job->client = client;
job->class = context->client->base.class; job->class = client->class;
job->serialize = true; job->serialize = true;
/* /*
......
...@@ -247,7 +247,7 @@ static void cdma_start_timer_locked(struct host1x_cdma *cdma, ...@@ -247,7 +247,7 @@ static void cdma_start_timer_locked(struct host1x_cdma *cdma,
static void stop_cdma_timer_locked(struct host1x_cdma *cdma) static void stop_cdma_timer_locked(struct host1x_cdma *cdma)
{ {
cancel_delayed_work(&cdma->timeout.wq); cancel_delayed_work(&cdma->timeout.wq);
cdma->timeout.client = 0; cdma->timeout.client = NULL;
} }
/* /*
......
...@@ -58,7 +58,7 @@ struct buffer_timeout { ...@@ -58,7 +58,7 @@ struct buffer_timeout {
u32 syncpt_val; /* syncpt value when completed */ u32 syncpt_val; /* syncpt value when completed */
ktime_t start_ktime; /* starting time */ ktime_t start_ktime; /* starting time */
/* context timeout information */ /* context timeout information */
int client; struct host1x_client *client;
}; };
enum cdma_event { enum cdma_event {
......
...@@ -202,7 +202,8 @@ struct host1x_job { ...@@ -202,7 +202,8 @@ struct host1x_job {
/* Channel where job is submitted to */ /* Channel where job is submitted to */
struct host1x_channel *channel; struct host1x_channel *channel;
u32 client; /* client where the job originated */
struct host1x_client *client;
/* Gathers and their memory */ /* Gathers and their memory */
struct host1x_job_gather *gathers; struct host1x_job_gather *gathers;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment