Merge tag 'drm-misc-next-2020-01-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for v5.6: UAPI Changes: - Commandline parser: Add support for panel orientation, and per-mode options. - Fix IOCTL naming for dma-buf heaps. Cross-subsystem Changes: - Rename DMA_HEAP_IOC_ALLOC to DMA_HEAP_IOCTL_ALLOC before it becomes abi. - Change DMA-BUF system-heap's name to system. - Fix leak in error handling in dma_heap_ioctl(), and make a symbol static. - Fix udma-buf cpu access. - Fix ti devicetree bindings. Core Changes: - Add CTA-861-G modes with VIC >= 193. - Change error handling and remove bug_on in *drm_dev_init. - Export drm_panel_of_backlight() correctly once more. - Add support for lvds decoders. - Convert drm/client and drm/(gem-,)fb-helper to drm-device based logging and update logging todo. Driver Changes: - Add support for dsi/px30 to rockchip. - Add fb damage support to virtio. - Use dma_resv locking wrappers in vc4, msm, etnaviv. - Make functions in virtio static, and perform some simplifications. - Add suspend support to sun4i. - Add A64 mipi dsi support to sun4i. - Add runtime pm suspend to komeda. - Associated driver fixes. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/efc11139-1653-86bc-1b0f-0aefde219850@linux.intel.com
This commit is contained in:
@@ -20,8 +20,10 @@ static u64 get_lpu_event(struct d71_pipeline *d71_pipeline)
|
||||
evts |= KOMEDA_EVENT_IBSY;
|
||||
if (raw_status & LPU_IRQ_EOW)
|
||||
evts |= KOMEDA_EVENT_EOW;
|
||||
if (raw_status & LPU_IRQ_OVR)
|
||||
evts |= KOMEDA_EVENT_OVR;
|
||||
|
||||
if (raw_status & (LPU_IRQ_ERR | LPU_IRQ_IBSY)) {
|
||||
if (raw_status & (LPU_IRQ_ERR | LPU_IRQ_IBSY | LPU_IRQ_OVR)) {
|
||||
u32 restore = 0, tbu_status;
|
||||
/* Check error of LPU status */
|
||||
status = malidp_read32(reg, BLK_STATUS);
|
||||
@@ -45,6 +47,15 @@ static u64 get_lpu_event(struct d71_pipeline *d71_pipeline)
|
||||
restore |= LPU_STATUS_ACE3;
|
||||
evts |= KOMEDA_ERR_ACE3;
|
||||
}
|
||||
if (status & LPU_STATUS_FEMPTY) {
|
||||
restore |= LPU_STATUS_FEMPTY;
|
||||
evts |= KOMEDA_EVENT_EMPTY;
|
||||
}
|
||||
if (status & LPU_STATUS_FFULL) {
|
||||
restore |= LPU_STATUS_FFULL;
|
||||
evts |= KOMEDA_EVENT_FULL;
|
||||
}
|
||||
|
||||
if (restore != 0)
|
||||
malidp_write32_mask(reg, BLK_STATUS, restore, 0);
|
||||
|
||||
|
@@ -175,6 +175,7 @@
|
||||
#define TBU_DOUTSTDCAPB_MASK 0x3F
|
||||
|
||||
/* LPU_IRQ_BITS */
|
||||
#define LPU_IRQ_OVR BIT(9)
|
||||
#define LPU_IRQ_IBSY BIT(10)
|
||||
#define LPU_IRQ_ERR BIT(11)
|
||||
#define LPU_IRQ_EOW BIT(12)
|
||||
@@ -185,6 +186,8 @@
|
||||
#define LPU_STATUS_AXIE BIT(4)
|
||||
#define LPU_STATUS_AXIRP BIT(5)
|
||||
#define LPU_STATUS_AXIWP BIT(6)
|
||||
#define LPU_STATUS_FEMPTY BIT(11)
|
||||
#define LPU_STATUS_FFULL BIT(14)
|
||||
#define LPU_STATUS_ACE0 BIT(16)
|
||||
#define LPU_STATUS_ACE1 BIT(17)
|
||||
#define LPU_STATUS_ACE2 BIT(18)
|
||||
|
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
#include <linux/clk.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
@@ -274,6 +275,7 @@ static void
|
||||
komeda_crtc_atomic_enable(struct drm_crtc *crtc,
|
||||
struct drm_crtc_state *old)
|
||||
{
|
||||
pm_runtime_get_sync(crtc->dev->dev);
|
||||
komeda_crtc_prepare(to_kcrtc(crtc));
|
||||
drm_crtc_vblank_on(crtc);
|
||||
WARN_ON(drm_crtc_vblank_get(crtc));
|
||||
@@ -372,6 +374,7 @@ komeda_crtc_atomic_disable(struct drm_crtc *crtc,
|
||||
drm_crtc_vblank_put(crtc);
|
||||
drm_crtc_vblank_off(crtc);
|
||||
komeda_crtc_unprepare(kcrtc);
|
||||
pm_runtime_put(crtc->dev->dev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <linux/of_graph.h>
|
||||
#include <linux/of_reserved_mem.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
#include <linux/debugfs.h>
|
||||
@@ -27,12 +28,16 @@ static int komeda_register_show(struct seq_file *sf, void *x)
|
||||
|
||||
seq_puts(sf, "\n====== Komeda register dump =========\n");
|
||||
|
||||
pm_runtime_get_sync(mdev->dev);
|
||||
|
||||
if (mdev->funcs->dump_register)
|
||||
mdev->funcs->dump_register(mdev, sf);
|
||||
|
||||
for (i = 0; i < mdev->n_pipelines; i++)
|
||||
komeda_pipeline_dump_register(mdev->pipelines[i], sf);
|
||||
|
||||
pm_runtime_put(mdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -263,15 +268,6 @@ struct komeda_dev *komeda_dev_create(struct device *dev)
|
||||
if (!mdev->iommu)
|
||||
DRM_INFO("continue without IOMMU support!\n");
|
||||
|
||||
if (mdev->iommu && mdev->funcs->connect_iommu) {
|
||||
err = mdev->funcs->connect_iommu(mdev);
|
||||
if (err) {
|
||||
DRM_ERROR("connect iommu failed.\n");
|
||||
mdev->iommu = NULL;
|
||||
goto disable_clk;
|
||||
}
|
||||
}
|
||||
|
||||
clk_disable_unprepare(mdev->aclk);
|
||||
|
||||
err = sysfs_create_group(&dev->kobj, &komeda_sysfs_attr_group);
|
||||
@@ -310,11 +306,6 @@ void komeda_dev_destroy(struct komeda_dev *mdev)
|
||||
if (mdev->aclk)
|
||||
clk_prepare_enable(mdev->aclk);
|
||||
|
||||
if (mdev->iommu && mdev->funcs->disconnect_iommu)
|
||||
if (mdev->funcs->disconnect_iommu(mdev))
|
||||
DRM_ERROR("disconnect iommu failed.\n");
|
||||
mdev->iommu = NULL;
|
||||
|
||||
for (i = 0; i < mdev->n_pipelines; i++) {
|
||||
komeda_pipeline_destroy(mdev, mdev->pipelines[i]);
|
||||
mdev->pipelines[i] = NULL;
|
||||
@@ -343,44 +334,26 @@ void komeda_dev_destroy(struct komeda_dev *mdev)
|
||||
|
||||
int komeda_dev_resume(struct komeda_dev *mdev)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
clk_prepare_enable(mdev->aclk);
|
||||
|
||||
if (mdev->iommu && mdev->funcs->connect_iommu) {
|
||||
ret = mdev->funcs->connect_iommu(mdev);
|
||||
if (ret < 0) {
|
||||
mdev->funcs->enable_irq(mdev);
|
||||
|
||||
if (mdev->iommu && mdev->funcs->connect_iommu)
|
||||
if (mdev->funcs->connect_iommu(mdev))
|
||||
DRM_ERROR("connect iommu failed.\n");
|
||||
goto disable_clk;
|
||||
}
|
||||
}
|
||||
|
||||
ret = mdev->funcs->enable_irq(mdev);
|
||||
|
||||
disable_clk:
|
||||
clk_disable_unprepare(mdev->aclk);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int komeda_dev_suspend(struct komeda_dev *mdev)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
clk_prepare_enable(mdev->aclk);
|
||||
|
||||
if (mdev->iommu && mdev->funcs->disconnect_iommu) {
|
||||
ret = mdev->funcs->disconnect_iommu(mdev);
|
||||
if (ret < 0) {
|
||||
if (mdev->iommu && mdev->funcs->disconnect_iommu)
|
||||
if (mdev->funcs->disconnect_iommu(mdev))
|
||||
DRM_ERROR("disconnect iommu failed.\n");
|
||||
goto disable_clk;
|
||||
}
|
||||
}
|
||||
|
||||
ret = mdev->funcs->disable_irq(mdev);
|
||||
mdev->funcs->disable_irq(mdev);
|
||||
|
||||
disable_clk:
|
||||
clk_disable_unprepare(mdev->aclk);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#define KOMEDA_EVENT_OVR BIT_ULL(4)
|
||||
#define KOMEDA_EVENT_EOW BIT_ULL(5)
|
||||
#define KOMEDA_EVENT_MODE BIT_ULL(6)
|
||||
#define KOMEDA_EVENT_FULL BIT_ULL(7)
|
||||
#define KOMEDA_EVENT_EMPTY BIT_ULL(8)
|
||||
|
||||
#define KOMEDA_ERR_TETO BIT_ULL(14)
|
||||
#define KOMEDA_ERR_TEMR BIT_ULL(15)
|
||||
@@ -49,7 +51,8 @@
|
||||
KOMEDA_ERR_ZME | KOMEDA_ERR_MERR | KOMEDA_ERR_TCF |\
|
||||
KOMEDA_ERR_TTNG | KOMEDA_ERR_TTF)
|
||||
|
||||
#define KOMEDA_WARN_EVENTS KOMEDA_ERR_CSCE
|
||||
#define KOMEDA_WARN_EVENTS \
|
||||
(KOMEDA_ERR_CSCE | KOMEDA_EVENT_FULL | KOMEDA_EVENT_EMPTY)
|
||||
|
||||
#define KOMEDA_INFO_EVENTS (0 \
|
||||
| KOMEDA_EVENT_VSYNC \
|
||||
|
@@ -33,6 +33,12 @@ static void komeda_unbind(struct device *dev)
|
||||
return;
|
||||
|
||||
komeda_kms_detach(mdrv->kms);
|
||||
|
||||
if (pm_runtime_enabled(dev))
|
||||
pm_runtime_disable(dev);
|
||||
else
|
||||
komeda_dev_suspend(mdrv->mdev);
|
||||
|
||||
komeda_dev_destroy(mdrv->mdev);
|
||||
|
||||
dev_set_drvdata(dev, NULL);
|
||||
@@ -54,6 +60,10 @@ static int komeda_bind(struct device *dev)
|
||||
goto free_mdrv;
|
||||
}
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
if (!pm_runtime_enabled(dev))
|
||||
komeda_dev_resume(mdrv->mdev);
|
||||
|
||||
mdrv->kms = komeda_kms_attach(mdrv->mdev);
|
||||
if (IS_ERR(mdrv->kms)) {
|
||||
err = PTR_ERR(mdrv->kms);
|
||||
@@ -65,6 +75,11 @@ static int komeda_bind(struct device *dev)
|
||||
return 0;
|
||||
|
||||
destroy_mdev:
|
||||
if (pm_runtime_enabled(dev))
|
||||
pm_runtime_disable(dev);
|
||||
else
|
||||
komeda_dev_suspend(mdrv->mdev);
|
||||
|
||||
komeda_dev_destroy(mdrv->mdev);
|
||||
|
||||
free_mdrv:
|
||||
@@ -131,15 +146,29 @@ static const struct of_device_id komeda_of_match[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(of, komeda_of_match);
|
||||
|
||||
static int komeda_rt_pm_suspend(struct device *dev)
|
||||
{
|
||||
struct komeda_drv *mdrv = dev_get_drvdata(dev);
|
||||
|
||||
return komeda_dev_suspend(mdrv->mdev);
|
||||
}
|
||||
|
||||
static int komeda_rt_pm_resume(struct device *dev)
|
||||
{
|
||||
struct komeda_drv *mdrv = dev_get_drvdata(dev);
|
||||
|
||||
return komeda_dev_resume(mdrv->mdev);
|
||||
}
|
||||
|
||||
static int __maybe_unused komeda_pm_suspend(struct device *dev)
|
||||
{
|
||||
struct komeda_drv *mdrv = dev_get_drvdata(dev);
|
||||
struct drm_device *drm = &mdrv->kms->base;
|
||||
int res;
|
||||
|
||||
res = drm_mode_config_helper_suspend(drm);
|
||||
res = drm_mode_config_helper_suspend(&mdrv->kms->base);
|
||||
|
||||
komeda_dev_suspend(mdrv->mdev);
|
||||
if (!pm_runtime_status_suspended(dev))
|
||||
komeda_dev_suspend(mdrv->mdev);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -147,15 +176,16 @@ static int __maybe_unused komeda_pm_suspend(struct device *dev)
|
||||
static int __maybe_unused komeda_pm_resume(struct device *dev)
|
||||
{
|
||||
struct komeda_drv *mdrv = dev_get_drvdata(dev);
|
||||
struct drm_device *drm = &mdrv->kms->base;
|
||||
|
||||
komeda_dev_resume(mdrv->mdev);
|
||||
if (!pm_runtime_status_suspended(dev))
|
||||
komeda_dev_resume(mdrv->mdev);
|
||||
|
||||
return drm_mode_config_helper_resume(drm);
|
||||
return drm_mode_config_helper_resume(&mdrv->kms->base);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops komeda_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(komeda_pm_suspend, komeda_pm_resume)
|
||||
SET_RUNTIME_PM_OPS(komeda_rt_pm_suspend, komeda_rt_pm_resume, NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver komeda_platform_driver = {
|
||||
|
@@ -78,6 +78,8 @@ static void evt_str(struct komeda_str *str, u64 events)
|
||||
|
||||
/* LPU errors or events */
|
||||
evt_sprintf(str, events & KOMEDA_EVENT_IBSY, "IBSY|");
|
||||
evt_sprintf(str, events & KOMEDA_EVENT_EMPTY, "EMPTY|");
|
||||
evt_sprintf(str, events & KOMEDA_EVENT_FULL, "FULL|");
|
||||
evt_sprintf(str, events & KOMEDA_ERR_AXIE, "AXIE|");
|
||||
evt_sprintf(str, events & KOMEDA_ERR_ACE0, "ACE0|");
|
||||
evt_sprintf(str, events & KOMEDA_ERR_ACE1, "ACE1|");
|
||||
|
@@ -308,10 +308,6 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
|
||||
if (err)
|
||||
goto free_component_binding;
|
||||
|
||||
err = mdev->funcs->enable_irq(mdev);
|
||||
if (err)
|
||||
goto free_component_binding;
|
||||
|
||||
drm->irq_enabled = true;
|
||||
|
||||
drm_kms_helper_poll_init(drm);
|
||||
@@ -325,7 +321,6 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
|
||||
free_interrupts:
|
||||
drm_kms_helper_poll_fini(drm);
|
||||
drm->irq_enabled = false;
|
||||
mdev->funcs->disable_irq(mdev);
|
||||
free_component_binding:
|
||||
component_unbind_all(mdev->dev, drm);
|
||||
cleanup_mode_config:
|
||||
@@ -347,7 +342,6 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
|
||||
drm_kms_helper_poll_fini(drm);
|
||||
drm_atomic_helper_shutdown(drm);
|
||||
drm->irq_enabled = false;
|
||||
mdev->funcs->disable_irq(mdev);
|
||||
component_unbind_all(mdev->dev, drm);
|
||||
drm_mode_config_cleanup(drm);
|
||||
komeda_kms_cleanup_private_objs(kms);
|
||||
|
@@ -512,7 +512,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
|
||||
int i, ret;
|
||||
unsigned int block_w, block_h;
|
||||
|
||||
if (!state->crtc || !state->fb)
|
||||
if (!state->crtc || WARN_ON(!state->fb))
|
||||
return 0;
|
||||
|
||||
fb = state->fb;
|
||||
|
Reference in New Issue
Block a user