Skip to content

Commit

Permalink
Merge branch 'msm-fixes-3.15-rc3' of git://people.freedesktop.org/~ro…
Browse files Browse the repository at this point in the history
…bclark/linux into drm-next

Fixes for msm for 3.15.. a memory leak fix for devices using vram
carveout instead of iommu.  Plus I think finally managed to sort out /
workaround some cursor vs underflow issues.  And small fbcon tweak
needed to avoid extra full-modesets at boot.

* 'msm-fixes-3.15-rc3' of git://people.freedesktop.org/~robclark/linux:
  drm/msm/mdp4: cure for the cursor blues (v2)
  drm/msm: default to XR24 rather than AR24
  drm/msm: fix memory leak
  • Loading branch information
Dave Airlie committed Apr 27, 2014
2 parents 6f19e7e + 7d8d9f6 commit 9e5e7be
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 15 deletions.
9 changes: 3 additions & 6 deletions drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,8 @@ static void update_cursor(struct drm_crtc *crtc)
MDP4_DMA_CURSOR_BLEND_CONFIG_CURSOR_EN);
} else {
/* disable cursor: */
mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_BASE(dma), 0);
mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_BLEND_CONFIG(dma),
MDP4_DMA_CURSOR_BLEND_CONFIG_FORMAT(CURSOR_ARGB));
mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_BASE(dma),
mdp4_kms->blank_cursor_iova);
}

/* and drop the iova ref + obj rev when done scanning out: */
Expand Down Expand Up @@ -574,11 +573,9 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc,

if (old_bo) {
/* drop our previous reference: */
msm_gem_put_iova(old_bo, mdp4_kms->id);
drm_gem_object_unreference_unlocked(old_bo);
drm_flip_work_queue(&mdp4_crtc->unref_cursor_work, old_bo);
}

crtc_flush(crtc);
request_pending(crtc, PENDING_CURSOR);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/msm/mdp/mdp4/mdp4_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ irqreturn_t mdp4_irq(struct msm_kms *kms)

VERB("status=%08x", status);

mdp_dispatch_irqs(mdp_kms, status);

for (id = 0; id < priv->num_crtcs; id++)
if (status & mdp4_crtc_vblank(priv->crtcs[id]))
drm_handle_vblank(dev, id);

mdp_dispatch_irqs(mdp_kms, status);

return IRQ_HANDLED;
}

Expand Down
21 changes: 21 additions & 0 deletions drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ static void mdp4_preclose(struct msm_kms *kms, struct drm_file *file)
static void mdp4_destroy(struct msm_kms *kms)
{
struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
if (mdp4_kms->blank_cursor_iova)
msm_gem_put_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id);
if (mdp4_kms->blank_cursor_bo)
drm_gem_object_unreference(mdp4_kms->blank_cursor_bo);
kfree(mdp4_kms);
}

Expand Down Expand Up @@ -372,6 +376,23 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
goto fail;
}

mutex_lock(&dev->struct_mutex);
mdp4_kms->blank_cursor_bo = msm_gem_new(dev, SZ_16K, MSM_BO_WC);
mutex_unlock(&dev->struct_mutex);
if (IS_ERR(mdp4_kms->blank_cursor_bo)) {
ret = PTR_ERR(mdp4_kms->blank_cursor_bo);
dev_err(dev->dev, "could not allocate blank-cursor bo: %d\n", ret);
mdp4_kms->blank_cursor_bo = NULL;
goto fail;
}

ret = msm_gem_get_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id,
&mdp4_kms->blank_cursor_iova);
if (ret) {
dev_err(dev->dev, "could not pin blank-cursor bo: %d\n", ret);
goto fail;
}

return kms;

fail:
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ struct mdp4_kms {
struct clk *lut_clk;

struct mdp_irq error_handler;

/* empty/blank cursor bo to use when cursor is "disabled" */
struct drm_gem_object *blank_cursor_bo;
uint32_t blank_cursor_iova;
};
#define to_mdp4_kms(x) container_of(x, struct mdp4_kms, base)

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ static void mdp5_irq_mdp(struct mdp_kms *mdp_kms)

VERB("status=%08x", status);

mdp_dispatch_irqs(mdp_kms, status);

for (id = 0; id < priv->num_crtcs; id++)
if (status & mdp5_crtc_vblank(priv->crtcs[id]))
drm_handle_vblank(dev, id);

mdp_dispatch_irqs(mdp_kms, status);
}

irqreturn_t mdp5_irq(struct msm_kms *kms)
Expand Down
5 changes: 1 addition & 4 deletions drivers/gpu/drm/msm/msm_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
dma_addr_t paddr;
int ret, size;

/* only doing ARGB32 since this is what is needed to alpha-blend
* with video overlays:
*/
sizes->surface_bpp = 32;
sizes->surface_depth = 32;
sizes->surface_depth = 24;

DBG("create fbdev: %dx%d@%d (%dx%d)", sizes->surface_width,
sizes->surface_height, sizes->surface_bpp,
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/msm/msm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ static void put_pages(struct drm_gem_object *obj)

if (iommu_present(&platform_bus_type))
drm_gem_put_pages(obj, msm_obj->pages, true, false);
else
else {
drm_mm_remove_node(msm_obj->vram_node);
drm_free_large(msm_obj->pages);
}

msm_obj->pages = NULL;
}
Expand Down

0 comments on commit 9e5e7be

Please sign in to comment.