drm/tegra: Fixes for v5.15-rc3

This contains a fix for an UAPI error that happens when no IOMMU is
 enabled, as well as a few build warning fixes and plugs a potential
 memory leak.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmFN4YkTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoefcEACEZQ+ePKU62KkqNcW9ZYKHAoJIEEx8
 R8w0VnXfVkDh9pDDbbvjVJIF+OBSaPYl99rb/Ykt821sIIZe066dteRKlYO8Wt3P
 n4hWwtGpOZIwduKGODsWf1/6VkZ2jK1okTLppL+sgQfL2iUWroM711VoLFCNF9h5
 LSw/1CMns1VsVqginmjJryTzULL7Yg9HhxhFB0PwD9GC1XI74Kmd+ORzo3eQMO1P
 9Qf3/kErxQ1wtFldKzK3s9TQ7lfujNGHCuyXr0b/p0YoovVeLcl9kZsx050bEn3I
 SnaOQnbN9B0lpnS02OIlzC6KD1YfSmhBgJb6gwg603i02zJaQQQvVaJ7xrb1eE3C
 uEhS6P+qhTMsHzqX4JoyJNnwse/lToWaCyOPCgW8J3sK+BtYmG8B8pceDkqUC9ZV
 0xTElKzhqlIxmRRg6b1/iHqG4WCe/cSAKCgb5qaWEp69pz/x5olWe9G3astqrQap
 Fxf5+xvYHqjWCCpjnvjN0YV4ENEd9P7lPdQuUmGaR8SoqX4KCqV4xh2NqQyvb0oj
 IZh0Ku3VWb3PJfbni6qE6kGlwEFRmFGcMb257Qj4o4xWlApHTZBwN5adxZcbsIgL
 tgNfmt7WSWgEttGBWBSRDTGtt3DIm2/Myz07argO5rmf3F6KKjQvpVbSzo2umS3O
 NiVaQw6iPZ+5yg==
 =FObG
 -----END PGP SIGNATURE-----

Merge tag 'drm/tegra/for-5.15-rc3' of ssh://git.freedesktop.org/git/tegra/linux into drm-fixes

drm/tegra: Fixes for v5.15-rc3

This contains a fix for an UAPI error that happens when no IOMMU is
enabled, as well as a few build warning fixes and plugs a potential
memory leak.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210924143537.1341882-1-thierry.reding@gmail.com
This commit is contained in:
Dave Airlie 2021-09-28 17:05:58 +10:00
commit 05812b971c
4 changed files with 5 additions and 12 deletions

View file

@ -1845,7 +1845,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc,
bool prepare_bandwidth_transition) bool prepare_bandwidth_transition)
{ {
const struct tegra_plane_state *old_tegra_state, *new_tegra_state; const struct tegra_plane_state *old_tegra_state, *new_tegra_state;
const struct tegra_dc_state *old_dc_state, *new_dc_state;
u32 i, new_avg_bw, old_avg_bw, new_peak_bw, old_peak_bw; u32 i, new_avg_bw, old_avg_bw, new_peak_bw, old_peak_bw;
const struct drm_plane_state *old_plane_state; const struct drm_plane_state *old_plane_state;
const struct drm_crtc_state *old_crtc_state; const struct drm_crtc_state *old_crtc_state;
@ -1858,8 +1857,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc,
return; return;
old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
old_dc_state = to_const_dc_state(old_crtc_state);
new_dc_state = to_const_dc_state(crtc->state);
if (!crtc->state->active) { if (!crtc->state->active) {
if (!old_crtc_state->active) if (!old_crtc_state->active)

View file

@ -35,12 +35,6 @@ static inline struct tegra_dc_state *to_dc_state(struct drm_crtc_state *state)
return NULL; return NULL;
} }
static inline const struct tegra_dc_state *
to_const_dc_state(const struct drm_crtc_state *state)
{
return to_dc_state((struct drm_crtc_state *)state);
}
struct tegra_dc_stats { struct tegra_dc_stats {
unsigned long frames; unsigned long frames;
unsigned long vblank; unsigned long vblank;

View file

@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f
mapping->iova = sg_dma_address(mapping->sgt->sgl); mapping->iova = sg_dma_address(mapping->sgt->sgl);
} }
mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size; mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size;
err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX), err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
GFP_KERNEL); GFP_KERNEL);

View file

@ -15,7 +15,7 @@
#include "intr.h" #include "intr.h"
#include "syncpt.h" #include "syncpt.h"
DEFINE_SPINLOCK(lock); static DEFINE_SPINLOCK(lock);
struct host1x_syncpt_fence { struct host1x_syncpt_fence {
struct dma_fence base; struct dma_fence base;
@ -152,8 +152,10 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL); fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);
if (!fence->waiter) if (!fence->waiter) {
kfree(fence);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
fence->sp = sp; fence->sp = sp;
fence->threshold = threshold; fence->threshold = threshold;