Merge branch 'msm-fixes-4.10-rc4' of git://people.freedesktop.org/~robclark/linux into drm-fixes
* 'msm-fixes-4.10-rc4' of git://people.freedesktop.org/~robclark/linux: drm/msm: fix potential null ptr issue in non-iommu case drm/msm/mdp5: rip out plane->pending tracking
This commit is contained in:
commit
b310348530
|
@ -345,7 +345,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
|
||||||
{
|
{
|
||||||
struct adreno_platform_config *config = pdev->dev.platform_data;
|
struct adreno_platform_config *config = pdev->dev.platform_data;
|
||||||
struct msm_gpu *gpu = &adreno_gpu->base;
|
struct msm_gpu *gpu = &adreno_gpu->base;
|
||||||
struct msm_mmu *mmu;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
adreno_gpu->funcs = funcs;
|
adreno_gpu->funcs = funcs;
|
||||||
|
@ -385,8 +384,8 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
mmu = gpu->aspace->mmu;
|
if (gpu->aspace && gpu->aspace->mmu) {
|
||||||
if (mmu) {
|
struct msm_mmu *mmu = gpu->aspace->mmu;
|
||||||
ret = mmu->funcs->attach(mmu, iommu_ports,
|
ret = mmu->funcs->attach(mmu, iommu_ports,
|
||||||
ARRAY_SIZE(iommu_ports));
|
ARRAY_SIZE(iommu_ports));
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -119,13 +119,7 @@ static void mdp5_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *st
|
||||||
|
|
||||||
static void mdp5_complete_commit(struct msm_kms *kms, struct drm_atomic_state *state)
|
static void mdp5_complete_commit(struct msm_kms *kms, struct drm_atomic_state *state)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
|
struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
|
||||||
struct drm_plane *plane;
|
|
||||||
struct drm_plane_state *plane_state;
|
|
||||||
|
|
||||||
for_each_plane_in_state(state, plane, plane_state, i)
|
|
||||||
mdp5_plane_complete_commit(plane, plane_state);
|
|
||||||
|
|
||||||
if (mdp5_kms->smp)
|
if (mdp5_kms->smp)
|
||||||
mdp5_smp_complete_commit(mdp5_kms->smp, &mdp5_kms->state->smp);
|
mdp5_smp_complete_commit(mdp5_kms->smp, &mdp5_kms->state->smp);
|
||||||
|
|
|
@ -104,8 +104,6 @@ struct mdp5_plane_state {
|
||||||
|
|
||||||
/* assigned by crtc blender */
|
/* assigned by crtc blender */
|
||||||
enum mdp_mixer_stage_id stage;
|
enum mdp_mixer_stage_id stage;
|
||||||
|
|
||||||
bool pending : 1;
|
|
||||||
};
|
};
|
||||||
#define to_mdp5_plane_state(x) \
|
#define to_mdp5_plane_state(x) \
|
||||||
container_of(x, struct mdp5_plane_state, base)
|
container_of(x, struct mdp5_plane_state, base)
|
||||||
|
@ -232,8 +230,6 @@ int mdp5_irq_domain_init(struct mdp5_kms *mdp5_kms);
|
||||||
void mdp5_irq_domain_fini(struct mdp5_kms *mdp5_kms);
|
void mdp5_irq_domain_fini(struct mdp5_kms *mdp5_kms);
|
||||||
|
|
||||||
uint32_t mdp5_plane_get_flush(struct drm_plane *plane);
|
uint32_t mdp5_plane_get_flush(struct drm_plane *plane);
|
||||||
void mdp5_plane_complete_commit(struct drm_plane *plane,
|
|
||||||
struct drm_plane_state *state);
|
|
||||||
enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane);
|
enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane);
|
||||||
struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary);
|
struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary);
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p,
|
||||||
drm_printf(p, "\tzpos=%u\n", pstate->zpos);
|
drm_printf(p, "\tzpos=%u\n", pstate->zpos);
|
||||||
drm_printf(p, "\talpha=%u\n", pstate->alpha);
|
drm_printf(p, "\talpha=%u\n", pstate->alpha);
|
||||||
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
|
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
|
||||||
drm_printf(p, "\tpending=%u\n", pstate->pending);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mdp5_plane_reset(struct drm_plane *plane)
|
static void mdp5_plane_reset(struct drm_plane *plane)
|
||||||
|
@ -220,8 +219,6 @@ mdp5_plane_duplicate_state(struct drm_plane *plane)
|
||||||
if (mdp5_state && mdp5_state->base.fb)
|
if (mdp5_state && mdp5_state->base.fb)
|
||||||
drm_framebuffer_reference(mdp5_state->base.fb);
|
drm_framebuffer_reference(mdp5_state->base.fb);
|
||||||
|
|
||||||
mdp5_state->pending = false;
|
|
||||||
|
|
||||||
return &mdp5_state->base;
|
return &mdp5_state->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,13 +285,6 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
|
||||||
DBG("%s: check (%d -> %d)", plane->name,
|
DBG("%s: check (%d -> %d)", plane->name,
|
||||||
plane_enabled(old_state), plane_enabled(state));
|
plane_enabled(old_state), plane_enabled(state));
|
||||||
|
|
||||||
/* We don't allow faster-than-vblank updates.. if we did add this
|
|
||||||
* some day, we would need to disallow in cases where hwpipe
|
|
||||||
* changes
|
|
||||||
*/
|
|
||||||
if (WARN_ON(to_mdp5_plane_state(old_state)->pending))
|
|
||||||
return -EBUSY;
|
|
||||||
|
|
||||||
max_width = config->hw->lm.max_width << 16;
|
max_width = config->hw->lm.max_width << 16;
|
||||||
max_height = config->hw->lm.max_height << 16;
|
max_height = config->hw->lm.max_height << 16;
|
||||||
|
|
||||||
|
@ -370,12 +360,9 @@ static void mdp5_plane_atomic_update(struct drm_plane *plane,
|
||||||
struct drm_plane_state *old_state)
|
struct drm_plane_state *old_state)
|
||||||
{
|
{
|
||||||
struct drm_plane_state *state = plane->state;
|
struct drm_plane_state *state = plane->state;
|
||||||
struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state);
|
|
||||||
|
|
||||||
DBG("%s: update", plane->name);
|
DBG("%s: update", plane->name);
|
||||||
|
|
||||||
mdp5_state->pending = true;
|
|
||||||
|
|
||||||
if (plane_enabled(state)) {
|
if (plane_enabled(state)) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -851,15 +838,6 @@ uint32_t mdp5_plane_get_flush(struct drm_plane *plane)
|
||||||
return pstate->hwpipe->flush_mask;
|
return pstate->hwpipe->flush_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called after vsync in thread context */
|
|
||||||
void mdp5_plane_complete_commit(struct drm_plane *plane,
|
|
||||||
struct drm_plane_state *state)
|
|
||||||
{
|
|
||||||
struct mdp5_plane_state *pstate = to_mdp5_plane_state(plane->state);
|
|
||||||
|
|
||||||
pstate->pending = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize plane */
|
/* initialize plane */
|
||||||
struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary)
|
struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary)
|
||||||
{
|
{
|
||||||
|
|
|
@ -294,6 +294,8 @@ put_iova(struct drm_gem_object *obj)
|
||||||
WARN_ON(!mutex_is_locked(&dev->struct_mutex));
|
WARN_ON(!mutex_is_locked(&dev->struct_mutex));
|
||||||
|
|
||||||
for (id = 0; id < ARRAY_SIZE(msm_obj->domain); id++) {
|
for (id = 0; id < ARRAY_SIZE(msm_obj->domain); id++) {
|
||||||
|
if (!priv->aspace[id])
|
||||||
|
continue;
|
||||||
msm_gem_unmap_vma(priv->aspace[id],
|
msm_gem_unmap_vma(priv->aspace[id],
|
||||||
&msm_obj->domain[id], msm_obj->sgt);
|
&msm_obj->domain[id], msm_obj->sgt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue