aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-11-04 20:07:03 -0500
committerDave Airlie <airlied@redhat.com>2015-11-04 20:07:03 -0500
commit596a1d32bb42795cafbed66945645a74f0a3cc5b (patch)
treeabeb18475d003082882d84f26206d67278dc2b81
parentcb0fb271213e8a06ca8815a459dfaddd5bb47b4b (diff)
parent2bcdcbfae2895764372ef973a969f395a548f1ea (diff)
Merge tag 'drm/tegra/for-4.4-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v4.4-rc1 Just a couple of minor fixes and cleanups for this cycle. * tag 'drm/tegra/for-4.4-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: dc: Request/free syncpoint at init/exit drm/tegra: fb: Remove gratuituous blank line gpu: host1x: Fix MLOCK's debug info
-rw-r--r--drivers/gpu/drm/tegra/dc.c14
-rw-r--r--drivers/gpu/drm/tegra/fb.c1
-rw-r--r--drivers/gpu/host1x/hw/debug_hw.c2
-rw-r--r--drivers/gpu/host1x/hw/hw_host1x01_sync.h8
-rw-r--r--drivers/gpu/host1x/hw/hw_host1x02_sync.h8
-rw-r--r--drivers/gpu/host1x/hw/hw_host1x04_sync.h8
6 files changed, 20 insertions, 21 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index b4af4ab9ce6b..e9f24a85a103 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1694,6 +1694,7 @@ static int tegra_dc_debugfs_exit(struct tegra_dc *dc)
1694static int tegra_dc_init(struct host1x_client *client) 1694static int tegra_dc_init(struct host1x_client *client)
1695{ 1695{
1696 struct drm_device *drm = dev_get_drvdata(client->parent); 1696 struct drm_device *drm = dev_get_drvdata(client->parent);
1697 unsigned long flags = HOST1X_SYNCPT_CLIENT_MANAGED;
1697 struct tegra_dc *dc = host1x_client_to_dc(client); 1698 struct tegra_dc *dc = host1x_client_to_dc(client);
1698 struct tegra_drm *tegra = drm->dev_private; 1699 struct tegra_drm *tegra = drm->dev_private;
1699 struct drm_plane *primary = NULL; 1700 struct drm_plane *primary = NULL;
@@ -1701,6 +1702,10 @@ static int tegra_dc_init(struct host1x_client *client)
1701 u32 value; 1702 u32 value;
1702 int err; 1703 int err;
1703 1704
1705 dc->syncpt = host1x_syncpt_request(dc->dev, flags);
1706 if (!dc->syncpt)
1707 dev_warn(dc->dev, "failed to allocate syncpoint\n");
1708
1704 if (tegra->domain) { 1709 if (tegra->domain) {
1705 err = iommu_attach_device(tegra->domain, dc->dev); 1710 err = iommu_attach_device(tegra->domain, dc->dev);
1706 if (err < 0) { 1711 if (err < 0) {
@@ -1847,6 +1852,8 @@ static int tegra_dc_exit(struct host1x_client *client)
1847 dc->domain = NULL; 1852 dc->domain = NULL;
1848 } 1853 }
1849 1854
1855 host1x_syncpt_free(dc->syncpt);
1856
1850 return 0; 1857 return 0;
1851} 1858}
1852 1859
@@ -1959,7 +1966,6 @@ static int tegra_dc_parse_dt(struct tegra_dc *dc)
1959 1966
1960static int tegra_dc_probe(struct platform_device *pdev) 1967static int tegra_dc_probe(struct platform_device *pdev)
1961{ 1968{
1962 unsigned long flags = HOST1X_SYNCPT_CLIENT_MANAGED;
1963 const struct of_device_id *id; 1969 const struct of_device_id *id;
1964 struct resource *regs; 1970 struct resource *regs;
1965 struct tegra_dc *dc; 1971 struct tegra_dc *dc;
@@ -2034,10 +2040,6 @@ static int tegra_dc_probe(struct platform_device *pdev)
2034 return -ENXIO; 2040 return -ENXIO;
2035 } 2041 }
2036 2042
2037 dc->syncpt = host1x_syncpt_request(&pdev->dev, flags);
2038 if (!dc->syncpt)
2039 dev_warn(&pdev->dev, "failed to allocate syncpoint\n");
2040
2041 INIT_LIST_HEAD(&dc->client.list); 2043 INIT_LIST_HEAD(&dc->client.list);
2042 dc->client.ops = &dc_client_ops; 2044 dc->client.ops = &dc_client_ops;
2043 dc->client.dev = &pdev->dev; 2045 dc->client.dev = &pdev->dev;
@@ -2065,8 +2067,6 @@ static int tegra_dc_remove(struct platform_device *pdev)
2065 struct tegra_dc *dc = platform_get_drvdata(pdev); 2067 struct tegra_dc *dc = platform_get_drvdata(pdev);
2066 int err; 2068 int err;
2067 2069
2068 host1x_syncpt_free(dc->syncpt);
2069
2070 err = host1x_client_unregister(&dc->client); 2070 err = host1x_client_unregister(&dc->client);
2071 if (err < 0) { 2071 if (err < 0) {
2072 dev_err(&pdev->dev, "failed to unregister host1x client: %d\n", 2072 dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index 07c844b746b4..1004075fd088 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -341,7 +341,6 @@ fini:
341 341
342static void tegra_fbdev_exit(struct tegra_fbdev *fbdev) 342static void tegra_fbdev_exit(struct tegra_fbdev *fbdev)
343{ 343{
344
345 drm_fb_helper_unregister_fbi(&fbdev->base); 344 drm_fb_helper_unregister_fbi(&fbdev->base);
346 drm_fb_helper_release_fbi(&fbdev->base); 345 drm_fb_helper_release_fbi(&fbdev->base);
347 346
diff --git a/drivers/gpu/host1x/hw/debug_hw.c b/drivers/gpu/host1x/hw/debug_hw.c
index 791de9351eeb..cc3f1825c735 100644
--- a/drivers/gpu/host1x/hw/debug_hw.c
+++ b/drivers/gpu/host1x/hw/debug_hw.c
@@ -298,7 +298,7 @@ static void host1x_debug_show_mlocks(struct host1x *host, struct output *o)
298 host1x_sync_readl(host, HOST1X_SYNC_MLOCK_OWNER(i)); 298 host1x_sync_readl(host, HOST1X_SYNC_MLOCK_OWNER(i));
299 if (HOST1X_SYNC_MLOCK_OWNER_CH_OWNS_V(owner)) 299 if (HOST1X_SYNC_MLOCK_OWNER_CH_OWNS_V(owner))
300 host1x_debug_output(o, "%d: locked by channel %d\n", 300 host1x_debug_output(o, "%d: locked by channel %d\n",
301 i, HOST1X_SYNC_MLOCK_OWNER_CHID_F(owner)); 301 i, HOST1X_SYNC_MLOCK_OWNER_CHID_V(owner));
302 else if (HOST1X_SYNC_MLOCK_OWNER_CPU_OWNS_V(owner)) 302 else if (HOST1X_SYNC_MLOCK_OWNER_CPU_OWNS_V(owner))
303 host1x_debug_output(o, "%d: locked by cpu\n", i); 303 host1x_debug_output(o, "%d: locked by cpu\n", i);
304 else 304 else
diff --git a/drivers/gpu/host1x/hw/hw_host1x01_sync.h b/drivers/gpu/host1x/hw/hw_host1x01_sync.h
index ac704e579977..31238c285d46 100644
--- a/drivers/gpu/host1x/hw/hw_host1x01_sync.h
+++ b/drivers/gpu/host1x/hw/hw_host1x01_sync.h
@@ -131,12 +131,12 @@ static inline u32 host1x_sync_mlock_owner_r(unsigned int id)
131} 131}
132#define HOST1X_SYNC_MLOCK_OWNER(id) \ 132#define HOST1X_SYNC_MLOCK_OWNER(id) \
133 host1x_sync_mlock_owner_r(id) 133 host1x_sync_mlock_owner_r(id)
134static inline u32 host1x_sync_mlock_owner_chid_f(u32 v) 134static inline u32 host1x_sync_mlock_owner_chid_v(u32 v)
135{ 135{
136 return (v & 0xf) << 8; 136 return (v >> 8) & 0xf;
137} 137}
138#define HOST1X_SYNC_MLOCK_OWNER_CHID_F(v) \ 138#define HOST1X_SYNC_MLOCK_OWNER_CHID_V(v) \
139 host1x_sync_mlock_owner_chid_f(v) 139 host1x_sync_mlock_owner_chid_v(v)
140static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r) 140static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r)
141{ 141{
142 return (r >> 1) & 0x1; 142 return (r >> 1) & 0x1;
diff --git a/drivers/gpu/host1x/hw/hw_host1x02_sync.h b/drivers/gpu/host1x/hw/hw_host1x02_sync.h
index 4495401525e8..540c7b65995f 100644
--- a/drivers/gpu/host1x/hw/hw_host1x02_sync.h
+++ b/drivers/gpu/host1x/hw/hw_host1x02_sync.h
@@ -131,12 +131,12 @@ static inline u32 host1x_sync_mlock_owner_r(unsigned int id)
131} 131}
132#define HOST1X_SYNC_MLOCK_OWNER(id) \ 132#define HOST1X_SYNC_MLOCK_OWNER(id) \
133 host1x_sync_mlock_owner_r(id) 133 host1x_sync_mlock_owner_r(id)
134static inline u32 host1x_sync_mlock_owner_chid_f(u32 v) 134static inline u32 host1x_sync_mlock_owner_chid_v(u32 v)
135{ 135{
136 return (v & 0xf) << 8; 136 return (v >> 8) & 0xf;
137} 137}
138#define HOST1X_SYNC_MLOCK_OWNER_CHID_F(v) \ 138#define HOST1X_SYNC_MLOCK_OWNER_CHID_V(v) \
139 host1x_sync_mlock_owner_chid_f(v) 139 host1x_sync_mlock_owner_chid_v(v)
140static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r) 140static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r)
141{ 141{
142 return (r >> 1) & 0x1; 142 return (r >> 1) & 0x1;
diff --git a/drivers/gpu/host1x/hw/hw_host1x04_sync.h b/drivers/gpu/host1x/hw/hw_host1x04_sync.h
index ef2275b5407a..3d6c8ec65934 100644
--- a/drivers/gpu/host1x/hw/hw_host1x04_sync.h
+++ b/drivers/gpu/host1x/hw/hw_host1x04_sync.h
@@ -131,12 +131,12 @@ static inline u32 host1x_sync_mlock_owner_r(unsigned int id)
131} 131}
132#define HOST1X_SYNC_MLOCK_OWNER(id) \ 132#define HOST1X_SYNC_MLOCK_OWNER(id) \
133 host1x_sync_mlock_owner_r(id) 133 host1x_sync_mlock_owner_r(id)
134static inline u32 host1x_sync_mlock_owner_chid_f(u32 v) 134static inline u32 host1x_sync_mlock_owner_chid_v(u32 v)
135{ 135{
136 return (v & 0xf) << 8; 136 return (v >> 8) & 0xf;
137} 137}
138#define HOST1X_SYNC_MLOCK_OWNER_CHID_F(v) \ 138#define HOST1X_SYNC_MLOCK_OWNER_CHID_V(v) \
139 host1x_sync_mlock_owner_chid_f(v) 139 host1x_sync_mlock_owner_chid_v(v)
140static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r) 140static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r)
141{ 141{
142 return (r >> 1) & 0x1; 142 return (r >> 1) & 0x1;