Skip to content

Commit 130e35e

Browse files
committed
Merge branch 'msm-fixes-4.11-rc6' of git://people.freedesktop.org/~robclark/linux into drm-fixes
misc msm fixes. * 'msm-fixes-4.11-rc6' of git://people.freedesktop.org/~robclark/linux: drm/msm: Make sure to detach the MMU during GPU cleanup drm/msm/hdmi: redefinitions of macros not required drm/msm/mdp5: Update SSPP_MAX value drm/msm/dsi: Fix bug in dsi_mgr_phy_enable drm/msm: Don't allow zero sized buffer objects drm/msm: Fix wrong pointer check in a5xx_destroy drm/msm: adreno: fix build error without debugfs
2 parents 84c4ba5 + 028402d commit 130e35e

File tree

7 files changed

+32
-24
lines changed

7 files changed

+32
-24
lines changed

drivers/gpu/drm/msm/adreno/a5xx_gpu.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2016 The Linux Foundation. All rights reserved.
1+
/* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -534,7 +534,7 @@ static void a5xx_destroy(struct msm_gpu *gpu)
534534
}
535535

536536
if (a5xx_gpu->gpmu_bo) {
537-
if (a5xx_gpu->gpmu_bo)
537+
if (a5xx_gpu->gpmu_iova)
538538
msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->id);
539539
drm_gem_object_unreference_unlocked(a5xx_gpu->gpmu_bo);
540540
}
@@ -860,7 +860,9 @@ static const struct adreno_gpu_funcs funcs = {
860860
.idle = a5xx_idle,
861861
.irq = a5xx_irq,
862862
.destroy = a5xx_destroy,
863+
#ifdef CONFIG_DEBUG_FS
863864
.show = a5xx_show,
865+
#endif
864866
},
865867
.get_timestamp = a5xx_get_timestamp,
866868
};

drivers/gpu/drm/msm/adreno/adreno_gpu.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,27 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
418418
return 0;
419419
}
420420

421-
void adreno_gpu_cleanup(struct adreno_gpu *gpu)
421+
void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu)
422422
{
423-
if (gpu->memptrs_bo) {
424-
if (gpu->memptrs)
425-
msm_gem_put_vaddr(gpu->memptrs_bo);
423+
struct msm_gpu *gpu = &adreno_gpu->base;
424+
425+
if (adreno_gpu->memptrs_bo) {
426+
if (adreno_gpu->memptrs)
427+
msm_gem_put_vaddr(adreno_gpu->memptrs_bo);
428+
429+
if (adreno_gpu->memptrs_iova)
430+
msm_gem_put_iova(adreno_gpu->memptrs_bo, gpu->id);
431+
432+
drm_gem_object_unreference_unlocked(adreno_gpu->memptrs_bo);
433+
}
434+
release_firmware(adreno_gpu->pm4);
435+
release_firmware(adreno_gpu->pfp);
426436

427-
if (gpu->memptrs_iova)
428-
msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);
437+
msm_gpu_cleanup(gpu);
429438

430-
drm_gem_object_unreference_unlocked(gpu->memptrs_bo);
439+
if (gpu->aspace) {
440+
gpu->aspace->mmu->funcs->detach(gpu->aspace->mmu,
441+
iommu_ports, ARRAY_SIZE(iommu_ports));
442+
msm_gem_address_space_destroy(gpu->aspace);
431443
}
432-
release_firmware(gpu->pm4);
433-
release_firmware(gpu->pfp);
434-
msm_gpu_cleanup(&gpu->base);
435444
}

drivers/gpu/drm/msm/dsi/dsi_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ dsi_mgr_phy_enable(int id,
171171
}
172172
}
173173
} else {
174-
msm_dsi_host_reset_phy(mdsi->host);
174+
msm_dsi_host_reset_phy(msm_dsi->host);
175175
ret = enable_phy(msm_dsi, src_pll_id, &shared_timings[id]);
176176
if (ret)
177177
return ret;

drivers/gpu/drm/msm/hdmi/hdmi_audio.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
#include <linux/hdmi.h>
1919
#include "hdmi.h"
2020

21-
22-
/* Supported HDMI Audio channels */
23-
#define MSM_HDMI_AUDIO_CHANNEL_2 0
24-
#define MSM_HDMI_AUDIO_CHANNEL_4 1
25-
#define MSM_HDMI_AUDIO_CHANNEL_6 2
26-
#define MSM_HDMI_AUDIO_CHANNEL_8 3
27-
2821
/* maps MSM_HDMI_AUDIO_CHANNEL_n consts used by audio driver to # of channels: */
2922
static int nchannels[] = { 2, 4, 6, 8 };
3023

drivers/gpu/drm/msm/mdp/mdp5/mdp5_pipe.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#ifndef __MDP5_PIPE_H__
1919
#define __MDP5_PIPE_H__
2020

21-
#define SSPP_MAX (SSPP_RGB3 + 1) /* TODO: Add SSPP_MAX in mdp5.xml.h */
21+
/* TODO: Add SSPP_MAX in mdp5.xml.h */
22+
#define SSPP_MAX (SSPP_CURSOR1 + 1)
2223

2324
/* represents a hw pipe, which is dynamically assigned to a plane */
2425
struct mdp5_hw_pipe {

drivers/gpu/drm/msm/msm_gem.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,12 @@ struct drm_gem_object *msm_gem_new(struct drm_device *dev,
812812

813813
size = PAGE_ALIGN(size);
814814

815+
/* Disallow zero sized objects as they make the underlying
816+
* infrastructure grumpy
817+
*/
818+
if (size == 0)
819+
return ERR_PTR(-EINVAL);
820+
815821
ret = msm_gem_new_impl(dev, size, flags, NULL, &obj);
816822
if (ret)
817823
goto fail;

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
706706
msm_ringbuffer_destroy(gpu->rb);
707707
}
708708

709-
if (gpu->aspace)
710-
msm_gem_address_space_destroy(gpu->aspace);
711-
712709
if (gpu->fctx)
713710
msm_fence_context_free(gpu->fctx);
714711
}

0 commit comments

Comments
 (0)