Commit 8b1f3dc8 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'exynos-drm-next' of...

Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

   This is final pull request for Exynos next and includes device tree
   support for fimc device, one revert, some code cleanups and fixup.
   The revert replaces wrong one[1] with correct one[2].
   This was my mistake and sorry for this.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: Don't blend mixer layer 0
  drm/exynos: Remove unnecessary braces in exynos_hdmi.c
  drm/exynos: Select VIDEOMODE_HELPERS for FIMD
  drm/exynos: do not use generic flags to dumb
  drm/exynos: added ipp device registration to drm driver
  exynos/drm: hdmi: cleanup for hdmi common device registration
  drm/exynos: fix wrong return check for platform_device_register_simple
  drm/exynos: add device tree support for fimc ipp driver
  drm/exynos: rework fimc clocks handling
  drm/exynos: remove redundant devm_kfree()
  drm/exynos: enable FIMD clocks
  Revert "drm/exynos: prepare FIMD clocks"
parents d8bf6b0d 0377f4ed
...@@ -25,8 +25,8 @@ config DRM_EXYNOS_DMABUF ...@@ -25,8 +25,8 @@ config DRM_EXYNOS_DMABUF
config DRM_EXYNOS_FIMD config DRM_EXYNOS_FIMD
bool "Exynos DRM FIMD" bool "Exynos DRM FIMD"
depends on OF && DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM depends on OF && DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM
select OF_VIDEOMODE
select FB_MODE_HELPERS select FB_MODE_HELPERS
select VIDEOMODE_HELPERS
help help
Choose this option if you want to use Exynos FIMD for DRM. Choose this option if you want to use Exynos FIMD for DRM.
...@@ -56,7 +56,7 @@ config DRM_EXYNOS_IPP ...@@ -56,7 +56,7 @@ config DRM_EXYNOS_IPP
config DRM_EXYNOS_FIMC config DRM_EXYNOS_FIMC
bool "Exynos DRM FIMC" bool "Exynos DRM FIMC"
depends on DRM_EXYNOS_IPP depends on DRM_EXYNOS_IPP && MFD_SYSCON && OF
help help
Choose this option if you want to use Exynos FIMC for DRM. Choose this option if you want to use Exynos FIMC for DRM.
......
...@@ -380,6 +380,10 @@ static int __init exynos_drm_init(void) ...@@ -380,6 +380,10 @@ static int __init exynos_drm_init(void)
ret = platform_driver_register(&ipp_driver); ret = platform_driver_register(&ipp_driver);
if (ret < 0) if (ret < 0)
goto out_ipp; goto out_ipp;
ret = exynos_platform_device_ipp_register();
if (ret < 0)
goto out_ipp_dev;
#endif #endif
ret = platform_driver_register(&exynos_drm_platform_driver); ret = platform_driver_register(&exynos_drm_platform_driver);
...@@ -388,7 +392,7 @@ static int __init exynos_drm_init(void) ...@@ -388,7 +392,7 @@ static int __init exynos_drm_init(void)
exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1, exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1,
NULL, 0); NULL, 0);
if (IS_ERR_OR_NULL(exynos_drm_pdev)) { if (IS_ERR(exynos_drm_pdev)) {
ret = PTR_ERR(exynos_drm_pdev); ret = PTR_ERR(exynos_drm_pdev);
goto out; goto out;
} }
...@@ -400,6 +404,8 @@ static int __init exynos_drm_init(void) ...@@ -400,6 +404,8 @@ static int __init exynos_drm_init(void)
out_drm: out_drm:
#ifdef CONFIG_DRM_EXYNOS_IPP #ifdef CONFIG_DRM_EXYNOS_IPP
exynos_platform_device_ipp_unregister();
out_ipp_dev:
platform_driver_unregister(&ipp_driver); platform_driver_unregister(&ipp_driver);
out_ipp: out_ipp:
#endif #endif
...@@ -456,6 +462,7 @@ static void __exit exynos_drm_exit(void) ...@@ -456,6 +462,7 @@ static void __exit exynos_drm_exit(void)
platform_driver_unregister(&exynos_drm_platform_driver); platform_driver_unregister(&exynos_drm_platform_driver);
#ifdef CONFIG_DRM_EXYNOS_IPP #ifdef CONFIG_DRM_EXYNOS_IPP
exynos_platform_device_ipp_unregister();
platform_driver_unregister(&ipp_driver); platform_driver_unregister(&ipp_driver);
#endif #endif
......
...@@ -322,13 +322,23 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file); ...@@ -322,13 +322,23 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file);
* this function registers exynos drm hdmi platform device. It ensures only one * this function registers exynos drm hdmi platform device. It ensures only one
* instance of the device is created. * instance of the device is created.
*/ */
extern int exynos_platform_device_hdmi_register(void); int exynos_platform_device_hdmi_register(void);
/* /*
* this function unregisters exynos drm hdmi platform device if it exists. * this function unregisters exynos drm hdmi platform device if it exists.
*/ */
void exynos_platform_device_hdmi_unregister(void); void exynos_platform_device_hdmi_unregister(void);
/*
* this function registers exynos drm ipp platform device.
*/
int exynos_platform_device_ipp_register(void);
/*
* this function unregisters exynos drm ipp platform device if it exists.
*/
void exynos_platform_device_ipp_unregister(void);
extern struct platform_driver fimd_driver; extern struct platform_driver fimd_driver;
extern struct platform_driver hdmi_driver; extern struct platform_driver hdmi_driver;
extern struct platform_driver mixer_driver; extern struct platform_driver mixer_driver;
......
This diff is collapsed.
...@@ -801,18 +801,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable) ...@@ -801,18 +801,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable)
if (enable) { if (enable) {
int ret; int ret;
ret = clk_enable(ctx->bus_clk); ret = clk_prepare_enable(ctx->bus_clk);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = clk_enable(ctx->lcd_clk); ret = clk_prepare_enable(ctx->lcd_clk);
if (ret < 0) { if (ret < 0) {
clk_disable(ctx->bus_clk); clk_disable_unprepare(ctx->bus_clk);
return ret; return ret;
} }
} else { } else {
clk_disable(ctx->lcd_clk); clk_disable_unprepare(ctx->lcd_clk);
clk_disable(ctx->bus_clk); clk_disable_unprepare(ctx->bus_clk);
} }
return 0; return 0;
...@@ -949,16 +949,6 @@ static int fimd_probe(struct platform_device *pdev) ...@@ -949,16 +949,6 @@ static int fimd_probe(struct platform_device *pdev)
return ret; return ret;
} }
ret = clk_prepare(ctx->bus_clk);
if (ret < 0)
return ret;
ret = clk_prepare(ctx->lcd_clk);
if (ret < 0) {
clk_unprepare(ctx->bus_clk);
return ret;
}
ctx->vidcon0 = pdata->vidcon0; ctx->vidcon0 = pdata->vidcon0;
ctx->vidcon1 = pdata->vidcon1; ctx->vidcon1 = pdata->vidcon1;
ctx->default_win = pdata->default_win; ctx->default_win = pdata->default_win;
...@@ -1006,9 +996,6 @@ static int fimd_remove(struct platform_device *pdev) ...@@ -1006,9 +996,6 @@ static int fimd_remove(struct platform_device *pdev)
if (ctx->suspended) if (ctx->suspended)
goto out; goto out;
clk_unprepare(ctx->lcd_clk);
clk_unprepare(ctx->bus_clk);
pm_runtime_set_suspended(dev); pm_runtime_set_suspended(dev);
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
......
...@@ -682,7 +682,8 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, ...@@ -682,7 +682,8 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
args->pitch = args->width * ((args->bpp + 7) / 8); args->pitch = args->width * ((args->bpp + 7) / 8);
args->size = args->pitch * args->height; args->size = args->pitch * args->height;
exynos_gem_obj = exynos_drm_gem_create(dev, args->flags, args->size); exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG |
EXYNOS_BO_WC, args->size);
if (IS_ERR(exynos_gem_obj)) if (IS_ERR(exynos_gem_obj))
return PTR_ERR(exynos_gem_obj); return PTR_ERR(exynos_gem_obj);
......
...@@ -51,21 +51,27 @@ struct drm_hdmi_context { ...@@ -51,21 +51,27 @@ struct drm_hdmi_context {
int exynos_platform_device_hdmi_register(void) int exynos_platform_device_hdmi_register(void)
{ {
struct platform_device *pdev;
if (exynos_drm_hdmi_pdev) if (exynos_drm_hdmi_pdev)
return -EEXIST; return -EEXIST;
exynos_drm_hdmi_pdev = platform_device_register_simple( pdev = platform_device_register_simple(
"exynos-drm-hdmi", -1, NULL, 0); "exynos-drm-hdmi", -1, NULL, 0);
if (IS_ERR_OR_NULL(exynos_drm_hdmi_pdev)) if (IS_ERR(pdev))
return PTR_ERR(exynos_drm_hdmi_pdev); return PTR_ERR(pdev);
exynos_drm_hdmi_pdev = pdev;
return 0; return 0;
} }
void exynos_platform_device_hdmi_unregister(void) void exynos_platform_device_hdmi_unregister(void)
{ {
if (exynos_drm_hdmi_pdev) if (exynos_drm_hdmi_pdev) {
platform_device_unregister(exynos_drm_hdmi_pdev); platform_device_unregister(exynos_drm_hdmi_pdev);
exynos_drm_hdmi_pdev = NULL;
}
} }
void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx) void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx)
......
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
#define get_ipp_context(dev) platform_get_drvdata(to_platform_device(dev)) #define get_ipp_context(dev) platform_get_drvdata(to_platform_device(dev))
#define ipp_is_m2m_cmd(c) (c == IPP_CMD_M2M) #define ipp_is_m2m_cmd(c) (c == IPP_CMD_M2M)
/* platform device pointer for ipp device. */
static struct platform_device *exynos_drm_ipp_pdev;
/* /*
* A structure of event. * A structure of event.
* *
...@@ -102,6 +105,30 @@ static LIST_HEAD(exynos_drm_ippdrv_list); ...@@ -102,6 +105,30 @@ static LIST_HEAD(exynos_drm_ippdrv_list);
static DEFINE_MUTEX(exynos_drm_ippdrv_lock); static DEFINE_MUTEX(exynos_drm_ippdrv_lock);
static BLOCKING_NOTIFIER_HEAD(exynos_drm_ippnb_list); static BLOCKING_NOTIFIER_HEAD(exynos_drm_ippnb_list);
int exynos_platform_device_ipp_register(void)
{
struct platform_device *pdev;
if (exynos_drm_ipp_pdev)
return -EEXIST;
pdev = platform_device_register_simple("exynos-drm-ipp", -1, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);
exynos_drm_ipp_pdev = pdev;
return 0;
}
void exynos_platform_device_ipp_unregister(void)
{
if (exynos_drm_ipp_pdev) {
platform_device_unregister(exynos_drm_ipp_pdev);
exynos_drm_ipp_pdev = NULL;
}
}
int exynos_drm_ippdrv_register(struct exynos_drm_ippdrv *ippdrv) int exynos_drm_ippdrv_register(struct exynos_drm_ippdrv *ippdrv)
{ {
DRM_DEBUG_KMS("%s\n", __func__); DRM_DEBUG_KMS("%s\n", __func__);
......
...@@ -1373,11 +1373,10 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata) ...@@ -1373,11 +1373,10 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata)
return; return;
} }
if (hdata->type == HDMI_TYPE13) { if (hdata->type == HDMI_TYPE13)
hdmiphy_data = hdmiphy_v13_configs[i].conf; hdmiphy_data = hdmiphy_v13_configs[i].conf;
} else { else
hdmiphy_data = hdmiphy_v14_configs[i].conf; hdmiphy_data = hdmiphy_v14_configs[i].conf;
}
memcpy(buffer, hdmiphy_data, 32); memcpy(buffer, hdmiphy_data, 32);
ret = i2c_master_send(hdata->hdmiphy_port, buffer, 32); ret = i2c_master_send(hdata->hdmiphy_port, buffer, 32);
...@@ -1653,11 +1652,10 @@ static void hdmi_mode_set(void *ctx, void *mode) ...@@ -1653,11 +1652,10 @@ static void hdmi_mode_set(void *ctx, void *mode)
m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ? m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ?
"INTERLACED" : "PROGERESSIVE"); "INTERLACED" : "PROGERESSIVE");
if (hdata->type == HDMI_TYPE13) { if (hdata->type == HDMI_TYPE13)
hdmi_v13_mode_set(hdata, mode); hdmi_v13_mode_set(hdata, mode);
} else { else
hdmi_v14_mode_set(hdata, mode); hdmi_v14_mode_set(hdata, mode);
}
} }
static void hdmi_get_max_resol(void *ctx, unsigned int *width, static void hdmi_get_max_resol(void *ctx, unsigned int *width,
......
...@@ -643,12 +643,14 @@ static void mixer_win_reset(struct mixer_context *ctx) ...@@ -643,12 +643,14 @@ static void mixer_win_reset(struct mixer_context *ctx)
/* setting graphical layers */ /* setting graphical layers */
val = MXR_GRP_CFG_COLOR_KEY_DISABLE; /* no blank key */ val = MXR_GRP_CFG_COLOR_KEY_DISABLE; /* no blank key */
val |= MXR_GRP_CFG_WIN_BLEND_EN; val |= MXR_GRP_CFG_WIN_BLEND_EN;
val |= MXR_GRP_CFG_BLEND_PRE_MUL;
val |= MXR_GRP_CFG_PIXEL_BLEND_EN;
val |= MXR_GRP_CFG_ALPHA_VAL(0xff); /* non-transparent alpha */ val |= MXR_GRP_CFG_ALPHA_VAL(0xff); /* non-transparent alpha */
/* the same configuration for both layers */ /* Don't blend layer 0 onto the mixer background */
mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val); mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val);
/* Blend layer 1 into layer 0 */
val |= MXR_GRP_CFG_BLEND_PRE_MUL;
val |= MXR_GRP_CFG_PIXEL_BLEND_EN;
mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val); mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val);
/* setting video layers */ /* setting video layers */
......
...@@ -661,9 +661,8 @@ ...@@ -661,9 +661,8 @@
#define EXYNOS_CLKSRC_SCLK (1 << 1) #define EXYNOS_CLKSRC_SCLK (1 << 1)
/* SYSREG for FIMC writeback */ /* SYSREG for FIMC writeback */
#define SYSREG_CAMERA_BLK (S3C_VA_SYS + 0x0218) #define SYSREG_CAMERA_BLK (0x0218)
#define SYSREG_ISP_BLK (S3C_VA_SYS + 0x020c) #define SYSREG_FIMD0WB_DEST_MASK (0x3 << 23)
#define SYSREG_FIMD0WB_DEST_MASK (0x3 << 23) #define SYSREG_FIMD0WB_DEST_SHIFT 23
#define SYSREG_FIMD0WB_DEST_SHIFT 23
#endif /* EXYNOS_REGS_FIMC_H */ #endif /* EXYNOS_REGS_FIMC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment