diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/host1x/drm/drm.c | 26 | ||||
| -rw-r--r-- | drivers/gpu/host1x/drm/drm.h | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/host1x/drm/drm.c b/drivers/gpu/host1x/drm/drm.c index 8cd45c8592bb..f057cbad2ebe 100644 --- a/drivers/gpu/host1x/drm/drm.c +++ b/drivers/gpu/host1x/drm/drm.c | |||
| @@ -30,6 +30,10 @@ | |||
| 30 | #define DRIVER_MINOR 0 | 30 | #define DRIVER_MINOR 0 |
| 31 | #define DRIVER_PATCHLEVEL 0 | 31 | #define DRIVER_PATCHLEVEL 0 |
| 32 | 32 | ||
| 33 | struct tegra_drm_file { | ||
| 34 | struct list_head contexts; | ||
| 35 | }; | ||
| 36 | |||
| 33 | struct host1x_subdev { | 37 | struct host1x_subdev { |
| 34 | struct host1x_client *client; | 38 | struct host1x_client *client; |
| 35 | struct device_node *np; | 39 | struct device_node *np; |
| @@ -290,7 +294,7 @@ static int tegra_drm_unload(struct drm_device *drm) | |||
| 290 | 294 | ||
| 291 | static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) | 295 | static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) |
| 292 | { | 296 | { |
| 293 | struct host1x_drm_file *fpriv; | 297 | struct tegra_drm_file *fpriv; |
| 294 | 298 | ||
| 295 | fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); | 299 | fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); |
| 296 | if (!fpriv) | 300 | if (!fpriv) |
| @@ -316,8 +320,8 @@ static void tegra_drm_lastclose(struct drm_device *drm) | |||
| 316 | } | 320 | } |
| 317 | 321 | ||
| 318 | #ifdef CONFIG_DRM_TEGRA_STAGING | 322 | #ifdef CONFIG_DRM_TEGRA_STAGING |
| 319 | static bool host1x_drm_file_owns_context(struct host1x_drm_file *file, | 323 | static bool tegra_drm_file_owns_context(struct tegra_drm_file *file, |
| 320 | struct host1x_drm_context *context) | 324 | struct host1x_drm_context *context) |
| 321 | { | 325 | { |
| 322 | struct host1x_drm_context *ctx; | 326 | struct host1x_drm_context *ctx; |
| 323 | 327 | ||
| @@ -406,7 +410,7 @@ static int tegra_syncpt_wait(struct drm_device *drm, void *data, | |||
| 406 | static int tegra_open_channel(struct drm_device *drm, void *data, | 410 | static int tegra_open_channel(struct drm_device *drm, void *data, |
| 407 | struct drm_file *file) | 411 | struct drm_file *file) |
| 408 | { | 412 | { |
| 409 | struct host1x_drm_file *fpriv = file->driver_priv; | 413 | struct tegra_drm_file *fpriv = file->driver_priv; |
| 410 | struct tegra_drm *tegra = drm->dev_private; | 414 | struct tegra_drm *tegra = drm->dev_private; |
| 411 | struct drm_tegra_open_channel *args = data; | 415 | struct drm_tegra_open_channel *args = data; |
| 412 | struct host1x_drm_context *context; | 416 | struct host1x_drm_context *context; |
| @@ -437,11 +441,11 @@ static int tegra_close_channel(struct drm_device *drm, void *data, | |||
| 437 | struct drm_file *file) | 441 | struct drm_file *file) |
| 438 | { | 442 | { |
| 439 | struct drm_tegra_close_channel *args = data; | 443 | struct drm_tegra_close_channel *args = data; |
| 440 | struct host1x_drm_file *fpriv = file->driver_priv; | 444 | struct tegra_drm_file *fpriv = file->driver_priv; |
| 441 | struct host1x_drm_context *context = | 445 | struct host1x_drm_context *context = |
| 442 | (struct host1x_drm_context *)(uintptr_t)args->context; | 446 | (struct host1x_drm_context *)(uintptr_t)args->context; |
| 443 | 447 | ||
| 444 | if (!host1x_drm_file_owns_context(fpriv, context)) | 448 | if (!tegra_drm_file_owns_context(fpriv, context)) |
| 445 | return -EINVAL; | 449 | return -EINVAL; |
| 446 | 450 | ||
| 447 | list_del(&context->list); | 451 | list_del(&context->list); |
| @@ -453,13 +457,13 @@ static int tegra_close_channel(struct drm_device *drm, void *data, | |||
| 453 | static int tegra_get_syncpt(struct drm_device *drm, void *data, | 457 | static int tegra_get_syncpt(struct drm_device *drm, void *data, |
| 454 | struct drm_file *file) | 458 | struct drm_file *file) |
| 455 | { | 459 | { |
| 460 | struct tegra_drm_file *fpriv = file->driver_priv; | ||
| 456 | struct drm_tegra_get_syncpt *args = data; | 461 | struct drm_tegra_get_syncpt *args = data; |
| 457 | struct host1x_drm_file *fpriv = file->driver_priv; | ||
| 458 | struct host1x_drm_context *context = | 462 | struct host1x_drm_context *context = |
| 459 | (struct host1x_drm_context *)(uintptr_t)args->context; | 463 | (struct host1x_drm_context *)(uintptr_t)args->context; |
| 460 | struct host1x_syncpt *syncpt; | 464 | struct host1x_syncpt *syncpt; |
| 461 | 465 | ||
| 462 | if (!host1x_drm_file_owns_context(fpriv, context)) | 466 | if (!tegra_drm_file_owns_context(fpriv, context)) |
| 463 | return -ENODEV; | 467 | return -ENODEV; |
| 464 | 468 | ||
| 465 | if (args->index >= context->client->num_syncpts) | 469 | if (args->index >= context->client->num_syncpts) |
| @@ -474,12 +478,12 @@ static int tegra_get_syncpt(struct drm_device *drm, void *data, | |||
| 474 | static int tegra_submit(struct drm_device *drm, void *data, | 478 | static int tegra_submit(struct drm_device *drm, void *data, |
| 475 | struct drm_file *file) | 479 | struct drm_file *file) |
| 476 | { | 480 | { |
| 481 | struct tegra_drm_file *fpriv = file->driver_priv; | ||
| 477 | struct drm_tegra_submit *args = data; | 482 | struct drm_tegra_submit *args = data; |
| 478 | struct host1x_drm_file *fpriv = file->driver_priv; | ||
| 479 | struct host1x_drm_context *context = | 483 | struct host1x_drm_context *context = |
| 480 | (struct host1x_drm_context *)(uintptr_t)args->context; | 484 | (struct host1x_drm_context *)(uintptr_t)args->context; |
| 481 | 485 | ||
| 482 | if (!host1x_drm_file_owns_context(fpriv, context)) | 486 | if (!tegra_drm_file_owns_context(fpriv, context)) |
| 483 | return -ENODEV; | 487 | return -ENODEV; |
| 484 | 488 | ||
| 485 | return context->client->ops->submit(context, args, drm, file); | 489 | return context->client->ops->submit(context, args, drm, file); |
| @@ -558,7 +562,7 @@ static void tegra_drm_disable_vblank(struct drm_device *drm, int pipe) | |||
| 558 | 562 | ||
| 559 | static void tegra_drm_preclose(struct drm_device *drm, struct drm_file *file) | 563 | static void tegra_drm_preclose(struct drm_device *drm, struct drm_file *file) |
| 560 | { | 564 | { |
| 561 | struct host1x_drm_file *fpriv = file->driver_priv; | 565 | struct tegra_drm_file *fpriv = file->driver_priv; |
| 562 | struct host1x_drm_context *context, *tmp; | 566 | struct host1x_drm_context *context, *tmp; |
| 563 | struct drm_crtc *crtc; | 567 | struct drm_crtc *crtc; |
| 564 | 568 | ||
diff --git a/drivers/gpu/host1x/drm/drm.h b/drivers/gpu/host1x/drm/drm.h index 858bfc0db78a..74869d3e2d8c 100644 --- a/drivers/gpu/host1x/drm/drm.h +++ b/drivers/gpu/host1x/drm/drm.h | |||
| @@ -63,10 +63,6 @@ struct host1x_client_ops { | |||
| 63 | struct drm_file *file); | 63 | struct drm_file *file); |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| 66 | struct host1x_drm_file { | ||
| 67 | struct list_head contexts; | ||
| 68 | }; | ||
| 69 | |||
| 70 | struct host1x_client { | 66 | struct host1x_client { |
| 71 | struct tegra_drm *tegra; | 67 | struct tegra_drm *tegra; |
| 72 | struct device *dev; | 68 | struct device *dev; |
