From: Thierry Reding <redacted>
The Tegra DRM never actually took that lock, so the driver was broken
until generic locking was added in commit:
commit b962a12050a387e4bbf3a48745afe1d29d396b0d
Author: Rob Clark [off-list ref]
Date: Mon Oct 22 14:31:22 2018 +0200
drm/atomic: integrate modeset lock with private objects
It's now no longer necessary to take that lock, so drop the check.
v2: add rationale for why it is now safe to drop the check (Daniel)
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/hub.c | 3 ---
1 file changed, 3 deletions(-)
From: Thierry Reding <redacted>
Buffers that are imported from a DMA-BUF don't have pages allocated with
them. At the same time an SG table for them can't be derived using the
DMA API helpers because the necessary information doesn't exist. However
there's already an SG table that was created during import, so this can
simply be duplicated.
Signed-off-by: Thierry Reding <redacted>
---
Note that for proper DMA-BUF usage, the display controllers should each
attach to the DMA-BUF for imported buffers. That's a fairly large change
and will be sent out as a follow-up, targetting v5.6. This patch is a
fix for a recent regression in v5.5-rc1.
drivers/gpu/drm/tegra/gem.c | 43 +++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
From: Thierry Reding <redacted>
All the display related blocks on Tegra require contiguous memory. Using
the DMA API, there is no knowing at import time which device will end up
using the buffer, so it's not known whether or not an IOMMU will be used
to map the buffer.
Move the check for non-contiguous buffers/mappings to the tegra_dc_pin()
function which is now the earliest point where it is known if a DMA BUF
can be used by the given device or not.
v2: add check for contiguous buffer/mapping in tegra_dc_pin()
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/gem.c | 7 -------
drivers/gpu/drm/tegra/plane.c | 11 +++++++++++
2 files changed, 11 insertions(+), 7 deletions(-)
From: Thierry Reding <redacted>
The IOVA address for the cursor is the result of mapping the buffer
object for the given display controller. Make sure to use the proper
IOVA address as stored in the cursor's plane state.
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/dc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
@@ -847,16 +847,15 @@ static int tegra_cursor_atomic_check(struct drm_plane *plane,staticvoidtegra_cursor_atomic_update(structdrm_plane*plane,structdrm_plane_state*old_state){-structtegra_bo*bo=tegra_fb_get_plane(plane->state->fb,0);+structtegra_plane_state*state=to_tegra_plane_state(plane->state);structtegra_dc*dc=to_tegra_dc(plane->state->crtc);-structdrm_plane_state*state=plane->state;u32value=CURSOR_CLIP_DISPLAY;/* rien ne va plus */if(!plane->state->crtc||!plane->state->fb)return;-switch(state->crtc_w){+switch(plane->state->crtc_w){case32:value|=CURSOR_SIZE_32x32;break;
@@ -874,16 +873,16 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,break;default:-WARN(1,"cursor size %ux%u not supported\n",state->crtc_w,-state->crtc_h);+WARN(1,"cursor size %ux%u not supported\n",+plane->state->crtc_w,plane->state->crtc_h);return;}-value|=(bo->iova>>10)&0x3fffff;+value|=(state->iova[0]>>10)&0x3fffff;tegra_dc_writel(dc,value,DC_DISP_CURSOR_START_ADDR);#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT-value=(bo->iova>>32)&0x3;+value=(state->iova[0]>>32)&0x3;tegra_dc_writel(dc,value,DC_DISP_CURSOR_START_ADDR_HI);#endif
@@ -902,7 +901,8 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,tegra_dc_writel(dc,value,DC_DISP_BLEND_CURSOR_CONTROL);/* position the cursor */-value=(state->crtc_y&0x3fff)<<16|(state->crtc_x&0x3fff);+value=(plane->state->crtc_y&0x3fff)<<16|+(plane->state->crtc_x&0x3fff);tegra_dc_writel(dc,value,DC_DISP_CURSOR_POSITION);}
--
2.23.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
From: Thierry Reding <redacted>
Upon system suspend, make sure the +5V HDMI regulator is disabled. This
avoids potentially leaking current to the HDMI connector. This also
makes sure that upon resume the regulator is enabled again, which in
some cases is necessary to properly restore the state of the supply on
resume.
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/sor.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
From: Thierry Reding <redacted>
Export the module device table to ensure the VIC compatible strings are
listed in the module's aliases table. This in turn causes the driver to
be automatically loaded on boot if VIC is the only enabled subdevice of
the logical host1x DRM device.
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/vic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
From: Thierry Reding <redacted>
Subdevices may not be hooked up to an IOMMU via device tree. Detect such
situations and avoid confusing users by not emitting an error message.
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/dc.c | 2 +-
drivers/gpu/drm/tegra/drm.c | 4 +---
drivers/gpu/drm/tegra/vic.c | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
@@ -2027,7 +2027,7 @@ static int tegra_dc_init(struct host1x_client *client)dev_warn(dc->dev,"failed to allocate syncpoint\n");err=host1x_client_iommu_attach(client);-if(err<0){+if(err<0&&err!=-ENODEV){dev_err(client->dev,"failed to attach to domain: %d\n",err);returnerr;}
@@ -920,10 +920,8 @@ int host1x_client_iommu_attach(struct host1x_client *client)if(tegra->domain){group=iommu_group_get(client->dev);-if(!group){-dev_err(client->dev,"failed to get IOMMU group\n");+if(!group)return-ENODEV;-}if(domain!=tegra->domain){err=iommu_attach_group(tegra->domain,group);
@@ -167,7 +167,7 @@ static int vic_init(struct host1x_client *client)interr;err=host1x_client_iommu_attach(client);-if(err<0){+if(err<0&&err!=-ENODEV){dev_err(vic->dev,"failed to attach to domain: %d\n",err);returnerr;}
--
2.23.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
From: Thierry Reding <redacted>
The SOR supports multiple display modes, but only when driving an HDMI
monitor does it make sense to control the +5V power supply. eDP and DP
don't need this, so make it optional.
This fixes a crash observed during system suspend/resume.
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/sor.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
From: Thierry Reding <redacted>
The call to tegra_display_hub_cleanup() that takes care of disabling the
window groups is missing from the driver's ->remove() callback. Call it
to make sure the runtime PM reference counts for the display controllers
are balanced.
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/drm.c | 3 +++
1 file changed, 3 insertions(+)
From: Thierry Reding <redacted>
Upon system suspend, make sure the +5V HDMI regulator is disabled. This
avoids potentially leaking current to the HDMI connector. This also
makes sure that upon resume the regulator is enabled again, which in
some cases is necessary to properly restore the state of the supply on
resume.
Reviewed-by: Daniel Vetter <redacted>
Signed-off-by: Thierry Reding <redacted>
---
drivers/gpu/drm/tegra/sor.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)