diff options
author | Dave Airlie <airlied@redhat.com> | 2017-10-24 16:50:45 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-10-24 16:50:45 +1000 |
commit | 3b677e43c1191de4717357ffeb85a30b967045e4 (patch) | |
tree | 076e053e367e3b6525614808f3d8c81e77b434ca /drivers/gpu/host1x/syncpt.c | |
parent | 3064abfa932bd09faf8da01741d171d476cf7193 (diff) | |
parent | fb83be8873909ba7c089d1c5cb72873cc2cce7d1 (diff) |
Merge tag 'drm/tegra/for-4.15-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v4.15-rc1
This contains a bit of cleanup and some minor fixes for the host1x and
Tegra DRM drivers. There's also some more preparatory work for Tegra186
support which I'm not quite ready to send upstream because the GPIO
driver needed for HDMI support has been stuck for months, and we can't
do much without it. Hopefully that driver will land in v4.15, which
would mean we could go ahead with Tegra186 display support in v4.16.
* tag 'drm/tegra/for-4.15-rc1' of git://anongit.freedesktop.org/tegra/linux: (21 commits)
drm/tegra: hdmi: Add cec-notifier support
drm/tegra: dc: Perform a complete reset sequence
drm/tegra: dc: Make sure to set the module clock rate
drm/tegra: dc: Simplify atomic plane helper functions
drm/tegra: dc: Move some declarations to dc.h
drm/tegra: vic: Use of_device_get_match_data()
drm/tegra: sor: Use of_device_get_match_data()
drm/tegra: hdmi: Use of_device_get_match_data()
drm/tegra: dc: Use of_device_get_match_data()
drm/tegra: Use u64_to_user_ptr helper
gpu: host1x: Fix incorrect comment for channel_request
gpu: host1x: Disassemble more instructions
gpu: host1x: Improve debug disassembly formatting
gpu: host1x: Enable gather filter
gpu: host1x: Enable Tegra186 syncpoint protection
gpu: host1x: Call of_dma_configure() after setting bus
drm/tegra: Add Tegra186 support for VIC
gpu: host1x: Add Tegra186 support
dt-bindings: host1x: Add Tegra186 information
gpu: host1x: syncpt: Request syncpoints per client
...
Diffstat (limited to 'drivers/gpu/host1x/syncpt.c')
-rw-r--r-- | drivers/gpu/host1x/syncpt.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 048ac9e344ce..a2a952adc136 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -54,7 +54,7 @@ static void host1x_syncpt_base_free(struct host1x_syncpt_base *base) } static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host, - struct device *dev, + struct host1x_client *client, unsigned long flags) { int i; @@ -76,11 +76,11 @@ static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host, } name = kasprintf(GFP_KERNEL, "%02u-%s", sp->id, - dev ? dev_name(dev) : NULL); + client ? dev_name(client->dev) : NULL); if (!name) goto free_base; - sp->dev = dev; + sp->client = client; sp->name = name; if (flags & HOST1X_SYNCPT_CLIENT_MANAGED) @@ -398,6 +398,13 @@ int host1x_syncpt_init(struct host1x *host) for (i = 0; i < host->info->nb_pts; i++) { syncpt[i].id = i; syncpt[i].host = host; + + /* + * Unassign syncpt from channels for purposes of Tegra186 + * syncpoint protection. This prevents any channel from + * accessing it until it is reassigned. + */ + host1x_hw_syncpt_assign_to_channel(host, &syncpt[i], NULL); } for (i = 0; i < host->info->nb_bases; i++) @@ -408,6 +415,7 @@ int host1x_syncpt_init(struct host1x *host) host->bases = bases; host1x_syncpt_restore(host); + host1x_hw_syncpt_enable_protection(host); /* Allocate sync point to use for clearing waits for expired fences */ host->nop_sp = host1x_syncpt_alloc(host, NULL, 0); @@ -419,7 +427,7 @@ int host1x_syncpt_init(struct host1x *host) /** * host1x_syncpt_request() - request a syncpoint - * @dev: device requesting the syncpoint + * @client: client requesting the syncpoint * @flags: flags * * host1x client drivers can use this function to allocate a syncpoint for @@ -427,12 +435,12 @@ int host1x_syncpt_init(struct host1x *host) * use by the client exclusively. When no longer using a syncpoint, a host1x * client driver needs to release it using host1x_syncpt_free(). */ -struct host1x_syncpt *host1x_syncpt_request(struct device *dev, +struct host1x_syncpt *host1x_syncpt_request(struct host1x_client *client, unsigned long flags) { - struct host1x *host = dev_get_drvdata(dev->parent); + struct host1x *host = dev_get_drvdata(client->parent->parent); - return host1x_syncpt_alloc(host, dev, flags); + return host1x_syncpt_alloc(host, client, flags); } EXPORT_SYMBOL(host1x_syncpt_request); @@ -456,7 +464,7 @@ void host1x_syncpt_free(struct host1x_syncpt *sp) host1x_syncpt_base_free(sp->base); kfree(sp->name); sp->base = NULL; - sp->dev = NULL; + sp->client = NULL; sp->name = NULL; sp->client_managed = false; |