Skip to content

Commit

Permalink
fixup drm/host1x
Browse files Browse the repository at this point in the history
  • Loading branch information
digetx committed Jan 19, 2021
1 parent 14b65ff commit 024cba3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/tegra/gr3d.c
Expand Up @@ -161,10 +161,16 @@ static int gr3d_is_addr_reg(struct device *dev, u32 class, u32 offset)
return 0;
}

static int gr3d_is_valid_class(u32 class)
{
return (class == HOST1X_CLASS_GR3D);
}

static const struct tegra_drm_client_ops gr3d_ops = {
.open_channel = gr3d_open_channel,
.close_channel = gr3d_close_channel,
.is_addr_reg = gr3d_is_addr_reg,
.is_valid_class = gr3d_is_valid_class,
.submit = tegra_drm_submit,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/tegra/uapi/submit.c
Expand Up @@ -303,7 +303,7 @@ static int submit_create_job(struct drm_device *drm, struct host1x_job **pjob,
}

host1x_job_add_wait(job, cmd->wait_syncpt.id,
cmd->wait_syncpt.threshold);
cmd->wait_syncpt.threshold, class);
} else {
err = -EINVAL;
goto free_job;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/host1x/hw/channel_hw.c
Expand Up @@ -66,7 +66,7 @@ static void submit_gathers(struct host1x_job *job)
host1x_class_host_wait_syncpt(cmd->wait.id,
cmd->wait.threshold));
host1x_cdma_push(
cdma, host1x_opcode_setclass(job->class, 0, 0),
cdma, host1x_opcode_setclass(cmd->class, 0, 0),
HOST1X_OPCODE_NOP);
} else {
struct host1x_job_gather *g = &cmd->gather;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/host1x/job.c
Expand Up @@ -111,10 +111,11 @@ void host1x_job_add_gather(struct host1x_job *job, struct host1x_bo *bo,
}
EXPORT_SYMBOL(host1x_job_add_gather);

void host1x_job_add_wait(struct host1x_job *job, u32 id, u32 thresh)
void host1x_job_add_wait(struct host1x_job *job, u32 id, u32 thresh, u32 class)
{
struct host1x_job_cmd *cmd = &job->cmds[job->num_cmds];

cmd->class = class;
cmd->is_wait = true;
cmd->wait.id = id;
cmd->wait.threshold = thresh;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/host1x/job.h
Expand Up @@ -25,6 +25,7 @@ struct host1x_job_wait {

struct host1x_job_cmd {
bool is_wait;
unsigned int class;

union {
struct host1x_job_gather gather;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/host1x.h
Expand Up @@ -279,7 +279,7 @@ struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
u32 num_cmdbufs, u32 num_relocs);
void host1x_job_add_gather(struct host1x_job *job, struct host1x_bo *bo,
unsigned int words, unsigned int offset);
void host1x_job_add_wait(struct host1x_job *job, u32 id, u32 thresh);
void host1x_job_add_wait(struct host1x_job *job, u32 id, u32 thresh, u32 class);
struct host1x_job *host1x_job_get(struct host1x_job *job);
void host1x_job_put(struct host1x_job *job);
int host1x_job_pin(struct host1x_job *job, struct device *dev);
Expand Down

0 comments on commit 024cba3

Please sign in to comment.