Skip to content

Commit

Permalink
Merge branch 'msm-fixes-4.11-rc6' of git://people.freedesktop.org/~ro…
Browse files Browse the repository at this point in the history
…bclark/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
  • Loading branch information
airlied committed Apr 4, 2017
2 parents 84c4ba5 + 028402d commit 130e35e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/msm/adreno/a5xx_gpu.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016 The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
Expand Down Expand Up @@ -534,7 +534,7 @@ static void a5xx_destroy(struct msm_gpu *gpu)
}

if (a5xx_gpu->gpmu_bo) {
if (a5xx_gpu->gpmu_bo)
if (a5xx_gpu->gpmu_iova)
msm_gem_put_iova(a5xx_gpu->gpmu_bo, gpu->id);
drm_gem_object_unreference_unlocked(a5xx_gpu->gpmu_bo);
}
Expand Down Expand Up @@ -860,7 +860,9 @@ static const struct adreno_gpu_funcs funcs = {
.idle = a5xx_idle,
.irq = a5xx_irq,
.destroy = a5xx_destroy,
#ifdef CONFIG_DEBUG_FS
.show = a5xx_show,
#endif
},
.get_timestamp = a5xx_get_timestamp,
};
Expand Down
29 changes: 19 additions & 10 deletions drivers/gpu/drm/msm/adreno/adreno_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,18 +418,27 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
return 0;
}

void adreno_gpu_cleanup(struct adreno_gpu *gpu)
void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu)
{
if (gpu->memptrs_bo) {
if (gpu->memptrs)
msm_gem_put_vaddr(gpu->memptrs_bo);
struct msm_gpu *gpu = &adreno_gpu->base;

if (adreno_gpu->memptrs_bo) {
if (adreno_gpu->memptrs)
msm_gem_put_vaddr(adreno_gpu->memptrs_bo);

if (adreno_gpu->memptrs_iova)
msm_gem_put_iova(adreno_gpu->memptrs_bo, gpu->id);

drm_gem_object_unreference_unlocked(adreno_gpu->memptrs_bo);
}
release_firmware(adreno_gpu->pm4);
release_firmware(adreno_gpu->pfp);

if (gpu->memptrs_iova)
msm_gem_put_iova(gpu->memptrs_bo, gpu->base.id);
msm_gpu_cleanup(gpu);

drm_gem_object_unreference_unlocked(gpu->memptrs_bo);
if (gpu->aspace) {
gpu->aspace->mmu->funcs->detach(gpu->aspace->mmu,
iommu_ports, ARRAY_SIZE(iommu_ports));
msm_gem_address_space_destroy(gpu->aspace);
}
release_firmware(gpu->pm4);
release_firmware(gpu->pfp);
msm_gpu_cleanup(&gpu->base);
}
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/dsi/dsi_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ dsi_mgr_phy_enable(int id,
}
}
} else {
msm_dsi_host_reset_phy(mdsi->host);
msm_dsi_host_reset_phy(msm_dsi->host);
ret = enable_phy(msm_dsi, src_pll_id, &shared_timings[id]);
if (ret)
return ret;
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/msm/hdmi/hdmi_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
#include <linux/hdmi.h>
#include "hdmi.h"


/* Supported HDMI Audio channels */
#define MSM_HDMI_AUDIO_CHANNEL_2 0
#define MSM_HDMI_AUDIO_CHANNEL_4 1
#define MSM_HDMI_AUDIO_CHANNEL_6 2
#define MSM_HDMI_AUDIO_CHANNEL_8 3

/* maps MSM_HDMI_AUDIO_CHANNEL_n consts used by audio driver to # of channels: */
static int nchannels[] = { 2, 4, 6, 8 };

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/mdp/mdp5/mdp5_pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#ifndef __MDP5_PIPE_H__
#define __MDP5_PIPE_H__

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

/* represents a hw pipe, which is dynamically assigned to a plane */
struct mdp5_hw_pipe {
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/msm/msm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,12 @@ struct drm_gem_object *msm_gem_new(struct drm_device *dev,

size = PAGE_ALIGN(size);

/* Disallow zero sized objects as they make the underlying
* infrastructure grumpy
*/
if (size == 0)
return ERR_PTR(-EINVAL);

ret = msm_gem_new_impl(dev, size, flags, NULL, &obj);
if (ret)
goto fail;
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/msm/msm_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
msm_ringbuffer_destroy(gpu->rb);
}

if (gpu->aspace)
msm_gem_address_space_destroy(gpu->aspace);

if (gpu->fctx)
msm_fence_context_free(gpu->fctx);
}

0 comments on commit 130e35e

Please sign in to comment.