[PATCH 3/3] drm/exynos: Add device tree support for fimc ipp driver
Dear Sylwester Nawrocki. Sorry. I didn't check your third patch. I understand the "mux", "parent" meaning. please ignore my comment of "mux", "parent" and please check below comments. Thank's BR Eunchul Kim. On 04/17/2013 02:31 AM, Sylwester Nawrocki wrote: > This patch adds OF initialization support for the FIMC driver. > The binding documentation can be found at Documentation/devicetree/ > bindings/media/samsung-fimc.txt. > > The syscon regmap interface is used to serialize access to the > shared CAMBLK registers from within the V4L2 FIMC-IS and the DRM > FIMC drivers. The DRM driver uses this interface for setting up > the FIFO data link between FIMD and FIMC IP blocks, while the V4L2 > one for setting up a data link between the camera ISP and FIMC for > camera capture. The CAMBLK registers are not accessed any more > through a statically mapped IO. Synchronized access to these > registers is required for simultaneous operation of the camera > ISP and the DRM IPP on Exynos4x12. > > Exynos4 is going to be a dt-only platform since 3.10, thus the > driver data and driver_ids static data structures are removed. > > Camera input signal polarities are not currently parsed from the > device tree. > > Signed-off-by: Sylwester Nawrocki > Signed-off-by: Kyungmin Park > --- > drivers/gpu/drm/exynos/Kconfig |2 +- > drivers/gpu/drm/exynos/exynos_drm_fimc.c | 101 > +++--- > drivers/gpu/drm/exynos/regs-fimc.h |7 +-- > 3 files changed, 53 insertions(+), 57 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig > index 406f32a..5c4be2a 100644 > --- a/drivers/gpu/drm/exynos/Kconfig > +++ b/drivers/gpu/drm/exynos/Kconfig > @@ -56,7 +56,7 @@ config DRM_EXYNOS_IPP > > config DRM_EXYNOS_FIMC > bool "Exynos DRM FIMC" > - depends on DRM_EXYNOS_IPP > + depends on DRM_EXYNOS_IPP && MFD_SYSCON && OF > help > Choose this option if you want to use Exynos FIMC for DRM. > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c > b/drivers/gpu/drm/exynos/exynos_drm_fimc.c > index 9bea585..f25801e 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c > @@ -12,11 +12,12 @@ >* >*/ > #include > +#include > #include > #include > +#include > #include > #include > -#include > > #include > #include > @@ -140,15 +141,6 @@ struct fimc_capability { > }; > > /* > - * A structure of fimc driver data. > - * > - * @parent_clk: name of parent clock. > - */ > -struct fimc_driverdata { > - char*parent_clk; > -}; > - > -/* >* A structure of fimc context. >* >* @ippdrv: prepare initialization using ippdrv. > @@ -158,6 +150,7 @@ struct fimc_driverdata { >* @lock: locking of operations. >* @clocks: fimc clocks. >* @clk_frequency: LCLK clock frequency. > + * @sysreg: handle to SYSREG block regmap. >* @sc: scaler infomations. >* @pol: porarity of writeback. >* @id: fimc id. > @@ -172,8 +165,8 @@ struct fimc_context { > struct mutexlock; > struct clk *clocks[FIMC_CLKS_MAX]; > u32 clk_frequency; > + struct regmap *sysreg; > struct fimc_scaler sc; > - struct fimc_driverdata *ddata; > struct exynos_drm_ipp_pol pol; > int id; > int irq; > @@ -217,17 +210,13 @@ static void fimc_sw_reset(struct fimc_context *ctx) > fimc_write(0x0, EXYNOS_CIFCNTSEQ); > } > > -static void fimc_set_camblk_fimd0_wb(struct fimc_context *ctx) > +static int fimc_set_camblk_fimd0_wb(struct fimc_context *ctx) > { > - u32 camblk_cfg; > - > DRM_DEBUG_KMS("%s\n", __func__); > > - camblk_cfg = readl(SYSREG_CAMERA_BLK); > - camblk_cfg &= ~(SYSREG_FIMD0WB_DEST_MASK); > - camblk_cfg |= ctx->id << (SYSREG_FIMD0WB_DEST_SHIFT); > - > - writel(camblk_cfg, SYSREG_CAMERA_BLK); > + return regmap_update_bits(ctx->sysreg, SYSREG_CAMERA_BLK, > + SYSREG_FIMD0WB_DEST_MASK, > + ctx->id << SYSREG_FIMD0WB_DEST_SHIFT); > } > > static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb) > @@ -1628,7 +1617,9 @@ static int fimc_ippdrv_start(struct device *dev, enum > drm_exynos_ipp_cmd cmd) > fimc_handle_lastend(ctx, true); > > /* setup FIMD */ > - fimc_set_camblk_fimd0_wb(ctx); > + ret = fimc_set_camblk_fimd0_wb(ctx); > +
[PATCH v2 2/3] drm/exynos: Rework fimc clocks handling
Dear Sylwester Nawrocki Thank you for your update. I have some question of your patch. please give your information to me. Thank's BR Eunchul Kim. On 04/17/2013 06:53 PM, Sylwester Nawrocki wrote: > The clocks handling is refactored and a "mux" clock handling is > added to account for changes in the clocks driver. After switching > to the common clock framework the sclk_fimc clock is now split > into two clocks: a gate and a mux clock. In order to retain the > exisiting functionality two additional consumer clocks are passed > to the driver from device tree: "mux" and "parent". Then the driver > sets "parent" clock as a parent clock of the "mux" clock. These two > additional clocks are optional, and should go away when there is a > standard way of setting up parent clocks on DT platforms. > > Signed-off-by: Sylwester Nawrocki > Signed-off-by: Kyungmin Park > --- > drivers/gpu/drm/exynos/exynos_drm_fimc.c | 167 > +- > 1 file changed, 97 insertions(+), 70 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c > b/drivers/gpu/drm/exynos/exynos_drm_fimc.c > index d812c57..bc8411a 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c > @@ -76,6 +76,27 @@ enum fimc_wb { > FIMC_WB_B, > }; > > +enum { > + FIMC_CLK_LCLK, > + FIMC_CLK_GATE, > + FIMC_CLK_WB_A, > + FIMC_CLK_WB_B, > + FIMC_CLK_MUX, > + FIMC_CLK_PARENT, - What is MUX, PARENT ? > + FIMC_CLKS_MAX > +}; > + > +static const char * fimc_clock_names[] = { > + [FIMC_CLK_LCLK] = "sclk_fimc", > + [FIMC_CLK_GATE] = "fimc", > + [FIMC_CLK_WB_A] = "pxl_async0", > + [FIMC_CLK_WB_B] = "pxl_async1", > + [FIMC_CLK_MUX]= "mux", > + [FIMC_CLK_PARENT] = "parent", - How can I get "mux", "parent" clock information ? Normally we are using "mout_mpll" in exynos4210, "mout_mpll_user" in exynos 4412. I want to get this two kind of clock name information. > +}; > + > +#define FIMC_DEFAULT_LCLK_FREQUENCY 13300UL - When do I use this value in the patch ? If not use. please remove this macro. If you want to use this value. please use platform data instead of macro. > + > /* >* A structure of scaler. >* > @@ -132,15 +153,12 @@ struct fimc_driverdata { >* >* @ippdrv: prepare initialization using ippdrv. >* @regs_res: register resources. > + * @dev: pointer to the fimc device structure. - We already set the dev information in ippdrv structure. I think this value is duplicated value. >* @regs: memory mapped io registers. >* @lock: locking of operations. > - * @sclk_fimc_clk: fimc source clock. > - * @fimc_clk: fimc clock. > - * @wb_clk: writeback a clock. > - * @wb_b_clk: writeback b clock. > + * @clocks: fimc clocks. > + * @clk_frequency: LCLK clock frequency. >* @sc: scaler infomations. > - * @odr: ordering of YUV. > - * @ver: fimc version. >* @pol: porarity of writeback. >* @id: fimc id. >* @irq: irq number. > @@ -148,13 +166,12 @@ struct fimc_driverdata { >*/ > struct fimc_context { > struct exynos_drm_ippdrvippdrv; > + struct device *dev; - please check this value about really need ? > struct resource *regs_res; > void __iomem*regs; > struct mutexlock; > - struct clk *sclk_fimc_clk; > - struct clk *fimc_clk; > - struct clk *wb_clk; > - struct clk *wb_b_clk; > + struct clk *clocks[FIMC_CLKS_MAX]; > + u32 clk_frequency; > struct fimc_scaler sc; > struct fimc_driverdata *ddata; > struct exynos_drm_ipp_pol pol; > @@ -1301,14 +1318,12 @@ static int fimc_clk_ctrl(struct fimc_context *ctx, > bool enable) > DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable); > > if (enable) { > - clk_enable(ctx->sclk_fimc_clk); > - clk_enable(ctx->fimc_clk); > - clk_enable(ctx->wb_clk); > + clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]); > + clk_prepare_enable(ctx->clocks[FIMC_CLK_WB_A]); > ctx->suspended = false; > } else { > - clk_disable(ctx->sclk_fimc_clk); > - clk_disable(ctx->fimc_clk); > - clk_disable(ctx->wb_clk); > + clk_disable_unprepare(ctx->clocks[FIMC_CLK_GATE]); > + clk_disable_unprepare(ctx->clocks[FIMC_CLK_WB_A]); > ctx->suspend
Re: [PATCH v2 2/3] drm/exynos: Rework fimc clocks handling
Dear Sylwester Nawrocki Thank you for your update. I have some question of your patch. please give your information to me. Thank's BR Eunchul Kim. On 04/17/2013 06:53 PM, Sylwester Nawrocki wrote: The clocks handling is refactored and a mux clock handling is added to account for changes in the clocks driver. After switching to the common clock framework the sclk_fimc clock is now split into two clocks: a gate and a mux clock. In order to retain the exisiting functionality two additional consumer clocks are passed to the driver from device tree: mux and parent. Then the driver sets parent clock as a parent clock of the mux clock. These two additional clocks are optional, and should go away when there is a standard way of setting up parent clocks on DT platforms. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 167 +- 1 file changed, 97 insertions(+), 70 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index d812c57..bc8411a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -76,6 +76,27 @@ enum fimc_wb { FIMC_WB_B, }; +enum { + FIMC_CLK_LCLK, + FIMC_CLK_GATE, + FIMC_CLK_WB_A, + FIMC_CLK_WB_B, + FIMC_CLK_MUX, + FIMC_CLK_PARENT, - What is MUX, PARENT ? + FIMC_CLKS_MAX +}; + +static const char * fimc_clock_names[] = { + [FIMC_CLK_LCLK] = sclk_fimc, + [FIMC_CLK_GATE] = fimc, + [FIMC_CLK_WB_A] = pxl_async0, + [FIMC_CLK_WB_B] = pxl_async1, + [FIMC_CLK_MUX]= mux, + [FIMC_CLK_PARENT] = parent, - How can I get mux, parent clock information ? Normally we are using mout_mpll in exynos4210, mout_mpll_user in exynos 4412. I want to get this two kind of clock name information. +}; + +#define FIMC_DEFAULT_LCLK_FREQUENCY 13300UL - When do I use this value in the patch ? If not use. please remove this macro. If you want to use this value. please use platform data instead of macro. + /* * A structure of scaler. * @@ -132,15 +153,12 @@ struct fimc_driverdata { * * @ippdrv: prepare initialization using ippdrv. * @regs_res: register resources. + * @dev: pointer to the fimc device structure. - We already set the dev information in ippdrv structure. I think this value is duplicated value. * @regs: memory mapped io registers. * @lock: locking of operations. - * @sclk_fimc_clk: fimc source clock. - * @fimc_clk: fimc clock. - * @wb_clk: writeback a clock. - * @wb_b_clk: writeback b clock. + * @clocks: fimc clocks. + * @clk_frequency: LCLK clock frequency. * @sc: scaler infomations. - * @odr: ordering of YUV. - * @ver: fimc version. * @pol: porarity of writeback. * @id: fimc id. * @irq: irq number. @@ -148,13 +166,12 @@ struct fimc_driverdata { */ struct fimc_context { struct exynos_drm_ippdrvippdrv; + struct device *dev; - please check this value about really need ? struct resource *regs_res; void __iomem*regs; struct mutexlock; - struct clk *sclk_fimc_clk; - struct clk *fimc_clk; - struct clk *wb_clk; - struct clk *wb_b_clk; + struct clk *clocks[FIMC_CLKS_MAX]; + u32 clk_frequency; struct fimc_scaler sc; struct fimc_driverdata *ddata; struct exynos_drm_ipp_pol pol; @@ -1301,14 +1318,12 @@ static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable) DRM_DEBUG_KMS(%s:enable[%d]\n, __func__, enable); if (enable) { - clk_enable(ctx-sclk_fimc_clk); - clk_enable(ctx-fimc_clk); - clk_enable(ctx-wb_clk); + clk_prepare_enable(ctx-clocks[FIMC_CLK_GATE]); + clk_prepare_enable(ctx-clocks[FIMC_CLK_WB_A]); ctx-suspended = false; } else { - clk_disable(ctx-sclk_fimc_clk); - clk_disable(ctx-fimc_clk); - clk_disable(ctx-wb_clk); + clk_disable_unprepare(ctx-clocks[FIMC_CLK_GATE]); + clk_disable_unprepare(ctx-clocks[FIMC_CLK_WB_A]); ctx-suspended = true; } @@ -1713,11 +1728,66 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd) fimc_write(cfg, EXYNOS_CIGCTRL); } +static void fimc_put_clocks(struct fimc_context *ctx) +{ + int i; + + for (i = 0; i FIMC_CLKS_MAX; i++) { + if (IS_ERR(ctx-clocks[i])) + continue; + clk_put(ctx-clocks[i]); + ctx-clocks[i] = ERR_PTR(-EINVAL); + } +} + +static int fimc_setup_clocks(struct fimc_context *ctx) +{ + struct device *dev; + int ret, i; + + for (i = 0; i FIMC_CLKS_MAX
Re: [PATCH 3/3] drm/exynos: Add device tree support for fimc ipp driver
Dear Sylwester Nawrocki. Sorry. I didn't check your third patch. I understand the mux, parent meaning. please ignore my comment of mux, parent and please check below comments. Thank's BR Eunchul Kim. On 04/17/2013 02:31 AM, Sylwester Nawrocki wrote: This patch adds OF initialization support for the FIMC driver. The binding documentation can be found at Documentation/devicetree/ bindings/media/samsung-fimc.txt. The syscon regmap interface is used to serialize access to the shared CAMBLK registers from within the V4L2 FIMC-IS and the DRM FIMC drivers. The DRM driver uses this interface for setting up the FIFO data link between FIMD and FIMC IP blocks, while the V4L2 one for setting up a data link between the camera ISP and FIMC for camera capture. The CAMBLK registers are not accessed any more through a statically mapped IO. Synchronized access to these registers is required for simultaneous operation of the camera ISP and the DRM IPP on Exynos4x12. Exynos4 is going to be a dt-only platform since 3.10, thus the driver data and driver_ids static data structures are removed. Camera input signal polarities are not currently parsed from the device tree. Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- drivers/gpu/drm/exynos/Kconfig |2 +- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 101 +++--- drivers/gpu/drm/exynos/regs-fimc.h |7 +-- 3 files changed, 53 insertions(+), 57 deletions(-) diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 406f32a..5c4be2a 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -56,7 +56,7 @@ config DRM_EXYNOS_IPP config DRM_EXYNOS_FIMC bool Exynos DRM FIMC - depends on DRM_EXYNOS_IPP + depends on DRM_EXYNOS_IPP MFD_SYSCON OF help Choose this option if you want to use Exynos FIMC for DRM. diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 9bea585..f25801e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -12,11 +12,12 @@ * */ #include linux/kernel.h +#include linux/mfd/syscon.h #include linux/module.h #include linux/platform_device.h +#include linux/regmap.h #include linux/clk.h #include linux/pm_runtime.h -#include plat/map-base.h #include drm/drmP.h #include drm/exynos_drm.h @@ -140,15 +141,6 @@ struct fimc_capability { }; /* - * A structure of fimc driver data. - * - * @parent_clk: name of parent clock. - */ -struct fimc_driverdata { - char*parent_clk; -}; - -/* * A structure of fimc context. * * @ippdrv: prepare initialization using ippdrv. @@ -158,6 +150,7 @@ struct fimc_driverdata { * @lock: locking of operations. * @clocks: fimc clocks. * @clk_frequency: LCLK clock frequency. + * @sysreg: handle to SYSREG block regmap. * @sc: scaler infomations. * @pol: porarity of writeback. * @id: fimc id. @@ -172,8 +165,8 @@ struct fimc_context { struct mutexlock; struct clk *clocks[FIMC_CLKS_MAX]; u32 clk_frequency; + struct regmap *sysreg; struct fimc_scaler sc; - struct fimc_driverdata *ddata; struct exynos_drm_ipp_pol pol; int id; int irq; @@ -217,17 +210,13 @@ static void fimc_sw_reset(struct fimc_context *ctx) fimc_write(0x0, EXYNOS_CIFCNTSEQ); } -static void fimc_set_camblk_fimd0_wb(struct fimc_context *ctx) +static int fimc_set_camblk_fimd0_wb(struct fimc_context *ctx) { - u32 camblk_cfg; - DRM_DEBUG_KMS(%s\n, __func__); - camblk_cfg = readl(SYSREG_CAMERA_BLK); - camblk_cfg = ~(SYSREG_FIMD0WB_DEST_MASK); - camblk_cfg |= ctx-id (SYSREG_FIMD0WB_DEST_SHIFT); - - writel(camblk_cfg, SYSREG_CAMERA_BLK); + return regmap_update_bits(ctx-sysreg, SYSREG_CAMERA_BLK, + SYSREG_FIMD0WB_DEST_MASK, + ctx-id SYSREG_FIMD0WB_DEST_SHIFT); } static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb) @@ -1628,7 +1617,9 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) fimc_handle_lastend(ctx, true); /* setup FIMD */ - fimc_set_camblk_fimd0_wb(ctx); + ret = fimc_set_camblk_fimd0_wb(ctx); + if (ret 0) - please adds error log information for indicating error. + return ret; set_wb.enable = 1; set_wb.refresh = property-refresh_rate; @@ -1784,26 +1775,50 @@ e_clk_free: return ret; } +static int fimc_parse_dt(struct fimc_context *ctx) +{ + struct device_node *node = ctx-dev-of_node; + + if (!of_property_read_bool(node, samsung,lcd-wb)) - It also need error log
[PATCH v3 8/8] drm/exynos: remove needless parenthesis.
This patch removes needless parenthesis. This was pointed out but in case of fimc side. we missed it. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 9f52b7f..2c03ffa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1212,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, } /* sequence id */ - cfg &= (~mask); + cfg &= ~mask; cfg |= (enable << buf_id); fimc_write(cfg, EXYNOS_CIFCNTSEQ); -- 1.7.0.4
[PATCH v3 7/8] drm/exynos: fix incorrect interrupt induced by m2m operation.
From: Jinyoung Jeon <jy0.j...@samsung.com> This patch fixes incorrect interrupt induced by m2m operation. the m2m operation calls s/w reset every frame but there is the case that the interrupt to m2m operation occures after s/w reset sometimes. So this patch makes dma and capture operations stop at s/w reset to avoid incorrect interrupt. Signed-off-by: Jinyoung Jeon Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index a99ceef..9f52b7f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -169,10 +169,23 @@ static void fimc_sw_reset(struct fimc_context *ctx) DRM_DEBUG_KMS("%s\n", __func__); + /* stop dma operation */ + cfg = fimc_read(EXYNOS_CISTATUS); + if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { + cfg = fimc_read(EXYNOS_MSCTRL); + cfg &= ~EXYNOS_MSCTRL_ENVID; + fimc_write(cfg, EXYNOS_MSCTRL); + } + cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; fimc_write(cfg, EXYNOS_CISRCFMT); + /* disable image capture */ + cfg = fimc_read(EXYNOS_CIIMGCPT); + cfg &= ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN); + fimc_write(cfg, EXYNOS_CIIMGCPT); + /* s/w reset */ cfg = fimc_read(EXYNOS_CIGCTRL); cfg |= (EXYNOS_CIGCTRL_SWRST); -- 1.7.0.4
[PATCH v3 6/8] drm/exynos: remove color bar pattern operation.
From: JoongMock Shin <jmock.s...@samsung.com> This patch removes color bar pattern register because we don't use the register anymore. because it doesn't support color bar feature for writeback operation. camera driver only supports color bar feature. but IPP doesn't support camera driver. Signed-off-by: JoongMock Shin Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8cfc5a9..a99ceef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -163,17 +163,14 @@ struct fimc_context { boolsuspended; }; -static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) +static void fimc_sw_reset(struct fimc_context *ctx) { u32 cfg; - DRM_DEBUG_KMS("%s:pattern[%d]\n", __func__, pattern); + DRM_DEBUG_KMS("%s\n", __func__); cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; - if (pattern) - cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR; - fimc_write(cfg, EXYNOS_CISRCFMT); /* s/w reset */ @@ -1536,7 +1533,7 @@ static int fimc_ippdrv_reset(struct device *dev) DRM_DEBUG_KMS("%s\n", __func__); /* reset h/w block */ - fimc_sw_reset(ctx, false); + fimc_sw_reset(ctx); /* reset scaler capability */ memset(>sc, 0x0, sizeof(ctx->sc)); -- 1.7.0.4
[PATCH v3 5/8] drm/exynos: correct some comments to abbreviation.
This patch cleanup corrects some comments to abbreviation. We would like to prevent it stands misunderstood. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index abfff9e..8cfc5a9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,7 @@ #include "exynos_drm_fimc.h" /* - * FIMC is stand for Fully Interactive Mobile Camera and + * FIMC stands for Fully Interactive Mobile Camera and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 410175a..509f2f8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -25,7 +25,7 @@ #include "exynos_drm_gsc.h" /* - * GSC is stand for General SCaler and + * GSC stands for General SCaler and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index cac94fe..63bcf92 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -27,7 +27,7 @@ #include "exynos_drm_iommu.h" /* - * IPP is stand for Image Post Processing and + * IPP stands for Image Post Processing and * supports image scaler/rotator and input/output DMA operations. * using FIMC, GSC, Rotator, so on. * IPP is integration device driver of same attribute h/w -- 1.7.0.4
[PATCH v3 4/8] drm/exynos: fix build warning.
This patch fixes erroneous register read. reall function needs register base address + offset but exynos_drm_gsc module used only offset to read a register. so this patch uses gsc_read function instead of readl. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 3e5b456..410175a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1592,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)_wb); /* src local path */ - cfg = readl(GSC_IN_CON); + cfg = gsc_read(GSC_IN_CON); cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); gsc_write(cfg, GSC_IN_CON); -- 1.7.0.4
[PATCH v3 3/8] drm/exynos: consider both case of vflip and hflip.
This patch considers both case of vflip and hflip. If we want that the contents in buffer to be rotated to 180 degree, then we can use h,vflip or 180 degree. Changelog v2: - added EXYNOS_DRM_FLIP_BOTH enum value to avoid build warnning. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + include/uapi/drm/exynos_drm.h |2 ++ 4 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..abfff9e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ba5fefd..3e5b456 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1391,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: - case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..8bf9c50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h index e7f52c3..7ed11b2 100644 --- a/include/uapi/drm/exynos_drm.h +++ b/include/uapi/drm/exynos_drm.h @@ -185,6 +185,8 @@ enum drm_exynos_flip { EXYNOS_DRM_FLIP_NONE = (0 << 0), EXYNOS_DRM_FLIP_VERTICAL = (1 << 0), EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1), + EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | + EXYNOS_DRM_FLIP_HORIZONTAL, }; enum drm_exynos_degree { -- 1.7.0.4
[PATCH v3 2/8] drm/exynos: remove needless error handling to property.
This patch removes property error handling. because property couldn't be NULL. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 drivers/gpu/drm/exynos/exynos_drm_ipp.c |5 - 3 files changed, 0 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 7a3e460..5dc0251 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -705,10 +705,6 @@ static int fimc_src_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1241,10 +1237,6 @@ static int fimc_dst_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1573,10 +1565,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } fimc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c443c3b..ba5fefd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EFAULT; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EFAULT; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } gsc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index ba45f9a..cac94fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) mutex_lock(_node->cmd_lock); property = _node->property; - if (!property) { - DRM_ERROR("failed to get property:prop_id[%d]\n", - c_node->property.prop_id); - goto err_unlock; - } switch (cmd_work->ctrl) { case IPP_CTRL_PLAY: -- 1.7.0.4
[PATCH v3 1/8] drm/exynos: change member variable name.
This patch change current command name from cmd to c_node. because we are using the member name, 'cmd', for command control ioctl in another structure. so, this patch changes it to c_node to avoid such confusing. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|8 drivers/gpu/drm/exynos/exynos_drm_gsc.c |8 drivers/gpu/drm/exynos/exynos_drm_ipp.c |6 +++--- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c |2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 61ea242..7a3e460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -695,7 +695,7 @@ static int fimc_src_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1231,7 +1231,7 @@ static int fimc_dst_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1317,7 +1317,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) { struct fimc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_event_work *event_work = c_node->event_work; int buf_id; @@ -1557,7 +1557,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..c443c3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1171,7 +1171,7 @@ static int gsc_dst_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1312,7 +1312,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) { struct gsc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_event_work *event_work = c_node->event_work; u32 status; @@ -1549,7 +1549,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..ba45f9a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id); /* store command info in ippdrv */ - ippdrv->cmd = c_node; + ippd
[PATCH v3 0/8] drm/exynos: fix and cleanup ipp subsystem drivers
Hi All. This patch fix some issue and cleanup code. please check my commit and let me know about your comment. Changelog v3: - Subject clean like bellow: * change all subject name from Inki.Dae Changelog v2: - This patch set fixes the following: * consider both case of vflip and hflip: we use vflip, hflip set at the same time for 180 degree supporting. so, we add FLIP_BOTH for fixing warnning. Changelog v1: - This patch set fixes the following: * consider both case of vflip and hflip: we use vflip, hflip set at the same time for 180 degree supporting. so, we add this case. * fix build warning: we don't use directly readl, but this code remained. so, we change it. * fix incorrect interrupt induced by m2m operation : m2m operation call reset function at every time. but we don't disable dma start. so, we add dma stop and capture stop operation. - And code clean like bellow: * change memory variable name : we use 'cmd' in property structure and so on. so, this naming make some confusion. we change 'cmd' to 'c_node' to avoid confusion. * remove needless error handling to property : property could't be NULL. so, we remove error handling about NULL. * correct some comments to abbreviation : we change comments for right grammar. * remove needless parenthesis : we misse changing of fimc side. so, I added it. * remove color bar pattern operation : we don't use color display at writeback. so, remove it. Thank's BR Eunchul Kim Eunchul Kim (6): drm/exynos: change member variable name. drm/exynos: remove needless error handling to property. drm/exynos: consider both case of vflip and hflip. drm/exynos: fix build warning. drm/exynos: correct some comments to abbreviation. drm/exynos: remove needless parenthesis. Jinyoung Jeon (1): drm/exynos: fix incorrect interrupt induced by m2m operation. JoongMock Shin (1): drm/exynos: remove color bar pattern operation. drivers/gpu/drm/exynos/exynos_drm_fimc.c| 47 +-- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 26 --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 13 ++- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |3 +- include/uapi/drm/exynos_drm.h |2 + 6 files changed, 40 insertions(+), 55 deletions(-)
[RFC] drm/exynos: added hdcp driver for contents protection.
Dear Sean Paul. Thank's for your comment. I am in charge of Display Part in Samsung TN. and I also use exynos drm and I contributed some part to dri-devel(e.g IPPs). Your comment is very helpful to me. I answer to your comment. please check my answer. Thank's BR Eunchul Kim On 12/22/2012 04:29 AM, Sean Paul wrote: > On Fri, Dec 21, 2012 at 4:47 AM, Eunchul Kim > wrote: >> HDCP stands for High-bandwidth Digital Content Protection. >> This is a newer form of Digital Rights Management(secure DRM) >> that was designed to control digital video and audio content. >> Contains an integrated HDCP encryption engine for video/audio content >> protection. >> supports version HDCP v1.1. >> Exynos AP supports embedded HDCP key system. >> The HDCP key value is fused during fabrication, based on customer's request. >> >> Exynos HDCP scenario. >> - start encryption. >> - receive Bcaps, Bksv from peer device. >> - check repeater caps from Bcaps. >> - send An, Aksv to peer device. >> - receive Rj from peer device. >> - compare Ri,Rj. If same and not repeater, then start encryption. >> - If not same, retry. If repeater, then start second authentication. >> - stop encryption. >> >> Signed-off-by: Eunchul Kim >> --- > > Hey Eunchul, > Through some unfortunate duplication of work, I've also been working > on HDCP for exynos drm. - Look's good news. because we can upgrade exynos drm together. > > I uploaded my patch a couple of days ago > https://gerrit.chromium.org/gerrit/#/c/39960. - I didn't subscribe chromium.org. so, I didn't see your patch. I will check your patch for understanding your design about HDCP. How can i subscribe your gerrit for the future? because we have very many changes in HDMI, FIMD side in our local git. I want to synchronize from yours to avoid duplication work. I am in charge of all Display Part H/W IP in exynos DRM. please refer it. > > A few high level comments on your patch: > > - Why implement a new driver? You're using the irq and registers from - Yes your are right in some part. I think you didn't see the connection with HDMI driver and HDCP driver. so, you got the question. IMO, HDMI driver is very big currently, so, If we add HDCP code directly in HDMI driver. I can't handle HDCP driver on/off using configuration(defconfig). so, I designed different file and make some ops(callback). I will check one more time between in-side and out-side with our team. > the hdmi IP block, seems to make more sense to do it right in the hdmi > driver. There's a fair bit of code gymnastics that you're doing to > make hdcp visible to hdmi that just wouldn't be necessary if it was > all included. - I understood what your mean. I will consider about your comment. > - I'm not sure what your interface to userspace is. I think it makes > most sense to implement this as a connector property. Here's a patch I > uploaded a couple weeks ago > https://gerrit.chromium.org/gerrit/#/c/38845/ - connector property is good idea. I also think that.(currently we always enable this) I will check your patch. thank's. It's good information. > > A couple more comments inline. > >> drivers/gpu/drm/exynos/Kconfig |6 + >> drivers/gpu/drm/exynos/Makefile |1 + >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 + >> drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >> drivers/gpu/drm/exynos/exynos_hdcp.c| 1164 >> +++ >> drivers/gpu/drm/exynos/exynos_hdcp.h| 47 ++ >> drivers/gpu/drm/exynos/exynos_hdmi.c| 11 + >> drivers/gpu/drm/exynos/exynos_hdmi.h|7 + >> drivers/gpu/drm/exynos/regs-hdmi.h | 177 + >> 9 files changed, 1426 insertions(+), 0 deletions(-) >> create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.c >> create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.h >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig >> index 1d1f1e5..93c2f00 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -34,6 +34,12 @@ config DRM_EXYNOS_HDMI >> help >>Choose this option if you want to use Exynos HDMI for DRM. >> >> +config DRM_EXYNOS_HDCP >> + bool "Exynos DRM HDCP" >> + depends on DRM_EXYNOS_HDMI >> + help >> + Choose this option if you want to use Exynos HDCP in HDMI for DRM. >> + >> config DRM_EXYNOS_VIDI >> bool "Exynos DRM Virtual Display" >> depends on DRM_EXYNOS >> diff --git a/drivers/g
[RFC] drm/exynos: added hdcp driver for contents protection.
Thank's for your advice. Your opinion is very helpful to me. I will consider your comments, and then I resend it. Thank's BR Eunchul Kim On 12/21/2012 08:53 PM, Alan Cox wrote: > On Fri, 21 Dec 2012 18:47:57 +0900 > Eunchul Kim wrote: > >> HDCP stands for High-bandwidth Digital Content Protection. >> This is a newer form of Digital Rights Management(secure DRM) > > was.. the master key was leaked long ago 8) - Okay, I will change description. :) > >> that was designed to control digital video and audio content. >> Contains an integrated HDCP encryption engine for video/audio content >> protection. >> supports version HDCP v1.1. >> Exynos AP supports embedded HDCP key system. >> The HDCP key value is fused during fabrication, based on customer's request. > > For this code to go into the kernel it must do so in GPL form. Can you > confirm Samsung has the necessary IPR and permissions to grant use of > this to all third parties as the GPL requires not just to specific > customers ? (whether they can use it usefully is a different question as > obviously they need the key. > > I ask this because there are currently a lot of lawyers busy trying to > sue makers of some HDCP aware devices. - I will check about your comments. thank's > >> + >> +dev_info(dev, "drm hdcp registered successfully.\n"); > > This sort of stuff ought to be dev_dbg, minor item - changed it. > > >> diff --git a/drivers/gpu/drm/exynos/exynos_hdcp.h >> b/drivers/gpu/drm/exynos/exynos_hdcp.h >> new file mode 100644 >> index 000..86d0c79 >> --- /dev/null >> +++ b/drivers/gpu/drm/exynos/exynos_hdcp.h >> @@ -0,0 +1,47 @@ >> +/* >> + * Copyright (c) 2012 Samsung Electronics Co., Ltd. >> + * >> + * Authors: >> + * Eunchul Kim >> + * >> + * Permission is hereby granted, free of charge, to any person obtaining a >> + * copy of this software and associated documentation files (the >> "Software"), >> + * to deal in the Software without restriction, including without limitation >> + * the rights to use, copy, modify, merge, publish, distribute, sublicense, >> + * and/or sell copies of the Software, and to permit persons to whom the >> + * Software is furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice (including the next >> + * paragraph) shall be included in all copies or substantial portions of the >> + * Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS >> OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL >> + * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, >> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR >> + * OTHER DEALINGS IN THE SOFTWARE. >> + */ > > > Two things strike me here - firstly kernel code is GPLv2 or later (or > dual licensed) as per the Signed-off-by: certification. I don't see any > problem in the above but to be sure you realise. > > Secondly - VA Linux systems ??? has this been copied from some random > file and not updated correctly or does the old VA Linux Systems really > own bits of this code. > - changed it. > Other questions I'll look at later - in particular > - I don't see how the work queue is locked against the main thread of >execution within the driver - I want to avoid that main thread is locked by I2C operation with peer device. The performance deteriorated when i used callback. so, I used workqueue. I designed two kind of mechanism about this. first one is based on workqueue. second one is based on callback. I will consider one more time between synchronization and performance. > - There is a general DRI question here about HDCP and interfaces - >several out of tree drivers do HDCP and perhaps a common API would be >sensible ? - I agree with your opinion. So, I discussed with our X video driver engineer for common API internally. I think, If we provide connector property for HDCP, then DRI can control HDCP generally. I didn't fully implemented yet. > > Alan >
[PATCH v3 2/8] drm/exynos: remove needless error handling to property.
This patch removes property error handling. because property couldn't be NULL. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 drivers/gpu/drm/exynos/exynos_drm_ipp.c |5 - 3 files changed, 0 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 7a3e460..5dc0251 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -705,10 +705,6 @@ static int fimc_src_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1241,10 +1237,6 @@ static int fimc_dst_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1573,10 +1565,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } fimc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c443c3b..ba5fefd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EFAULT; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EFAULT; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } gsc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index ba45f9a..cac94fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) mutex_lock(c_node-cmd_lock); property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property:prop_id[%d]\n, - c_node-property.prop_id); - goto err_unlock; - } switch (cmd_work-ctrl) { case IPP_CTRL_PLAY: -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 0/8] drm/exynos: fix and cleanup ipp subsystem drivers
Hi All. This patch fix some issue and cleanup code. please check my commit and let me know about your comment. Changelog v3: - Subject clean like bellow: * change all subject name from Inki.Dae Changelog v2: - This patch set fixes the following: * consider both case of vflip and hflip: we use vflip, hflip set at the same time for 180 degree supporting. so, we add FLIP_BOTH for fixing warnning. Changelog v1: - This patch set fixes the following: * consider both case of vflip and hflip: we use vflip, hflip set at the same time for 180 degree supporting. so, we add this case. * fix build warning: we don't use directly readl, but this code remained. so, we change it. * fix incorrect interrupt induced by m2m operation : m2m operation call reset function at every time. but we don't disable dma start. so, we add dma stop and capture stop operation. - And code clean like bellow: * change memory variable name : we use 'cmd' in property structure and so on. so, this naming make some confusion. we change 'cmd' to 'c_node' to avoid confusion. * remove needless error handling to property : property could't be NULL. so, we remove error handling about NULL. * correct some comments to abbreviation : we change comments for right grammar. * remove needless parenthesis : we misse changing of fimc side. so, I added it. * remove color bar pattern operation : we don't use color display at writeback. so, remove it. Thank's BR Eunchul Kim Eunchul Kim (6): drm/exynos: change member variable name. drm/exynos: remove needless error handling to property. drm/exynos: consider both case of vflip and hflip. drm/exynos: fix build warning. drm/exynos: correct some comments to abbreviation. drm/exynos: remove needless parenthesis. Jinyoung Jeon (1): drm/exynos: fix incorrect interrupt induced by m2m operation. JoongMock Shin (1): drm/exynos: remove color bar pattern operation. drivers/gpu/drm/exynos/exynos_drm_fimc.c| 47 +-- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 26 --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 13 ++- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |3 +- include/uapi/drm/exynos_drm.h |2 + 6 files changed, 40 insertions(+), 55 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 1/8] drm/exynos: change member variable name.
This patch change current command name from cmd to c_node. because we are using the member name, 'cmd', for command control ioctl in another structure. so, this patch changes it to c_node to avoid such confusing. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|8 drivers/gpu/drm/exynos/exynos_drm_gsc.c |8 drivers/gpu/drm/exynos/exynos_drm_ipp.c |6 +++--- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c |2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 61ea242..7a3e460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -695,7 +695,7 @@ static int fimc_src_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1231,7 +1231,7 @@ static int fimc_dst_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1317,7 +1317,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) { struct fimc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_event_work *event_work = c_node-event_work; int buf_id; @@ -1557,7 +1557,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..c443c3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1171,7 +1171,7 @@ static int gsc_dst_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1312,7 +1312,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) { struct gsc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_event_work *event_work = c_node-event_work; u32 status; @@ -1549,7 +1549,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..ba45f9a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, DRM_DEBUG_KMS(%s:prop_id[%d]\n, __func__, property-prop_id); /* store command info in ippdrv */ - ippdrv-cmd = c_node; + ippdrv-c_node = c_node; if (!ipp_check_mem_list(c_node
[PATCH v3 3/8] drm/exynos: consider both case of vflip and hflip.
This patch considers both case of vflip and hflip. If we want that the contents in buffer to be rotated to 180 degree, then we can use h,vflip or 180 degree. Changelog v2: - added EXYNOS_DRM_FLIP_BOTH enum value to avoid build warnning. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + include/uapi/drm/exynos_drm.h |2 ++ 4 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..abfff9e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ba5fefd..3e5b456 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1391,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: - case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..8bf9c50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h index e7f52c3..7ed11b2 100644 --- a/include/uapi/drm/exynos_drm.h +++ b/include/uapi/drm/exynos_drm.h @@ -185,6 +185,8 @@ enum drm_exynos_flip { EXYNOS_DRM_FLIP_NONE = (0 0), EXYNOS_DRM_FLIP_VERTICAL = (1 0), EXYNOS_DRM_FLIP_HORIZONTAL = (1 1), + EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | + EXYNOS_DRM_FLIP_HORIZONTAL, }; enum drm_exynos_degree { -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 4/8] drm/exynos: fix build warning.
This patch fixes erroneous register read. reall function needs register base address + offset but exynos_drm_gsc module used only offset to read a register. so this patch uses gsc_read function instead of readl. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 3e5b456..410175a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1592,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)set_wb); /* src local path */ - cfg = readl(GSC_IN_CON); + cfg = gsc_read(GSC_IN_CON); cfg = ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); gsc_write(cfg, GSC_IN_CON); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 5/8] drm/exynos: correct some comments to abbreviation.
This patch cleanup corrects some comments to abbreviation. We would like to prevent it stands misunderstood. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index abfff9e..8cfc5a9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,7 @@ #include exynos_drm_fimc.h /* - * FIMC is stand for Fully Interactive Mobile Camera and + * FIMC stands for Fully Interactive Mobile Camera and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 410175a..509f2f8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -25,7 +25,7 @@ #include exynos_drm_gsc.h /* - * GSC is stand for General SCaler and + * GSC stands for General SCaler and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index cac94fe..63bcf92 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -27,7 +27,7 @@ #include exynos_drm_iommu.h /* - * IPP is stand for Image Post Processing and + * IPP stands for Image Post Processing and * supports image scaler/rotator and input/output DMA operations. * using FIMC, GSC, Rotator, so on. * IPP is integration device driver of same attribute h/w -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 6/8] drm/exynos: remove color bar pattern operation.
From: JoongMock Shin jmock.s...@samsung.com This patch removes color bar pattern register because we don't use the register anymore. because it doesn't support color bar feature for writeback operation. camera driver only supports color bar feature. but IPP doesn't support camera driver. Signed-off-by: JoongMock Shin jmock.s...@samsung.com Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8cfc5a9..a99ceef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -163,17 +163,14 @@ struct fimc_context { boolsuspended; }; -static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) +static void fimc_sw_reset(struct fimc_context *ctx) { u32 cfg; - DRM_DEBUG_KMS(%s:pattern[%d]\n, __func__, pattern); + DRM_DEBUG_KMS(%s\n, __func__); cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; - if (pattern) - cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR; - fimc_write(cfg, EXYNOS_CISRCFMT); /* s/w reset */ @@ -1536,7 +1533,7 @@ static int fimc_ippdrv_reset(struct device *dev) DRM_DEBUG_KMS(%s\n, __func__); /* reset h/w block */ - fimc_sw_reset(ctx, false); + fimc_sw_reset(ctx); /* reset scaler capability */ memset(ctx-sc, 0x0, sizeof(ctx-sc)); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 7/8] drm/exynos: fix incorrect interrupt induced by m2m operation.
From: Jinyoung Jeon jy0.j...@samsung.com This patch fixes incorrect interrupt induced by m2m operation. the m2m operation calls s/w reset every frame but there is the case that the interrupt to m2m operation occures after s/w reset sometimes. So this patch makes dma and capture operations stop at s/w reset to avoid incorrect interrupt. Signed-off-by: Jinyoung Jeon jy0.j...@samsung.com Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index a99ceef..9f52b7f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -169,10 +169,23 @@ static void fimc_sw_reset(struct fimc_context *ctx) DRM_DEBUG_KMS(%s\n, __func__); + /* stop dma operation */ + cfg = fimc_read(EXYNOS_CISTATUS); + if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { + cfg = fimc_read(EXYNOS_MSCTRL); + cfg = ~EXYNOS_MSCTRL_ENVID; + fimc_write(cfg, EXYNOS_MSCTRL); + } + cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; fimc_write(cfg, EXYNOS_CISRCFMT); + /* disable image capture */ + cfg = fimc_read(EXYNOS_CIIMGCPT); + cfg = ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN); + fimc_write(cfg, EXYNOS_CIIMGCPT); + /* s/w reset */ cfg = fimc_read(EXYNOS_CIGCTRL); cfg |= (EXYNOS_CIGCTRL_SWRST); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v3 8/8] drm/exynos: remove needless parenthesis.
This patch removes needless parenthesis. This was pointed out but in case of fimc side. we missed it. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 9f52b7f..2c03ffa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1212,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, } /* sequence id */ - cfg = (~mask); + cfg = ~mask; cfg |= (enable buf_id); fimc_write(cfg, EXYNOS_CIFCNTSEQ); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[RFC] drm/exynos: added hdcp driver for contents protection.
HDCP stands for High-bandwidth Digital Content Protection. This is a newer form of Digital Rights Management(secure DRM) that was designed to control digital video and audio content. Contains an integrated HDCP encryption engine for video/audio content protection. supports version HDCP v1.1. Exynos AP supports embedded HDCP key system. The HDCP key value is fused during fabrication, based on customer's request. Exynos HDCP scenario. - start encryption. - receive Bcaps, Bksv from peer device. - check repeater caps from Bcaps. - send An, Aksv to peer device. - receive Rj from peer device. - compare Ri,Rj. If same and not repeater, then start encryption. - If not same, retry. If repeater, then start second authentication. - stop encryption. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_hdcp.c| 1164 +++ drivers/gpu/drm/exynos/exynos_hdcp.h| 47 ++ drivers/gpu/drm/exynos/exynos_hdmi.c| 11 + drivers/gpu/drm/exynos/exynos_hdmi.h|7 + drivers/gpu/drm/exynos/regs-hdmi.h | 177 + 9 files changed, 1426 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.c create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 1d1f1e5..93c2f00 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -34,6 +34,12 @@ config DRM_EXYNOS_HDMI help Choose this option if you want to use Exynos HDMI for DRM. +config DRM_EXYNOS_HDCP + bool "Exynos DRM HDCP" + depends on DRM_EXYNOS_HDMI + help + Choose this option if you want to use Exynos HDCP in HDMI for DRM. + config DRM_EXYNOS_VIDI bool "Exynos DRM Virtual Display" depends on DRM_EXYNOS diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 639b49e..58d8fb7 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -14,6 +14,7 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \ exynos_ddc.o exynos_hdmiphy.o \ exynos_drm_hdmi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_HDCP) += exynos_hdcp.o exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index e0a8e80..0d2ada1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -345,6 +345,11 @@ static int __init exynos_drm_init(void) #endif #ifdef CONFIG_DRM_EXYNOS_HDMI +#ifdef CONFIG_DRM_EXYNOS_HDCP + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_hdcp; +#endif ret = platform_driver_register(_driver); if (ret < 0) goto out_hdmi; @@ -452,6 +457,10 @@ out_common_hdmi: out_mixer: platform_driver_unregister(_driver); out_hdmi: +#ifdef CONFIG_DRM_EXYNOS_HDCP + platform_driver_unregister(_driver); +out_hdcp: +#endif #endif #ifdef CONFIG_DRM_EXYNOS_FIMD @@ -494,6 +503,9 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_drm_common_hdmi_driver); platform_driver_unregister(_driver); platform_driver_unregister(_driver); +#ifdef CONFIG_DRM_EXYNOS_HDCP + platform_driver_unregister(_driver); +#endif #endif #ifdef CONFIG_DRM_EXYNOS_VIDI diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index f5a9774..c591ffc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -344,6 +344,7 @@ extern int exynos_platform_device_hdmi_register(void); void exynos_platform_device_hdmi_unregister(void); extern struct platform_driver fimd_driver; +extern struct platform_driver hdcp_driver; extern struct platform_driver hdmi_driver; extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdmi_driver; diff --git a/drivers/gpu/drm/exynos/exynos_hdcp.c b/drivers/gpu/drm/exynos/exynos_hdcp.c new file mode 100644 index 000..58a345c --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_hdcp.c @@ -0,0 +1,1164 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, o
[RFC] added hdcp driver in hdmi
Hi All. This patch supports HDCP feature in Exynos DRM HDMI. We enhaced feature of HDCP for content protection. please check my commit and If you have any opinion of this patch. please give comment to me. HDCP stands for High-bandwidth Digital Content Protection. contains an integrated HDCP encryption engine for video/audio content protection. supports version HDCP v1.1. Exynos supports embedded HDCP key system. The HDCP key value is fused during fabrication, based on customer's request. First part authentication protocol. The HDCP transmitter(Device A) can initiate authentication at any time. Authentication is initiated by the HDCP transmitter by sending an An, Aksv. An(64-bit psedo-random value), Aksv(Transmitter Key Selection Vector). The HDCP Receiver(Device B) generates Rj. The HDCP Receiver responds by sending a response message Bksv. Bksv(Receiver Key Selection Vector). If authentication was successfull, then Ri will be equal to Rj. Second part authentication protocol. The second part of the authentication protocol is required if the HDCP receiver is an HDCP repeater. The HDCP transmitter executes the second part of the protocol only when the REPEATER bit is set, indicating that the attached HDCP receiver is an HDCP repeater. This part of the protocol assembles a list of all downstream KSVs attached to the HDCP repeater through a permitted connection tree, enabling revocation support upstream. Third part authentication protocol. The third part of the authentication protocol occurs during the vertical blanking interval preceding the frame for which it applies. Each of the two HDCP devices calculates new cipher initialization values, Ki and Mi, and a third value Ri. and asynchronous polling every 2 seconds. Exynos scenario. 1. start encryption. 2. receive Bcaps, Bksv from peer device. 3. check repeater caps from Bcaps. 4. send An, Aksv to peer device. 5. receive Rj from peer device. 6. compare Ri, Rj. If same and not repeater, then start encryption. 7. If not same, retry. If repeater, then start second authentication. 8. stop encryption. Thank's BR Eunchul Kim Eunchul Kim (1): drm/exynos: added hdcp driver for contents protection. drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_hdcp.c| 1164 +++ drivers/gpu/drm/exynos/exynos_hdcp.h| 47 ++ drivers/gpu/drm/exynos/exynos_hdmi.c| 11 + drivers/gpu/drm/exynos/exynos_hdmi.h|7 + drivers/gpu/drm/exynos/regs-hdmi.h | 177 + 9 files changed, 1426 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.c create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.h
[PATCH v2 8/8] drm/exynos: cleanup needless parenthesis.
This patch cleanup needless parenthesis. we got the comment from GSC. but we missed fimc side. so, we cleanup the code. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 9f52b7f..2c03ffa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1212,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, } /* sequence id */ - cfg &= (~mask); + cfg &= ~mask; cfg |= (enable << buf_id); fimc_write(cfg, EXYNOS_CIFCNTSEQ); -- 1.7.0.4
[PATCH v2 7/8] drm/exynos: fixed unnormal interrupt in m2m operation.
From: Jinyoung Jeon <jy0.j...@samsung.com> This patch fixed unnormal interrupt at m2m operation sometimes. m2m operation called s/w reset during every frame. but m2m occured interrupt after s/w reset sometimes. so, we cleared dma operation and capture operation. Signed-off-by: Jinyoung Jeon Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index a99ceef..9f52b7f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -169,10 +169,23 @@ static void fimc_sw_reset(struct fimc_context *ctx) DRM_DEBUG_KMS("%s\n", __func__); + /* stop dma operation */ + cfg = fimc_read(EXYNOS_CISTATUS); + if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { + cfg = fimc_read(EXYNOS_MSCTRL); + cfg &= ~EXYNOS_MSCTRL_ENVID; + fimc_write(cfg, EXYNOS_MSCTRL); + } + cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; fimc_write(cfg, EXYNOS_CISRCFMT); + /* disable image capture */ + cfg = fimc_read(EXYNOS_CIIMGCPT); + cfg &= ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN); + fimc_write(cfg, EXYNOS_CIIMGCPT); + /* s/w reset */ cfg = fimc_read(EXYNOS_CIGCTRL); cfg |= (EXYNOS_CIGCTRL_SWRST); -- 1.7.0.4
[PATCH v2 6/8] drm/exynos: removed color bar pattern display.
From: JoongMock Shin <jmock.s...@samsung.com> This patch removed color bar pattern register. we not use color bar any more. and don't support color bar at writeback operation. Signed-off-by: JoongMock Shin Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8cfc5a9..a99ceef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -163,17 +163,14 @@ struct fimc_context { boolsuspended; }; -static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) +static void fimc_sw_reset(struct fimc_context *ctx) { u32 cfg; - DRM_DEBUG_KMS("%s:pattern[%d]\n", __func__, pattern); + DRM_DEBUG_KMS("%s\n", __func__); cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; - if (pattern) - cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR; - fimc_write(cfg, EXYNOS_CISRCFMT); /* s/w reset */ @@ -1536,7 +1533,7 @@ static int fimc_ippdrv_reset(struct device *dev) DRM_DEBUG_KMS("%s\n", __func__); /* reset h/w block */ - fimc_sw_reset(ctx, false); + fimc_sw_reset(ctx); /* reset scaler capability */ memset(>sc, 0x0, sizeof(ctx->sc)); -- 1.7.0.4
[PATCH v2 5/8] drm/exynos: cleanup comment of abbreviation.
This patch cleanup comment of abbreviation. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index abfff9e..8cfc5a9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,7 @@ #include "exynos_drm_fimc.h" /* - * FIMC is stand for Fully Interactive Mobile Camera and + * FIMC stands for Fully Interactive Mobile Camera and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 410175a..509f2f8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -25,7 +25,7 @@ #include "exynos_drm_gsc.h" /* - * GSC is stand for General SCaler and + * GSC stands for General SCaler and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index cac94fe..63bcf92 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -27,7 +27,7 @@ #include "exynos_drm_iommu.h" /* - * IPP is stand for Image Post Processing and + * IPP stands for Image Post Processing and * supports image scaler/rotator and input/output DMA operations. * using FIMC, GSC, Rotator, so on. * IPP is integration device driver of same attribute h/w -- 1.7.0.4
[PATCH v2 4/8] drm/exynos: fixed warnning in GSC build.
This patch fixed warnning in GSC build. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 3e5b456..410175a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1592,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)_wb); /* src local path */ - cfg = readl(GSC_IN_CON); + cfg = gsc_read(GSC_IN_CON); cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); gsc_write(cfg, GSC_IN_CON); -- 1.7.0.4
[PATCH v2 3/8] drm/exynos: fixed vflip, hflip case at the same time.
Changelog v2: This patch added EXYNOS_DRM_FLIP_BOTH enum value for warnning. Changelog v1: This patch fixed vflip, hflip at the same time. If we want to change 180 degree about buffer, then we can use h,vflip or 180 degree. we supports 180 degree using h,vflip. but we make error handling in this case. so, fixed it. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + include/uapi/drm/exynos_drm.h |2 ++ 4 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..abfff9e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ba5fefd..3e5b456 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1391,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: - case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..8bf9c50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h index e7f52c3..7ed11b2 100644 --- a/include/uapi/drm/exynos_drm.h +++ b/include/uapi/drm/exynos_drm.h @@ -185,6 +185,8 @@ enum drm_exynos_flip { EXYNOS_DRM_FLIP_NONE = (0 << 0), EXYNOS_DRM_FLIP_VERTICAL = (1 << 0), EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1), + EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | + EXYNOS_DRM_FLIP_HORIZONTAL, }; enum drm_exynos_degree { -- 1.7.0.4
[PATCH v2 2/8] drm/exynos: removed needless error handling about property.
This patch removed property error handling. property couldn't be NULL. so, I removed it. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 drivers/gpu/drm/exynos/exynos_drm_ipp.c |5 - 3 files changed, 0 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 7a3e460..5dc0251 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -705,10 +705,6 @@ static int fimc_src_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1241,10 +1237,6 @@ static int fimc_dst_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1573,10 +1565,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } fimc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c443c3b..ba5fefd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EFAULT; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EFAULT; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } gsc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index ba45f9a..cac94fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) mutex_lock(_node->cmd_lock); property = _node->property; - if (!property) { - DRM_ERROR("failed to get property:prop_id[%d]\n", - c_node->property.prop_id); - goto err_unlock; - } switch (cmd_work->ctrl) { case IPP_CTRL_PLAY: -- 1.7.0.4
[PATCH v2 1/8] drm/exynos: cleanup current command name.
This patch changed current command name from cmd to c_node. because we already use cmd for command control ioctl in another structure. so, this name make some confusion. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|8 drivers/gpu/drm/exynos/exynos_drm_gsc.c |8 drivers/gpu/drm/exynos/exynos_drm_ipp.c |6 +++--- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c |2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 61ea242..7a3e460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -695,7 +695,7 @@ static int fimc_src_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1231,7 +1231,7 @@ static int fimc_dst_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1317,7 +1317,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) { struct fimc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_event_work *event_work = c_node->event_work; int buf_id; @@ -1557,7 +1557,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..c443c3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1171,7 +1171,7 @@ static int gsc_dst_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1312,7 +1312,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) { struct gsc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_event_work *event_work = c_node->event_work; u32 status; @@ -1549,7 +1549,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..ba45f9a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id); /* store command info in ippdrv */ - ippdrv->cmd = c_node; + ippdrv->c_node = c_node; if (!ipp_ch
[PATCH v2 0/8] drm/exynos: fixed and cleanup ipp subsystem drivers
Hi All. This patch set fixed some issue and cleanup code. please check my commit and let me know about your comment. Changelog v2: - This patch set fixes the following: * fixed vflip, hflip case at the same time: we use vflip, hflip set at the same time for 180 degree supporting. so, we added FLIP_BOTH for fixing warnning. Changelog v1: - This patch set fixes the following: * fixed vflip, hflip case at the same time: we use vflip, hflip set at the same time for 180 degree supporting. so, we added this case. * fixed warnning in GSC build: we don't use directly readl, but this code remained. so, we changed it. * fixed unnormal interrupt in m2m operation : m2m operation called reset function at every time. but we don't disable dma start. so, we added dma stop and capture stop operation. - And code clean like bellow: * cleanup current command name : we use 'cmd' in property structure and so on. so, this naming make some confusion. we changed 'cmd' to 'c_node' for avoid confusion. * removed error handling about property : property could't be NULL. so, we removed error handling about NULL. * cleanup comment of abbreviation : we changed comments for right grammar. * cleanup needless parenthesis : we missed changing of fimc side. so, I added it. * removed color bar pattern display : we don't use color display at writeback. so, removed it. Thank's BR Eunchul Kim Eunchul Kim (6): drm/exynos: cleanup current command name. drm/exynos: removed needless error handling about property. drm/exynos: fixed vflip, hflip case at the same time. drm/exynos: fixed warnning in GSC build. drm/exynos: cleanup comment of abbreviation. drm/exynos: cleanup needless parenthesis. Jinyoung Jeon (1): drm/exynos: fixed unnormal interrupt in m2m operation. JoongMock Shin (1): drm/exynos: removed color bar pattern display. drivers/gpu/drm/exynos/exynos_drm_fimc.c| 47 +-- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 26 --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 13 ++- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |3 +- include/uapi/drm/exynos_drm.h |2 + 6 files changed, 40 insertions(+), 55 deletions(-)
[RFC] added hdcp driver in hdmi
Hi All. This patch supports HDCP feature in Exynos DRM HDMI. We enhaced feature of HDCP for content protection. please check my commit and If you have any opinion of this patch. please give comment to me. HDCP stands for High-bandwidth Digital Content Protection. contains an integrated HDCP encryption engine for video/audio content protection. supports version HDCP v1.1. Exynos supports embedded HDCP key system. The HDCP key value is fused during fabrication, based on customer's request. First part authentication protocol. The HDCP transmitter(Device A) can initiate authentication at any time. Authentication is initiated by the HDCP transmitter by sending an An, Aksv. An(64-bit psedo-random value), Aksv(Transmitter Key Selection Vector). The HDCP Receiver(Device B) generates Rj. The HDCP Receiver responds by sending a response message Bksv. Bksv(Receiver Key Selection Vector). If authentication was successfull, then Ri will be equal to Rj. Second part authentication protocol. The second part of the authentication protocol is required if the HDCP receiver is an HDCP repeater. The HDCP transmitter executes the second part of the protocol only when the REPEATER bit is set, indicating that the attached HDCP receiver is an HDCP repeater. This part of the protocol assembles a list of all downstream KSVs attached to the HDCP repeater through a permitted connection tree, enabling revocation support upstream. Third part authentication protocol. The third part of the authentication protocol occurs during the vertical blanking interval preceding the frame for which it applies. Each of the two HDCP devices calculates new cipher initialization values, Ki and Mi, and a third value Ri. and asynchronous polling every 2 seconds. Exynos scenario. 1. start encryption. 2. receive Bcaps, Bksv from peer device. 3. check repeater caps from Bcaps. 4. send An, Aksv to peer device. 5. receive Rj from peer device. 6. compare Ri, Rj. If same and not repeater, then start encryption. 7. If not same, retry. If repeater, then start second authentication. 8. stop encryption. Thank's BR Eunchul Kim Eunchul Kim (1): drm/exynos: added hdcp driver for contents protection. drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_hdcp.c| 1164 +++ drivers/gpu/drm/exynos/exynos_hdcp.h| 47 ++ drivers/gpu/drm/exynos/exynos_hdmi.c| 11 + drivers/gpu/drm/exynos/exynos_hdmi.h|7 + drivers/gpu/drm/exynos/regs-hdmi.h | 177 + 9 files changed, 1426 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.c create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.h ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[RFC] drm/exynos: added hdcp driver for contents protection.
HDCP stands for High-bandwidth Digital Content Protection. This is a newer form of Digital Rights Management(secure DRM) that was designed to control digital video and audio content. Contains an integrated HDCP encryption engine for video/audio content protection. supports version HDCP v1.1. Exynos AP supports embedded HDCP key system. The HDCP key value is fused during fabrication, based on customer's request. Exynos HDCP scenario. - start encryption. - receive Bcaps, Bksv from peer device. - check repeater caps from Bcaps. - send An, Aksv to peer device. - receive Rj from peer device. - compare Ri,Rj. If same and not repeater, then start encryption. - If not same, retry. If repeater, then start second authentication. - stop encryption. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_hdcp.c| 1164 +++ drivers/gpu/drm/exynos/exynos_hdcp.h| 47 ++ drivers/gpu/drm/exynos/exynos_hdmi.c| 11 + drivers/gpu/drm/exynos/exynos_hdmi.h|7 + drivers/gpu/drm/exynos/regs-hdmi.h | 177 + 9 files changed, 1426 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.c create mode 100644 drivers/gpu/drm/exynos/exynos_hdcp.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 1d1f1e5..93c2f00 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -34,6 +34,12 @@ config DRM_EXYNOS_HDMI help Choose this option if you want to use Exynos HDMI for DRM. +config DRM_EXYNOS_HDCP + bool Exynos DRM HDCP + depends on DRM_EXYNOS_HDMI + help + Choose this option if you want to use Exynos HDCP in HDMI for DRM. + config DRM_EXYNOS_VIDI bool Exynos DRM Virtual Display depends on DRM_EXYNOS diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 639b49e..58d8fb7 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -14,6 +14,7 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o \ exynos_ddc.o exynos_hdmiphy.o \ exynos_drm_hdmi.o +exynosdrm-$(CONFIG_DRM_EXYNOS_HDCP) += exynos_hdcp.o exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index e0a8e80..0d2ada1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -345,6 +345,11 @@ static int __init exynos_drm_init(void) #endif #ifdef CONFIG_DRM_EXYNOS_HDMI +#ifdef CONFIG_DRM_EXYNOS_HDCP + ret = platform_driver_register(hdcp_driver); + if (ret 0) + goto out_hdcp; +#endif ret = platform_driver_register(hdmi_driver); if (ret 0) goto out_hdmi; @@ -452,6 +457,10 @@ out_common_hdmi: out_mixer: platform_driver_unregister(hdmi_driver); out_hdmi: +#ifdef CONFIG_DRM_EXYNOS_HDCP + platform_driver_unregister(hdcp_driver); +out_hdcp: +#endif #endif #ifdef CONFIG_DRM_EXYNOS_FIMD @@ -494,6 +503,9 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(exynos_drm_common_hdmi_driver); platform_driver_unregister(mixer_driver); platform_driver_unregister(hdmi_driver); +#ifdef CONFIG_DRM_EXYNOS_HDCP + platform_driver_unregister(hdcp_driver); +#endif #endif #ifdef CONFIG_DRM_EXYNOS_VIDI diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index f5a9774..c591ffc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -344,6 +344,7 @@ extern int exynos_platform_device_hdmi_register(void); void exynos_platform_device_hdmi_unregister(void); extern struct platform_driver fimd_driver; +extern struct platform_driver hdcp_driver; extern struct platform_driver hdmi_driver; extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdmi_driver; diff --git a/drivers/gpu/drm/exynos/exynos_hdcp.c b/drivers/gpu/drm/exynos/exynos_hdcp.c new file mode 100644 index 000..58a345c --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_hdcp.c @@ -0,0 +1,1164 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim chulspro@samsung.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free
Re: [RFC] drm/exynos: added hdcp driver for contents protection.
Thank's for your advice. Your opinion is very helpful to me. I will consider your comments, and then I resend it. Thank's BR Eunchul Kim On 12/21/2012 08:53 PM, Alan Cox wrote: On Fri, 21 Dec 2012 18:47:57 +0900 Eunchul Kim chulspro@samsung.com wrote: HDCP stands for High-bandwidth Digital Content Protection. This is a newer form of Digital Rights Management(secure DRM) was.. the master key was leaked long ago 8) - Okay, I will change description. :) that was designed to control digital video and audio content. Contains an integrated HDCP encryption engine for video/audio content protection. supports version HDCP v1.1. Exynos AP supports embedded HDCP key system. The HDCP key value is fused during fabrication, based on customer's request. For this code to go into the kernel it must do so in GPL form. Can you confirm Samsung has the necessary IPR and permissions to grant use of this to all third parties as the GPL requires not just to specific customers ? (whether they can use it usefully is a different question as obviously they need the key. I ask this because there are currently a lot of lawyers busy trying to sue makers of some HDCP aware devices. - I will check about your comments. thank's + + dev_info(dev, drm hdcp registered successfully.\n); This sort of stuff ought to be dev_dbg, minor item - changed it. diff --git a/drivers/gpu/drm/exynos/exynos_hdcp.h b/drivers/gpu/drm/exynos/exynos_hdcp.h new file mode 100644 index 000..86d0c79 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_hdcp.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * + * Authors: + * Eunchul Kim chulspro@samsung.com + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the Software), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ Two things strike me here - firstly kernel code is GPLv2 or later (or dual licensed) as per the Signed-off-by: certification. I don't see any problem in the above but to be sure you realise. Secondly - VA Linux systems ??? has this been copied from some random file and not updated correctly or does the old VA Linux Systems really own bits of this code. - changed it. Other questions I'll look at later - in particular - I don't see how the work queue is locked against the main thread of execution within the driver - I want to avoid that main thread is locked by I2C operation with peer device. The performance deteriorated when i used callback. so, I used workqueue. I designed two kind of mechanism about this. first one is based on workqueue. second one is based on callback. I will consider one more time between synchronization and performance. - There is a general DRI question here about HDCP and interfaces - several out of tree drivers do HDCP and perhaps a common API would be sensible ? - I agree with your opinion. So, I discussed with our X video driver engineer for common API internally. I think, If we provide connector property for HDCP, then DRI can control HDCP generally. I didn't fully implemented yet. Alan ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/8] drm/exynos: fixed vflip, hflip case at the same time.
Thank's for comment. Oops, sorry that is my fault. I will resend it. BR Eunchul Kim On 12/20/2012 06:48 PM, Inki Dae wrote: > > >> -Original Message----- >> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >> Sent: Thursday, December 20, 2012 6:32 PM >> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; jmock.shin at >> samsung.com; >> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >> jy0922.shim at samsung.com; sw0312.kim at samsung.com; th908.kim at >> samsung.com; >> lsmin.lee at samsung.com; chulspro.kim at samsung.com >> Subject: [PATCH 3/8] drm/exynos: fixed vflip, hflip case at the same time. >> >> This patch fixed vflip, hflip at the same time. If we want to change 180 >> degree about buffer, >> then we can use h,vflip or 180 degree. we supports 180 degree using >> h,vflip. >> but we make error handling in this case. so, fixed it. >> >> Signed-off-by: Eunchul Kim >> --- >> drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + >> drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + >> 2 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c >> b/drivers/gpu/drm/exynos/exynos_drm_fimc.c >> index 5dc0251..4c4078c 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c >> @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum >> drm_exynos_flip flip) >> case EXYNOS_DRM_FLIP_NONE: >> case EXYNOS_DRM_FLIP_VERTICAL: >> case EXYNOS_DRM_FLIP_HORIZONTAL: >> +case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: > > This code induces build warning because the value of 'VERTICAL | HORIZONTAL' > is out of range. Add a new enumeration value to enum drm_exynos_flip. i.e. > EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL > and use it. - thank's I guess why not occured warnning. but It's the better. I will resend it. > >> return true; >> default: >> DRM_DEBUG_KMS("%s:invalid flip\n", __func__); >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c >> b/drivers/gpu/drm/exynos/exynos_drm_rotator.c >> index 17e4474..09830ad 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c >> @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum >> drm_exynos_flip flip) >> case EXYNOS_DRM_FLIP_NONE: >> case EXYNOS_DRM_FLIP_VERTICAL: >> case EXYNOS_DRM_FLIP_HORIZONTAL: >> +case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: > > Ditto. > >> return true; >> default: >> DRM_DEBUG_KMS("%s:invalid flip\n", __func__); >> -- >> 1.7.0.4 > >
[PATCH 8/8] drm/exynos: cleanup needless parenthesis.
This patch cleanup needless parenthesis. we got the comment from GSC. but we missed fimc side. so, we cleanup the code. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index c9eaa81..7238f4e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1212,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, } /* sequence id */ - cfg &= (~mask); + cfg &= ~mask; cfg |= (enable << buf_id); fimc_write(cfg, EXYNOS_CIFCNTSEQ); -- 1.7.0.4
[PATCH 7/8] drm/exynos: fixed unnormal interrupt in m2m operation.
From: Jinyoung Jeon <jy0.j...@samsung.com> This patch fixed unnormal interrupt at m2m operation sometimes. m2m operation called s/w reset during every frame. but m2m occured interrupt after s/w reset sometimes. so, we cleared dma operation and capture operation. Signed-off-by: Jinyoung Jeon Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 67e1b88..c9eaa81 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -169,10 +169,23 @@ static void fimc_sw_reset(struct fimc_context *ctx) DRM_DEBUG_KMS("%s\n", __func__); + /* stop dma operation */ + cfg = fimc_read(EXYNOS_CISTATUS); + if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { + cfg = fimc_read(EXYNOS_MSCTRL); + cfg &= ~EXYNOS_MSCTRL_ENVID; + fimc_write(cfg, EXYNOS_MSCTRL); + } + cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; fimc_write(cfg, EXYNOS_CISRCFMT); + /* disable image capture */ + cfg = fimc_read(EXYNOS_CIIMGCPT); + cfg &= ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN); + fimc_write(cfg, EXYNOS_CIIMGCPT); + /* s/w reset */ cfg = fimc_read(EXYNOS_CIGCTRL); cfg |= (EXYNOS_CIGCTRL_SWRST); -- 1.7.0.4
[PATCH 6/8] drm/exynos: removed color bar pattern display.
From: JoongMock Shin <jmock.s...@samsung.com> This patch removed color bar pattern register. we not use color bar any more. and don't support color bar at writeback operation. Signed-off-by: JoongMock Shin Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index cfeb606..67e1b88 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -163,17 +163,14 @@ struct fimc_context { boolsuspended; }; -static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) +static void fimc_sw_reset(struct fimc_context *ctx) { u32 cfg; - DRM_DEBUG_KMS("%s:pattern[%d]\n", __func__, pattern); + DRM_DEBUG_KMS("%s\n", __func__); cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; - if (pattern) - cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR; - fimc_write(cfg, EXYNOS_CISRCFMT); /* s/w reset */ @@ -1536,7 +1533,7 @@ static int fimc_ippdrv_reset(struct device *dev) DRM_DEBUG_KMS("%s\n", __func__); /* reset h/w block */ - fimc_sw_reset(ctx, false); + fimc_sw_reset(ctx); /* reset scaler capability */ memset(>sc, 0x0, sizeof(ctx->sc)); -- 1.7.0.4
[PATCH 5/8] drm/exynos: cleanup comment of abbreviation.
This patch cleanup comment of abbreviation. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 4c4078c..cfeb606 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,7 @@ #include "exynos_drm_fimc.h" /* - * FIMC is stand for Fully Interactive Mobile Camera and + * FIMC stands for Fully Interactive Mobile Camera and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 4546833..89fdb49 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -25,7 +25,7 @@ #include "exynos_drm_gsc.h" /* - * GSC is stand for General SCaler and + * GSC stands for General SCaler and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index cac94fe..63bcf92 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -27,7 +27,7 @@ #include "exynos_drm_iommu.h" /* - * IPP is stand for Image Post Processing and + * IPP stands for Image Post Processing and * supports image scaler/rotator and input/output DMA operations. * using FIMC, GSC, Rotator, so on. * IPP is integration device driver of same attribute h/w -- 1.7.0.4
[PATCH 4/8] drm/exynos: fixed warnning in GSC build.
This patch fixed warnning in GSC build. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ba5fefd..4546833 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1592,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)_wb); /* src local path */ - cfg = readl(GSC_IN_CON); + cfg = gsc_read(GSC_IN_CON); cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); gsc_write(cfg, GSC_IN_CON); -- 1.7.0.4
[PATCH 3/8] drm/exynos: fixed vflip, hflip case at the same time.
This patch fixed vflip, hflip at the same time. If we want to change 180 degree about buffer, then we can use h,vflip or 180 degree. we supports 180 degree using h,vflip. but we make error handling in this case. so, fixed it. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..4c4078c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..09830ad 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: return true; default: DRM_DEBUG_KMS("%s:invalid flip\n", __func__); -- 1.7.0.4
[PATCH 2/8] drm/exynos: removed needless error handling about property.
This patch removed property error handling. property couldn't be NULL. so, I removed it. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 drivers/gpu/drm/exynos/exynos_drm_ipp.c |5 - 3 files changed, 0 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 7a3e460..5dc0251 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -705,10 +705,6 @@ static int fimc_src_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1241,10 +1237,6 @@ static int fimc_dst_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1573,10 +1565,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } fimc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c443c3b..ba5fefd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EFAULT; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EFAULT; - } DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__, property->prop_id, buf_id, buf_type); @@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = _node->property; - if (!property) { - DRM_ERROR("failed to get property.\n"); - return -EINVAL; - } gsc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index ba45f9a..cac94fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) mutex_lock(_node->cmd_lock); property = _node->property; - if (!property) { - DRM_ERROR("failed to get property:prop_id[%d]\n", - c_node->property.prop_id); - goto err_unlock; - } switch (cmd_work->ctrl) { case IPP_CTRL_PLAY: -- 1.7.0.4
[PATCH 1/8] drm/exynos: cleanup current command name.
This patch changed current command name from cmd to c_node. because we already use cmd for command control ioctl in another structure. so, this name make some confusion. Signed-off-by: Eunchul Kim --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|8 drivers/gpu/drm/exynos/exynos_drm_gsc.c |8 drivers/gpu/drm/exynos/exynos_drm_ipp.c |6 +++--- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c |2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 61ea242..7a3e460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -695,7 +695,7 @@ static int fimc_src_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1231,7 +1231,7 @@ static int fimc_dst_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1317,7 +1317,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) { struct fimc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_event_work *event_work = c_node->event_work; int buf_id; @@ -1557,7 +1557,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..c443c3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1171,7 +1171,7 @@ static int gsc_dst_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1312,7 +1312,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) { struct gsc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_event_work *event_work = c_node->event_work; u32 status; @@ -1549,7 +1549,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = >ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..ba45f9a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id); /* store command info in ippdrv */ - ippdrv->cmd = c_node; + ippdrv->c_node = c_node; if (!ipp_ch
[PATCH 0/8] drm/exynos: fixed and cleanup ipp subsystem drivers
Hi All. This patch set fixed some issue and cleanup code. please check my commit and let me know about your comment. - This patch set fixes the following: * fixed vflip, hflip case at the same time: we use vflip, hflip set at the same time for 180 degree supporting. so, we added this case. * fixed warnning in GSC build: we don't use directly readl, but this code remained. so, we changed it. * fixed unnormal interrupt in m2m operation : m2m operation called reset function at every time. but we don't disable dma start. so, we added dma stop and capture stop operation. - And code clean like bellow: * cleanup current command name : we use 'cmd' in property structure and so on. so, this naming make some confusion. we changed 'cmd' to 'c_node' for avoid confusion. * removed error handling about property : property could't be NULL. so, we removed error handling about NULL. * cleanup comment of abbreviation : we changed comments for right grammar. * cleanup needless parenthesis : we missed changing of fimc side. so, I added it. * removed color bar pattern display : we don't use color display at writeback. so, removed it. Thank's BR Eunchul Kim Eunchul Kim (6): drm/exynos: cleanup current command name. drm/exynos: removed needless error handling about property. drm/exynos: fixed vflip, hflip case at the same time. drm/exynos: fixed warnning in GSC build. drm/exynos: cleanup comment of abbreviation. drm/exynos: cleanup needless parenthesis. Jinyoung Jeon (1): drm/exynos: fixed unnormal interrupt in m2m operation. JoongMock Shin (1): drm/exynos: removed color bar pattern display. drivers/gpu/drm/exynos/exynos_drm_fimc.c| 47 +-- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 24 +++-- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 13 ++- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |3 +- 5 files changed, 37 insertions(+), 54 deletions(-)
[PATCH 1/8] drm/exynos: cleanup current command name.
This patch changed current command name from cmd to c_node. because we already use cmd for command control ioctl in another structure. so, this name make some confusion. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|8 drivers/gpu/drm/exynos/exynos_drm_gsc.c |8 drivers/gpu/drm/exynos/exynos_drm_ipp.c |6 +++--- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c |2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 61ea242..7a3e460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -695,7 +695,7 @@ static int fimc_src_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1231,7 +1231,7 @@ static int fimc_dst_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1317,7 +1317,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) { struct fimc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_event_work *event_work = c_node-event_work; int buf_id; @@ -1557,7 +1557,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..c443c3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1171,7 +1171,7 @@ static int gsc_dst_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1312,7 +1312,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) { struct gsc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_event_work *event_work = c_node-event_work; u32 status; @@ -1549,7 +1549,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..ba45f9a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, DRM_DEBUG_KMS(%s:prop_id[%d]\n, __func__, property-prop_id); /* store command info in ippdrv */ - ippdrv-cmd = c_node; + ippdrv-c_node = c_node; if (!ipp_check_mem_list(c_node)) { DRM_DEBUG_KMS(%s:empty memory.\n
[PATCH 2/8] drm/exynos: removed needless error handling about property.
This patch removed property error handling. property couldn't be NULL. so, I removed it. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 drivers/gpu/drm/exynos/exynos_drm_ipp.c |5 - 3 files changed, 0 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 7a3e460..5dc0251 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -705,10 +705,6 @@ static int fimc_src_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1241,10 +1237,6 @@ static int fimc_dst_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1573,10 +1565,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } fimc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c443c3b..ba5fefd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EFAULT; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EFAULT; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } gsc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index ba45f9a..cac94fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) mutex_lock(c_node-cmd_lock); property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property:prop_id[%d]\n, - c_node-property.prop_id); - goto err_unlock; - } switch (cmd_work-ctrl) { case IPP_CTRL_PLAY: -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/8] drm/exynos: fixed vflip, hflip case at the same time.
This patch fixed vflip, hflip at the same time. If we want to change 180 degree about buffer, then we can use h,vflip or 180 degree. we supports 180 degree using h,vflip. but we make error handling in this case. so, fixed it. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..4c4078c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..09830ad 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/8] drm/exynos: fixed warnning in GSC build.
This patch fixed warnning in GSC build. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ba5fefd..4546833 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1592,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)set_wb); /* src local path */ - cfg = readl(GSC_IN_CON); + cfg = gsc_read(GSC_IN_CON); cfg = ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); gsc_write(cfg, GSC_IN_CON); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 5/8] drm/exynos: cleanup comment of abbreviation.
This patch cleanup comment of abbreviation. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 4c4078c..cfeb606 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,7 @@ #include exynos_drm_fimc.h /* - * FIMC is stand for Fully Interactive Mobile Camera and + * FIMC stands for Fully Interactive Mobile Camera and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 4546833..89fdb49 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -25,7 +25,7 @@ #include exynos_drm_gsc.h /* - * GSC is stand for General SCaler and + * GSC stands for General SCaler and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index cac94fe..63bcf92 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -27,7 +27,7 @@ #include exynos_drm_iommu.h /* - * IPP is stand for Image Post Processing and + * IPP stands for Image Post Processing and * supports image scaler/rotator and input/output DMA operations. * using FIMC, GSC, Rotator, so on. * IPP is integration device driver of same attribute h/w -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 6/8] drm/exynos: removed color bar pattern display.
From: JoongMock Shin jmock.s...@samsung.com This patch removed color bar pattern register. we not use color bar any more. and don't support color bar at writeback operation. Signed-off-by: JoongMock Shin jmock.s...@samsung.com Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index cfeb606..67e1b88 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -163,17 +163,14 @@ struct fimc_context { boolsuspended; }; -static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) +static void fimc_sw_reset(struct fimc_context *ctx) { u32 cfg; - DRM_DEBUG_KMS(%s:pattern[%d]\n, __func__, pattern); + DRM_DEBUG_KMS(%s\n, __func__); cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; - if (pattern) - cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR; - fimc_write(cfg, EXYNOS_CISRCFMT); /* s/w reset */ @@ -1536,7 +1533,7 @@ static int fimc_ippdrv_reset(struct device *dev) DRM_DEBUG_KMS(%s\n, __func__); /* reset h/w block */ - fimc_sw_reset(ctx, false); + fimc_sw_reset(ctx); /* reset scaler capability */ memset(ctx-sc, 0x0, sizeof(ctx-sc)); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 7/8] drm/exynos: fixed unnormal interrupt in m2m operation.
From: Jinyoung Jeon jy0.j...@samsung.com This patch fixed unnormal interrupt at m2m operation sometimes. m2m operation called s/w reset during every frame. but m2m occured interrupt after s/w reset sometimes. so, we cleared dma operation and capture operation. Signed-off-by: Jinyoung Jeon jy0.j...@samsung.com Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 67e1b88..c9eaa81 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -169,10 +169,23 @@ static void fimc_sw_reset(struct fimc_context *ctx) DRM_DEBUG_KMS(%s\n, __func__); + /* stop dma operation */ + cfg = fimc_read(EXYNOS_CISTATUS); + if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { + cfg = fimc_read(EXYNOS_MSCTRL); + cfg = ~EXYNOS_MSCTRL_ENVID; + fimc_write(cfg, EXYNOS_MSCTRL); + } + cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; fimc_write(cfg, EXYNOS_CISRCFMT); + /* disable image capture */ + cfg = fimc_read(EXYNOS_CIIMGCPT); + cfg = ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN); + fimc_write(cfg, EXYNOS_CIIMGCPT); + /* s/w reset */ cfg = fimc_read(EXYNOS_CIGCTRL); cfg |= (EXYNOS_CIGCTRL_SWRST); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 8/8] drm/exynos: cleanup needless parenthesis.
This patch cleanup needless parenthesis. we got the comment from GSC. but we missed fimc side. so, we cleanup the code. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index c9eaa81..7238f4e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1212,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, } /* sequence id */ - cfg = (~mask); + cfg = ~mask; cfg |= (enable buf_id); fimc_write(cfg, EXYNOS_CIFCNTSEQ); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/8] drm/exynos: fixed vflip, hflip case at the same time.
Thank's for comment. Oops, sorry that is my fault. I will resend it. BR Eunchul Kim On 12/20/2012 06:48 PM, Inki Dae wrote: -Original Message- From: Eunchul Kim [mailto:chulspro@samsung.com] Sent: Thursday, December 20, 2012 6:32 PM To: dri-devel@lists.freedesktop.org; inki@samsung.com Cc: jy0.j...@samsung.com; yj44@samsung.com; jmock.s...@samsung.com; jaejoon@samsung.com; kyungmin.p...@samsung.com; jy0922.s...@samsung.com; sw0312@samsung.com; th908@samsung.com; lsmin@samsung.com; chulspro@samsung.com Subject: [PATCH 3/8] drm/exynos: fixed vflip, hflip case at the same time. This patch fixed vflip, hflip at the same time. If we want to change 180 degree about buffer, then we can use h,vflip or 180 degree. we supports 180 degree using h,vflip. but we make error handling in this case. so, fixed it. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..4c4078c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: This code induces build warning because the value of 'VERTICAL | HORIZONTAL' is out of range. Add a new enumeration value to enum drm_exynos_flip. i.e. EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL and use it. - thank's I guess why not occured warnning. but It's the better. I will resend it. return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..09830ad 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: Ditto. return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 0/8] drm/exynos: fixed and cleanup ipp subsystem drivers
Hi All. This patch set fixed some issue and cleanup code. please check my commit and let me know about your comment. Changelog v2: - This patch set fixes the following: * fixed vflip, hflip case at the same time: we use vflip, hflip set at the same time for 180 degree supporting. so, we added FLIP_BOTH for fixing warnning. Changelog v1: - This patch set fixes the following: * fixed vflip, hflip case at the same time: we use vflip, hflip set at the same time for 180 degree supporting. so, we added this case. * fixed warnning in GSC build: we don't use directly readl, but this code remained. so, we changed it. * fixed unnormal interrupt in m2m operation : m2m operation called reset function at every time. but we don't disable dma start. so, we added dma stop and capture stop operation. - And code clean like bellow: * cleanup current command name : we use 'cmd' in property structure and so on. so, this naming make some confusion. we changed 'cmd' to 'c_node' for avoid confusion. * removed error handling about property : property could't be NULL. so, we removed error handling about NULL. * cleanup comment of abbreviation : we changed comments for right grammar. * cleanup needless parenthesis : we missed changing of fimc side. so, I added it. * removed color bar pattern display : we don't use color display at writeback. so, removed it. Thank's BR Eunchul Kim Eunchul Kim (6): drm/exynos: cleanup current command name. drm/exynos: removed needless error handling about property. drm/exynos: fixed vflip, hflip case at the same time. drm/exynos: fixed warnning in GSC build. drm/exynos: cleanup comment of abbreviation. drm/exynos: cleanup needless parenthesis. Jinyoung Jeon (1): drm/exynos: fixed unnormal interrupt in m2m operation. JoongMock Shin (1): drm/exynos: removed color bar pattern display. drivers/gpu/drm/exynos/exynos_drm_fimc.c| 47 +-- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 26 --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 13 ++- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |3 +- include/uapi/drm/exynos_drm.h |2 + 6 files changed, 40 insertions(+), 55 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 1/8] drm/exynos: cleanup current command name.
This patch changed current command name from cmd to c_node. because we already use cmd for command control ioctl in another structure. so, this name make some confusion. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|8 drivers/gpu/drm/exynos/exynos_drm_gsc.c |8 drivers/gpu/drm/exynos/exynos_drm_ipp.c |6 +++--- drivers/gpu/drm/exynos/exynos_drm_ipp.h |4 ++-- drivers/gpu/drm/exynos/exynos_drm_rotator.c |2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 61ea242..7a3e460 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -695,7 +695,7 @@ static int fimc_src_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1231,7 +1231,7 @@ static int fimc_dst_set_addr(struct device *dev, { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; @@ -1317,7 +1317,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id) { struct fimc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_event_work *event_work = c_node-event_work; int buf_id; @@ -1557,7 +1557,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct fimc_context *ctx = get_fimc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..c443c3b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1171,7 +1171,7 @@ static int gsc_dst_set_addr(struct device *dev, { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; if (!c_node) { @@ -1312,7 +1312,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id) { struct gsc_context *ctx = dev_id; struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_event_work *event_work = c_node-event_work; u32 status; @@ -1549,7 +1549,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) { struct gsc_context *ctx = get_gsc_context(dev); struct exynos_drm_ippdrv *ippdrv = ctx-ippdrv; - struct drm_exynos_ipp_cmd_node *c_node = ippdrv-cmd; + struct drm_exynos_ipp_cmd_node *c_node = ippdrv-c_node; struct drm_exynos_ipp_property *property; struct drm_exynos_ipp_config *config; struct drm_exynos_pos img_pos[EXYNOS_DRM_OPS_MAX]; diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..ba45f9a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, DRM_DEBUG_KMS(%s:prop_id[%d]\n, __func__, property-prop_id); /* store command info in ippdrv */ - ippdrv-cmd = c_node; + ippdrv-c_node = c_node; if (!ipp_check_mem_list(c_node)) { DRM_DEBUG_KMS(%s:empty memory.\n
[PATCH v2 4/8] drm/exynos: fixed warnning in GSC build.
This patch fixed warnning in GSC build. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 3e5b456..410175a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1592,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)set_wb); /* src local path */ - cfg = readl(GSC_IN_CON); + cfg = gsc_read(GSC_IN_CON); cfg = ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB); gsc_write(cfg, GSC_IN_CON); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 5/8] drm/exynos: cleanup comment of abbreviation.
This patch cleanup comment of abbreviation. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index abfff9e..8cfc5a9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -25,7 +25,7 @@ #include exynos_drm_fimc.h /* - * FIMC is stand for Fully Interactive Mobile Camera and + * FIMC stands for Fully Interactive Mobile Camera and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 410175a..509f2f8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -25,7 +25,7 @@ #include exynos_drm_gsc.h /* - * GSC is stand for General SCaler and + * GSC stands for General SCaler and * supports image scaler/rotator and input/output DMA operations. * input DMA reads image data from the memory. * output DMA writes image data to memory. diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index cac94fe..63bcf92 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -27,7 +27,7 @@ #include exynos_drm_iommu.h /* - * IPP is stand for Image Post Processing and + * IPP stands for Image Post Processing and * supports image scaler/rotator and input/output DMA operations. * using FIMC, GSC, Rotator, so on. * IPP is integration device driver of same attribute h/w -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 2/8] drm/exynos: removed needless error handling about property.
This patch removed property error handling. property couldn't be NULL. so, I removed it. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 12 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 drivers/gpu/drm/exynos/exynos_drm_ipp.c |5 - 3 files changed, 0 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 7a3e460..5dc0251 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -705,10 +705,6 @@ static int fimc_src_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1241,10 +1237,6 @@ static int fimc_dst_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1573,10 +1565,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } fimc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index c443c3b..ba5fefd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EFAULT; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev, } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EFAULT; - } DRM_DEBUG_KMS(%s:prop_id[%d]buf_id[%d]buf_type[%d]\n, __func__, property-prop_id, buf_id, buf_type); @@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd) } property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property.\n); - return -EINVAL; - } gsc_handle_irq(ctx, true, false, true); diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index ba45f9a..cac94fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work) mutex_lock(c_node-cmd_lock); property = c_node-property; - if (!property) { - DRM_ERROR(failed to get property:prop_id[%d]\n, - c_node-property.prop_id); - goto err_unlock; - } switch (cmd_work-ctrl) { case IPP_CTRL_PLAY: -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 6/8] drm/exynos: removed color bar pattern display.
From: JoongMock Shin jmock.s...@samsung.com This patch removed color bar pattern register. we not use color bar any more. and don't support color bar at writeback operation. Signed-off-by: JoongMock Shin jmock.s...@samsung.com Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 8cfc5a9..a99ceef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -163,17 +163,14 @@ struct fimc_context { boolsuspended; }; -static void fimc_sw_reset(struct fimc_context *ctx, bool pattern) +static void fimc_sw_reset(struct fimc_context *ctx) { u32 cfg; - DRM_DEBUG_KMS(%s:pattern[%d]\n, __func__, pattern); + DRM_DEBUG_KMS(%s\n, __func__); cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; - if (pattern) - cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR; - fimc_write(cfg, EXYNOS_CISRCFMT); /* s/w reset */ @@ -1536,7 +1533,7 @@ static int fimc_ippdrv_reset(struct device *dev) DRM_DEBUG_KMS(%s\n, __func__); /* reset h/w block */ - fimc_sw_reset(ctx, false); + fimc_sw_reset(ctx); /* reset scaler capability */ memset(ctx-sc, 0x0, sizeof(ctx-sc)); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 7/8] drm/exynos: fixed unnormal interrupt in m2m operation.
From: Jinyoung Jeon jy0.j...@samsung.com This patch fixed unnormal interrupt at m2m operation sometimes. m2m operation called s/w reset during every frame. but m2m occured interrupt after s/w reset sometimes. so, we cleared dma operation and capture operation. Signed-off-by: Jinyoung Jeon jy0.j...@samsung.com Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index a99ceef..9f52b7f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -169,10 +169,23 @@ static void fimc_sw_reset(struct fimc_context *ctx) DRM_DEBUG_KMS(%s\n, __func__); + /* stop dma operation */ + cfg = fimc_read(EXYNOS_CISTATUS); + if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) { + cfg = fimc_read(EXYNOS_MSCTRL); + cfg = ~EXYNOS_MSCTRL_ENVID; + fimc_write(cfg, EXYNOS_MSCTRL); + } + cfg = fimc_read(EXYNOS_CISRCFMT); cfg |= EXYNOS_CISRCFMT_ITU601_8BIT; fimc_write(cfg, EXYNOS_CISRCFMT); + /* disable image capture */ + cfg = fimc_read(EXYNOS_CIIMGCPT); + cfg = ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN); + fimc_write(cfg, EXYNOS_CIIMGCPT); + /* s/w reset */ cfg = fimc_read(EXYNOS_CIGCTRL); cfg |= (EXYNOS_CIGCTRL_SWRST); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 3/8] drm/exynos: fixed vflip, hflip case at the same time.
Changelog v2: This patch added EXYNOS_DRM_FLIP_BOTH enum value for warnning. Changelog v1: This patch fixed vflip, hflip at the same time. If we want to change 180 degree about buffer, then we can use h,vflip or 180 degree. we supports 180 degree using h,vflip. but we make error handling in this case. so, fixed it. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c|1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c |2 +- drivers/gpu/drm/exynos/exynos_drm_rotator.c |1 + include/uapi/drm/exynos_drm.h |2 ++ 4 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5dc0251..abfff9e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1387,6 +1387,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ba5fefd..3e5b456 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1391,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: - case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 17e4474..8bf9c50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip) case EXYNOS_DRM_FLIP_NONE: case EXYNOS_DRM_FLIP_VERTICAL: case EXYNOS_DRM_FLIP_HORIZONTAL: + case EXYNOS_DRM_FLIP_BOTH: return true; default: DRM_DEBUG_KMS(%s:invalid flip\n, __func__); diff --git a/include/uapi/drm/exynos_drm.h b/include/uapi/drm/exynos_drm.h index e7f52c3..7ed11b2 100644 --- a/include/uapi/drm/exynos_drm.h +++ b/include/uapi/drm/exynos_drm.h @@ -185,6 +185,8 @@ enum drm_exynos_flip { EXYNOS_DRM_FLIP_NONE = (0 0), EXYNOS_DRM_FLIP_VERTICAL = (1 0), EXYNOS_DRM_FLIP_HORIZONTAL = (1 1), + EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL | + EXYNOS_DRM_FLIP_HORIZONTAL, }; enum drm_exynos_degree { -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 8/8] drm/exynos: cleanup needless parenthesis.
This patch cleanup needless parenthesis. we got the comment from GSC. but we missed fimc side. so, we cleanup the code. Signed-off-by: Eunchul Kim chulspro@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_fimc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 9f52b7f..2c03ffa 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -1212,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id, } /* sequence id */ - cfg = (~mask); + cfg = ~mask; cfg |= (enable buf_id); fimc_write(cfg, EXYNOS_CIFCNTSEQ); -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[RFC v5 5/5] drm/exynos: add gsc ipp driver
GSC is stand for General SCaler and supports image scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA reads image data from the memory. output DMA writes image data to memory. GSC supports image rotation and image effect functions, also supports writeback and display output operations. M2M operation : supports crop/scale/rotation/csc so on. Memory ---> GSC H/W ---> Memory. Writeback operation : supports cloned screen with FIMD. FIMD ---> GSC H/W ---> Memory. Output operation : supports direct display using local path. Memory ---> GSC H/W ---> FIMD, Mixer. Changelog v5 - Changed return type - Define hard coding value - Changed to devm_ function Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |5 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1870 +++ drivers/gpu/drm/exynos/exynos_drm_gsc.h | 38 + drivers/gpu/drm/exynos/regs-gsc.h | 284 + 7 files changed, 2214 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4860835..c93d776 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -64,3 +64,8 @@ config DRM_EXYNOS_ROTATOR help Choose this option if you want to use Exynos Rotator for DRM. +config DRM_EXYNOS_GSC + bool "Exynos DRM GSC" + depends on DRM_EXYNOS_IPP && ARCH_EXYNOS5 + help + Choose this option if you want to use Exynos GSC for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 3b70668..639b49e 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -19,5 +19,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o +exynosdrm-$(CONFIG_DRM_EXYNOS_GSC) += exynos_drm_gsc.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 09d884b..e0a8e80 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -384,6 +384,12 @@ static int __init exynos_drm_init(void) goto out_rotator; #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_gsc; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -412,6 +418,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + platform_driver_unregister(_driver); +out_gsc: +#endif + #ifdef CONFIG_DRM_EXYNOS_ROTATOR platform_driver_unregister(_driver); out_rotator: @@ -462,6 +473,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_ROTATOR platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a74e37c..afe556c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -354,5 +354,6 @@ extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; extern struct platform_driver rotator_driver; +extern struct platform_driver gsc_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c new file mode 100644 index 000..5639353 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -0,0 +1,1870 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * Jinyoung Jeon + * Sangmin Lee + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-gsc.h" +#include "exynos_drm_ipp.h" +#include "exynos_drm_gsc.h" + +/* + * GSC is stand for General SCaler and + * supports image scaler/rotator and input/output DMA operations. + * inpu
[RFC v5 4/5] drm/exynos: add rotator ipp driver
Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim Signed-off-by: Youngjun Cho --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 856 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 33 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 986 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool "Exynos DRM Rotator" + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..0025314 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -0,0 +1,856 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * YoungJun Cho + * Eunchul Kim + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-rotator.h" +#include "exynos_drm.h" +#include "exynos_drm_ipp.h" + +/* + * Rotator supports image crop/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * + * M2M operation : supports crop/scale/rotation/csc so on. + * Memory > Rotator H/W > Memory. + */ + +/* + * TODO + * 1. check suspend/resume api if needed. + * 2. need to check use case platform_device_id. + * 3. check src/dst size with, height. + * 4. need to add supported list in prop_list. + */ + +#define get_rot_context(dev) platform_get_drvdata(to_platf
[RFC v5 3/5] drm/exynos: add fimc ipp driver
FIMC is stand for Fully Interfactive Mobile Camera and supports image scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA reads image data from the memory. output DMA writes image data to memory. FIMC supports image rotation and image effect functions. also supports writeback and display output operations. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2002 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h | 37 + drivers/gpu/drm/exynos/regs-fimc.h | 669 ++ include/drm/exynos_drm.h | 26 + 8 files changed, 2757 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index bcf1c9d..4915ab6 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -51,3 +51,9 @@ config DRM_EXYNOS_IPP depends on DRM_EXYNOS help Choose this option if you want to use IPP feature for DRM. + +config DRM_EXYNOS_FIMC + bool "Exynos DRM FIMC" + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos FIMC for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 6c536ce..9710024 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -17,5 +17,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o +exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 0eb8a97..73f02ac 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -372,6 +372,12 @@ static int __init exynos_drm_init(void) goto out_g2d; #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_fimc; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -400,6 +406,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + platform_driver_unregister(_driver); +out_fimc: +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); out_g2d: @@ -440,6 +451,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a365788..14f9490 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -352,5 +352,6 @@ extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; +extern struct platform_driver fimc_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c new file mode 100644 index 000..31df4f5 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -0,0 +1,2002 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * Jinyoung Jeon + * Sangmin Lee + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-fimc.h" +#include "exynos_drm_ipp.h" +#include "exynos_drm_fimc.h" + +/* + * FIMC is stand for Fully Interactive Mobile Camera and + * supports image scaler/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * FIMC supports image rotation and image effect functions. + * + * M2M operation : supports crop/scale/rotation/csc so on. + * Memory > FIMC H/W > Memory. + * Wr
[RFC v5 2/5] drm/exynos: add iommu support for ipp
This patch adds iommu support for ipp. For this, it adds subdrv_probe/remove callback to enable or disable ipp iommu. we can get or put device address to a gem handle from user through exynos_drm_gem_get/put_dma_addr(). Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index c640935..49eebe9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -24,6 +24,7 @@ #include "exynos_drm_drv.h" #include "exynos_drm_gem.h" #include "exynos_drm_ipp.h" +#include "exynos_drm_iommu.h" /* * IPP is stand for Image Post Processing and @@ -1771,10 +1772,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ippdrv->event_workq = ctx->event_workq; ippdrv->sched_event = ipp_sched_event; INIT_LIST_HEAD(>cmd_list); + + if (is_drm_iommu_supported(drm_dev)) { + ret = drm_iommu_attach_device(drm_dev, ippdrv->dev); + if (ret) { + DRM_ERROR("failed to activate iommu\n"); + goto err_iommu; + } + } } return 0; +err_iommu: + /* get ipp driver entry */ + list_for_each_entry_reverse(ippdrv, _drm_ippdrv_list, drv_list) + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv->dev); + err_idr: idr_remove_all(>ipp_idr); idr_remove_all(>prop_idr); @@ -1791,6 +1806,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) /* get ipp driver entry */ list_for_each_entry(ippdrv, _drm_ippdrv_list, drv_list) { + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv->dev); + ippdrv->drm_dev = NULL; exynos_drm_ippdrv_unregister(ippdrv); } -- 1.7.0.4
[RFC v5 1/5] drm/exynos: add ipp subsystem
IPP stand for Image Post Processing and supports image scaler/rotator /crop/flip/csc(color space conversion) and input/output DMA operations using ipp drivers. also supports writeback and display output operations. ipp driver include FIMC, Rotator, GSC, SC, so on. and ipp is integration device driver for each hardware. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 24 + drivers/gpu/drm/exynos/exynos_drm_drv.h |7 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2042 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 include/uapi/drm/exynos_drm.h | 190 +++ 7 files changed, 2536 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4ea8cdc..bcf1c9d 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -45,3 +45,9 @@ config DRM_EXYNOS_G2D depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_G2D help Choose this option if you want to use Exynos G2D for DRM. + +config DRM_EXYNOS_IPP + bool "Exynos DRM IPP" + depends on DRM_EXYNOS + help + Choose this option if you want to use IPP feature for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 26813b8..6c536ce 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -16,5 +16,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynos_drm_hdmi.o exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o +exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 4a1168d..0eb8a97 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -40,6 +40,7 @@ #include "exynos_drm_vidi.h" #include "exynos_drm_dmabuf.h" #include "exynos_drm_g2d.h" +#include "exynos_drm_ipp.h" #include "exynos_drm_iommu.h" #define DRIVER_NAME"exynos" @@ -249,6 +250,14 @@ static struct drm_ioctl_desc exynos_ioctls[] = { exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH), DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_PROPERTY, + exynos_drm_ipp_get_property, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_SET_PROPERTY, + exynos_drm_ipp_set_property, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_QUEUE_BUF, + exynos_drm_ipp_queue_buf, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_CMD_CTRL, + exynos_drm_ipp_cmd_ctrl, DRM_UNLOCKED | DRM_AUTH), }; static const struct file_operations exynos_drm_driver_fops = { @@ -363,6 +372,12 @@ static int __init exynos_drm_init(void) goto out_g2d; #endif +#ifdef CONFIG_DRM_EXYNOS_IPP + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_ipp; +#endif + ret = platform_driver_register(_drm_platform_driver); if (ret < 0) goto out_drm; @@ -380,6 +395,11 @@ out: platform_driver_unregister(_drm_platform_driver); out_drm: +#ifdef CONFIG_DRM_EXYNOS_IPP + platform_driver_unregister(_driver); +out_ipp: +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); out_g2d: @@ -416,6 +436,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_drm_platform_driver); +#ifdef CONFIG_DRM_EXYNOS_IPP + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a9db025..a365788 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -235,8 +235,14 @@ struct exynos_drm_g2d_private { unsigned intgem_nr; }; +struct exynos_drm_ipp_private { + struct device *dev; + struct list_headevent_list; +}; + struct drm_exynos_file_private { struct exynos_drm_g2d_private *g2d_priv; + struct exynos_drm_ipp_private *ipp_priv; }; /* @@ -346,4 +352,5 @@ extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdm
[RFC v5 0/5] drm/exynos: add ipp subsystem and each ipp drivers
begin, end; struct drm_gem_close args; char filename[100]; /* For property */ ret = exynos_drm_ipp_set_property(fd, , _sz, IPP_CMD_M2M, EXYNOS_DRM_DEGREE_0); if (ret) { fprintf(stderr, "failed to ipp property\n"); return; } for (i = 0; i < MAX_BUF; i++) { /* For source buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_SRC, IPP_BUF_ENQUEUE, property.prop_id, i, gem1[i].handle); if (ret) { fprintf(stderr, "failed to ipp buf src map\n"); goto err_ipp_ctrl_close; } } for (i = 0; i < MAX_BUF; i++) { /* For destination buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_DST, IPP_BUF_ENQUEUE, property.prop_id, i, gem2[i].handle); if (ret) { fprintf(stderr, "failed to ipp buf dst map\n"); goto err_ipp_ctrl_close; } } /* Start */ gettimeofday(, NULL); ret = exynos_drm_ipp_cmd_ctrl(fd, _ctrl, property.prop_id, IPP_CTRL_PLAY); if (ret) { fprintf(stderr, "failed to ipp ctrl IPP_CMD_M2M start\n"); goto err_ipp_ctrl_close; } j=0; while (1) { struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 }; fd_set fds; FD_ZERO(); FD_SET(0, ); FD_SET(fd, ); ret = select(fd + 1, , NULL, NULL, ); if (ret <= 0) { fprintf(stderr, "select timed out or error.\n"); continue; } else if (FD_ISSET(0, )) { break; } gettimeofday(, NULL); usec[j] = (end.tv_sec - begin.tv_sec) * 100 + (end.tv_usec - begin.tv_usec); if(ipp_event_handler() < 0) break; if (++j > MAX_LOOP) break; gettimeofday(, NULL); } err_ipp_ctrl_close: /* For source buffer dequeue to IPP */ for (i = 0; i < MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_SRC, IPP_BUF_DEQUEUE, property.prop_id, i, gem1[i].handle); if (ret < 0) fprintf(stderr, "failed to ipp buf dst dequeue\n"); } /* For destination buffer dequeue to IPP */ for (i = 0; i < MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_DST, IPP_BUF_DEQUEUE, property.prop_id, i, gem2[i].handle); if (ret < 0) fprintf(stderr, "failed to ipp buf dst dequeue\n"); } /* Stop */ ret = exynos_drm_ipp_cmd_ctrl(fd, _ctrl, property.prop_id, IPP_CTRL_STOP); if (ret) fprintf(stderr, "failed to ipp ctrl IPP_CMD_WB stop\n"); return; } Eunchul Kim (5): drm/exynos: add ipp subsystem drm/exynos: add iommu support for ipp drm/exynos: add fimc ipp driver drm/exynos: add rotator ipp driver drm/exynos: add gsc ipp driver drivers/gpu/drm/exynos/Kconfig | 24 + drivers/gpu/drm/exynos/Makefile |4 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 69 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 + drivers/gpu/drm/exynos/exynos_drm_fimc.c| 2002 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h| 37 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1870 drivers/gpu/drm/exynos/exynos_drm_gsc.h | 38 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2060 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 856 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 33 + drivers/gpu/drm/exynos/regs-fimc.h | 669 + drivers/gpu/drm/exynos/regs-gsc.h | 284 drivers/gpu/drm/exynos/regs-rotator.h | 73 + include/drm/exynos_drm.h| 26 + include/uapi/drm/exynos_drm.h | 190 +++ 17 files changed, 8511 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 driv
[RFC v3 5/5] drm/exynos: add gsc ipp driver
Thank's for your comment. please check my answer. BR Eunchul Kim On 12/13/2012 11:29 AM, Joonyoung Shim wrote: > Hi, > > I can't review about logic of driver because i don't know well but i > feel there are too many checking codes and unused or big size defines. - I think error handling need. and What is unused defines ? What is big size define ? you mean the coefficient value ? > Please refer v4l2 exynos gsc driver in drivers/media/platform/exynos-gsc/. - I will check exynos gsc. > > This v3 patch seems to add many codes than v2. Please write changelog in > future. - Thank's I don't have a lot of experience about posting. > Even if line is short, many lines are split to two lines. Please check > it overall. - PATCH description ? > > Thanks. > > On 12/12/2012 04:34 PM, Eunchul Kim wrote: >> GSC is stand for General SCaler and supports supports > > supports supports - Thank's, done. > >> image scaler/rotator/crop/flip/csc and input/output DMA operations. >> input DMA reads image data from the memory. >> output DMA writes image data to memory. >> GSC supports image rotation and imag effect functions. > > s/imag/image - done. > >> also supports writeback and display output operations. > > There are to begin a new line unnecessarily. Could you rewrite > detailedly how this driver operates? - What kind of ? writeback ? output operation ? > >> >> Signed-off-by: Eunchul Kim >> Signed-off-by: Jinyoung Jeon >> --- >> drivers/gpu/drm/exynos/Kconfig |5 + >> drivers/gpu/drm/exynos/Makefile |1 + >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >> drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >> drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1927 >> +++ >> drivers/gpu/drm/exynos/exynos_drm_gsc.h | 34 + >> drivers/gpu/drm/exynos/regs-gsc.h | 295 + >> 7 files changed, 2278 insertions(+), 0 deletions(-) >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h >> create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig >> b/drivers/gpu/drm/exynos/Kconfig >> index 4860835..c93d776 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -64,3 +64,8 @@ config DRM_EXYNOS_ROTATOR >> help >> Choose this option if you want to use Exynos Rotator for DRM. >> +config DRM_EXYNOS_GSC >> +bool "Exynos DRM GSC" >> +depends on DRM_EXYNOS_IPP && ARCH_EXYNOS5 >> +help >> + Choose this option if you want to use Exynos GSC for DRM. >> diff --git a/drivers/gpu/drm/exynos/Makefile >> b/drivers/gpu/drm/exynos/Makefile >> index 3b70668..639b49e 100644 >> --- a/drivers/gpu/drm/exynos/Makefile >> +++ b/drivers/gpu/drm/exynos/Makefile >> @@ -19,5 +19,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= >> exynos_drm_g2d.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_IPP)+= exynos_drm_ipp.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)+= exynos_drm_rotator.o >> +exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)+= exynos_drm_gsc.o >> obj-$(CONFIG_DRM_EXYNOS)+= exynosdrm.o >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> index 09d884b..e0a8e80 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> @@ -384,6 +384,12 @@ static int __init exynos_drm_init(void) >> goto out_rotator; >> #endif >> +#ifdef CONFIG_DRM_EXYNOS_GSC >> +ret = platform_driver_register(_driver); >> +if (ret < 0) >> +goto out_gsc; >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_IPP >> ret = platform_driver_register(_driver); >> if (ret < 0) >> @@ -412,6 +418,11 @@ out_drm: >> out_ipp: >> #endif >> +#ifdef CONFIG_DRM_EXYNOS_GSC >> +platform_driver_unregister(_driver); >> +out_gsc: >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_ROTATOR >> platform_driver_unregister(_driver); >> out_rotator: >> @@ -462,6 +473,10 @@ static void __exit exynos_drm_exit(void) >> platform_driver_unregister(_driver); >> #endif >> +#ifdef CONFIG_DRM_EXYNOS_GSC >> +platform_driver_unregister(_driver); >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_ROTATOR >> platform_driver_unregister(_dr
[RFC v5 2/5] drm/exynos: add iommu support for ipp
This patch adds iommu support for ipp. For this, it adds subdrv_probe/remove callback to enable or disable ipp iommu. we can get or put device address to a gem handle from user through exynos_drm_gem_get/put_dma_addr(). Signed-off-by: Eunchul Kim chulspro@samsung.com Signed-off-by: Jinyoung Jeon jy0.j...@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index c640935..49eebe9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -24,6 +24,7 @@ #include exynos_drm_drv.h #include exynos_drm_gem.h #include exynos_drm_ipp.h +#include exynos_drm_iommu.h /* * IPP is stand for Image Post Processing and @@ -1771,10 +1772,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ippdrv-event_workq = ctx-event_workq; ippdrv-sched_event = ipp_sched_event; INIT_LIST_HEAD(ippdrv-cmd_list); + + if (is_drm_iommu_supported(drm_dev)) { + ret = drm_iommu_attach_device(drm_dev, ippdrv-dev); + if (ret) { + DRM_ERROR(failed to activate iommu\n); + goto err_iommu; + } + } } return 0; +err_iommu: + /* get ipp driver entry */ + list_for_each_entry_reverse(ippdrv, exynos_drm_ippdrv_list, drv_list) + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv-dev); + err_idr: idr_remove_all(ctx-ipp_idr); idr_remove_all(ctx-prop_idr); @@ -1791,6 +1806,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) /* get ipp driver entry */ list_for_each_entry(ippdrv, exynos_drm_ippdrv_list, drv_list) { + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv-dev); + ippdrv-drm_dev = NULL; exynos_drm_ippdrv_unregister(ippdrv); } -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[RFC v5 0/5] drm/exynos: add ipp subsystem and each ipp drivers
property\n); return; } for (i = 0; i MAX_BUF; i++) { /* For source buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, qbuf1[i], EXYNOS_DRM_OPS_SRC, IPP_BUF_ENQUEUE, property.prop_id, i, gem1[i].handle); if (ret) { fprintf(stderr, failed to ipp buf src map\n); goto err_ipp_ctrl_close; } } for (i = 0; i MAX_BUF; i++) { /* For destination buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, qbuf2[i], EXYNOS_DRM_OPS_DST, IPP_BUF_ENQUEUE, property.prop_id, i, gem2[i].handle); if (ret) { fprintf(stderr, failed to ipp buf dst map\n); goto err_ipp_ctrl_close; } } /* Start */ gettimeofday(begin, NULL); ret = exynos_drm_ipp_cmd_ctrl(fd, cmd_ctrl, property.prop_id, IPP_CTRL_PLAY); if (ret) { fprintf(stderr, failed to ipp ctrl IPP_CMD_M2M start\n); goto err_ipp_ctrl_close; } j=0; while (1) { struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 }; fd_set fds; FD_ZERO(fds); FD_SET(0, fds); FD_SET(fd, fds); ret = select(fd + 1, fds, NULL, NULL, timeout); if (ret = 0) { fprintf(stderr, select timed out or error.\n); continue; } else if (FD_ISSET(0, fds)) { break; } gettimeofday(end, NULL); usec[j] = (end.tv_sec - begin.tv_sec) * 100 + (end.tv_usec - begin.tv_usec); if(ipp_event_handler() 0) break; if (++j MAX_LOOP) break; gettimeofday(begin, NULL); } err_ipp_ctrl_close: /* For source buffer dequeue to IPP */ for (i = 0; i MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, qbuf1[i], EXYNOS_DRM_OPS_SRC, IPP_BUF_DEQUEUE, property.prop_id, i, gem1[i].handle); if (ret 0) fprintf(stderr, failed to ipp buf dst dequeue\n); } /* For destination buffer dequeue to IPP */ for (i = 0; i MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, qbuf2[i], EXYNOS_DRM_OPS_DST, IPP_BUF_DEQUEUE, property.prop_id, i, gem2[i].handle); if (ret 0) fprintf(stderr, failed to ipp buf dst dequeue\n); } /* Stop */ ret = exynos_drm_ipp_cmd_ctrl(fd, cmd_ctrl, property.prop_id, IPP_CTRL_STOP); if (ret) fprintf(stderr, failed to ipp ctrl IPP_CMD_WB stop\n); return; } Eunchul Kim (5): drm/exynos: add ipp subsystem drm/exynos: add iommu support for ipp drm/exynos: add fimc ipp driver drm/exynos: add rotator ipp driver drm/exynos: add gsc ipp driver drivers/gpu/drm/exynos/Kconfig | 24 + drivers/gpu/drm/exynos/Makefile |4 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 69 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 + drivers/gpu/drm/exynos/exynos_drm_fimc.c| 2002 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h| 37 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1870 drivers/gpu/drm/exynos/exynos_drm_gsc.h | 38 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2060 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 856 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 33 + drivers/gpu/drm/exynos/regs-fimc.h | 669 + drivers/gpu/drm/exynos/regs-gsc.h | 284 drivers/gpu/drm/exynos/regs-rotator.h | 73 + include/drm/exynos_drm.h| 26 + include/uapi/drm/exynos_drm.h | 190 +++ 17 files changed, 8511 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h create mode 100644 drivers
[RFC v5 4/5] drm/exynos: add rotator ipp driver
Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim chulspro@samsung.com Signed-off-by: Youngjun Cho yj44@samsung.com --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 856 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 33 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 986 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool Exynos DRM Rotator + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(rotator_driver); + if (ret 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(ipp_driver); if (ret 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(ipp_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..0025314 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -0,0 +1,856 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * YoungJun Cho yj44@samsung.com + * Eunchul Kim chulspro@samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/err.h +#include linux/interrupt.h +#include linux/io.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/pm_runtime.h + +#include drm/drmP.h +#include drm/exynos_drm.h +#include regs-rotator.h +#include exynos_drm.h +#include exynos_drm_ipp.h + +/* + * Rotator supports image crop/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * + * M2M operation : supports crop/scale/rotation/csc so on. + * Memory Rotator H/W Memory. + */ + +/* + * TODO + * 1. check suspend/resume api if needed. + * 2
[RFC v4 5/5] drm/exynos: add gsc ipp driver
GSC is stand for General SCaler and supports supports image scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA reads image data from the memory. output DMA writes image data to memory. GSC supports image rotation and imag effect functions. also supports writeback and display output operations. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |5 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1897 +++ drivers/gpu/drm/exynos/exynos_drm_gsc.h | 34 + drivers/gpu/drm/exynos/regs-gsc.h | 295 + 7 files changed, 2248 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4860835..c93d776 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -64,3 +64,8 @@ config DRM_EXYNOS_ROTATOR help Choose this option if you want to use Exynos Rotator for DRM. +config DRM_EXYNOS_GSC + bool "Exynos DRM GSC" + depends on DRM_EXYNOS_IPP && ARCH_EXYNOS5 + help + Choose this option if you want to use Exynos GSC for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 3b70668..639b49e 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -19,5 +19,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o +exynosdrm-$(CONFIG_DRM_EXYNOS_GSC) += exynos_drm_gsc.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 09d884b..e0a8e80 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -384,6 +384,12 @@ static int __init exynos_drm_init(void) goto out_rotator; #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_gsc; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -412,6 +418,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + platform_driver_unregister(_driver); +out_gsc: +#endif + #ifdef CONFIG_DRM_EXYNOS_ROTATOR platform_driver_unregister(_driver); out_rotator: @@ -462,6 +473,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_ROTATOR platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a74e37c..afe556c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -354,5 +354,6 @@ extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; extern struct platform_driver rotator_driver; +extern struct platform_driver gsc_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c new file mode 100644 index 000..adb8b12 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -0,0 +1,1897 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * Jinyoung Jeon + * Sangmin Lee + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-gsc.h" +#include "exynos_drm_ipp.h" +#include "exynos_drm_gsc.h" + +/* + * GSC is stand for General SCaler and + * supports image scaler/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * GSC supports image rotation and image effect functions. + */ + +#define GSC_MAX_DEVS 4 +#define GSC_MAX_SRC4 +#define GSC_MAX_DST16 +#define GSC_RESET_TIMEOUT 50 +#define GSC_BUF_STOP 1 +#define GSC_BUF_START 2 +#define GSC_REG_SZ 16 +#define GS
[RFC v4 4/5] drm/exynos: add rotator ipp driver
Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim Signed-off-by: Youngjun Cho --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 871 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 981 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool "Exynos DRM Rotator" + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..937f98f --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -0,0 +1,871 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * YoungJun Cho + * Eunchul Kim + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-rotator.h" +#include "exynos_drm.h" +#include "exynos_drm_ipp.h" + +/* + * Rotator supports image crop/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + */ + +#define get_rot_context(dev) platform_get_drvdata(to_platform_device(dev)) +#define get_ctx_from_ippdrv(ippdrv)container_of(ippdrv,\ + struct rot_context, ippdrv); +#define rot_read(offset) readl(rot->regs + (offset)) +#define rot_write(cfg, offset) writel(cfg, rot->regs + (offset)) + +enum
[RFC v4 3/5] drm/exynos: add fimc ipp driver
FIMC is stand for Fully Interfactive Mobile Camera and supports image scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA reads image data from the memory. output DMA writes image data to memory. FIMC supports image rotation and image effect functions. also supports writeback and display output operations. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2017 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h | 34 + drivers/gpu/drm/exynos/regs-fimc.h | 669 ++ include/drm/exynos_drm.h | 26 + 8 files changed, 2769 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index bcf1c9d..4915ab6 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -51,3 +51,9 @@ config DRM_EXYNOS_IPP depends on DRM_EXYNOS help Choose this option if you want to use IPP feature for DRM. + +config DRM_EXYNOS_FIMC + bool "Exynos DRM FIMC" + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos FIMC for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 6c536ce..9710024 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -17,5 +17,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o +exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 0eb8a97..73f02ac 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -372,6 +372,12 @@ static int __init exynos_drm_init(void) goto out_g2d; #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_fimc; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -400,6 +406,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + platform_driver_unregister(_driver); +out_fimc: +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); out_g2d: @@ -440,6 +451,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a365788..14f9490 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -352,5 +352,6 @@ extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; +extern struct platform_driver fimc_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c new file mode 100644 index 000..4233d39 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -0,0 +1,2017 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * Jinyoung Jeon + * Sangmin Lee + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-fimc.h" +#include "exynos_drm_ipp.h" +#include "exynos_drm_fimc.h" + +/* + * FIMC is stand for Fully Interactive Mobile Camera and + * supports image scaler/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * FIMC supports image rotation and image effect functions. + */ + +#define FIMC_MAX_DEVS 4 +#define FIMC_MAX_SRC 2 +#define FIMC_MAX_DST 32 +#define FIMC_SHFACTOR 10 +#d
[RFC v4 2/5] drm/exynos: add iommu support for ipp
This patch adds iommu support for ipp. For this, it adds subdrv_probe/remove callback to enable or disable ipp iommu. we can get or put device address to a gem handle from user through exynos_drm_gem_get/put_dma_addr(). Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index f95b407..e4b42cd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -24,6 +24,7 @@ #include "exynos_drm_drv.h" #include "exynos_drm_gem.h" #include "exynos_drm_ipp.h" +#include "exynos_drm_iommu.h" /* * IPP is stand for Image Post Processing and @@ -1765,10 +1766,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ippdrv->event_workq = ctx->event_workq; ippdrv->sched_event = ipp_sched_event; INIT_LIST_HEAD(>cmd_list); + + if (is_drm_iommu_supported(drm_dev)) { + ret = drm_iommu_attach_device(drm_dev, ippdrv->dev); + if (ret) { + DRM_ERROR("failed to activate iommu\n"); + goto err_iommu; + } + } } return 0; +err_iommu: + /* get ipp driver entry */ + list_for_each_entry_reverse(ippdrv, _drm_ippdrv_list, drv_list) + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv->dev); + err_idr: idr_remove_all(>ipp_idr); idr_remove_all(>prop_idr); @@ -1785,6 +1800,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) /* get ipp driver entry */ list_for_each_entry(ippdrv, _drm_ippdrv_list, drv_list) { + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv->dev); + ippdrv->drm_dev = NULL; exynos_drm_ippdrv_unregister(ippdrv); } -- 1.7.0.4
[RFC v4 1/5] drm/exynos: add ipp subsystem
IPP stand for Image Post Processing and supports image scaler/rotator /crop/flip/csc(color space conversion) and input/output DMA operations using ipp drivers. also supports writeback and display output operations. ipp driver include FIMC, Rotator, GSC, SC, so on. and ipp is integration device driver for each hardware. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 24 + drivers/gpu/drm/exynos/exynos_drm_drv.h |7 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2041 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 include/uapi/drm/exynos_drm.h | 190 +++ 7 files changed, 2535 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4ea8cdc..bcf1c9d 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -45,3 +45,9 @@ config DRM_EXYNOS_G2D depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_G2D help Choose this option if you want to use Exynos G2D for DRM. + +config DRM_EXYNOS_IPP + bool "Exynos DRM IPP" + depends on DRM_EXYNOS + help + Choose this option if you want to use IPP feature for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 26813b8..6c536ce 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -16,5 +16,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynos_drm_hdmi.o exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o +exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 4a1168d..0eb8a97 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -40,6 +40,7 @@ #include "exynos_drm_vidi.h" #include "exynos_drm_dmabuf.h" #include "exynos_drm_g2d.h" +#include "exynos_drm_ipp.h" #include "exynos_drm_iommu.h" #define DRIVER_NAME"exynos" @@ -249,6 +250,14 @@ static struct drm_ioctl_desc exynos_ioctls[] = { exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | DRM_AUTH), DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_PROPERTY, + exynos_drm_ipp_get_property, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_SET_PROPERTY, + exynos_drm_ipp_set_property, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_QUEUE_BUF, + exynos_drm_ipp_queue_buf, DRM_UNLOCKED | DRM_AUTH), + DRM_IOCTL_DEF_DRV(EXYNOS_IPP_CMD_CTRL, + exynos_drm_ipp_cmd_ctrl, DRM_UNLOCKED | DRM_AUTH), }; static const struct file_operations exynos_drm_driver_fops = { @@ -363,6 +372,12 @@ static int __init exynos_drm_init(void) goto out_g2d; #endif +#ifdef CONFIG_DRM_EXYNOS_IPP + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_ipp; +#endif + ret = platform_driver_register(_drm_platform_driver); if (ret < 0) goto out_drm; @@ -380,6 +395,11 @@ out: platform_driver_unregister(_drm_platform_driver); out_drm: +#ifdef CONFIG_DRM_EXYNOS_IPP + platform_driver_unregister(_driver); +out_ipp: +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); out_g2d: @@ -416,6 +436,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_drm_platform_driver); +#ifdef CONFIG_DRM_EXYNOS_IPP + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a9db025..a365788 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -235,8 +235,14 @@ struct exynos_drm_g2d_private { unsigned intgem_nr; }; +struct exynos_drm_ipp_private { + struct device *dev; + struct list_headevent_list; +}; + struct drm_exynos_file_private { struct exynos_drm_g2d_private *g2d_priv; + struct exynos_drm_ipp_private *ipp_priv; }; /* @@ -346,4 +352,5 @@ extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdm
[RFC v4 0/5] drm/exynos: add ipp subsystem and each ipp drivers
rr, "failed to ipp property\n"); return; } for (i = 0; i < MAX_BUF; i++) { /* For source buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_SRC, IPP_BUF_ENQUEUE, property.prop_id, i, gem1[i].handle); if (ret) { fprintf(stderr, "failed to ipp buf src map\n"); goto err_ipp_ctrl_close; } } for (i = 0; i < MAX_BUF; i++) { /* For destination buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_DST, IPP_BUF_ENQUEUE, property.prop_id, i, gem2[i].handle); if (ret) { fprintf(stderr, "failed to ipp buf dst map\n"); goto err_ipp_ctrl_close; } } /* Start */ gettimeofday(, NULL); ret = exynos_drm_ipp_cmd_ctrl(fd, _ctrl, property.prop_id, IPP_CTRL_PLAY); if (ret) { fprintf(stderr, "failed to ipp ctrl IPP_CMD_M2M start\n"); goto err_ipp_ctrl_close; } j=0; while (1) { struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 }; fd_set fds; FD_ZERO(); FD_SET(0, ); FD_SET(fd, ); ret = select(fd + 1, , NULL, NULL, ); if (ret <= 0) { fprintf(stderr, "select timed out or error.\n"); continue; } else if (FD_ISSET(0, )) { break; } gettimeofday(, NULL); usec[j] = (end.tv_sec - begin.tv_sec) * 100 + (end.tv_usec - begin.tv_usec); if(ipp_event_handler() < 0) break; if (++j > MAX_LOOP) break; gettimeofday(, NULL); } err_ipp_ctrl_close: /* For source buffer dequeue to IPP */ for (i = 0; i < MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_SRC, IPP_BUF_DEQUEUE, property.prop_id, i, gem1[i].handle); if (ret < 0) fprintf(stderr, "failed to ipp buf dst dequeue\n"); } /* For destination buffer dequeue to IPP */ for (i = 0; i < MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_DST, IPP_BUF_DEQUEUE, property.prop_id, i, gem2[i].handle); if (ret < 0) fprintf(stderr, "failed to ipp buf dst dequeue\n"); } /* Stop */ ret = exynos_drm_ipp_cmd_ctrl(fd, _ctrl, property.prop_id, IPP_CTRL_STOP); if (ret) fprintf(stderr, "failed to ipp ctrl IPP_CMD_WB stop\n"); return; } Eunchul Kim (5): drm/exynos: add ipp subsystem drm/exynos: add iommu support for ipp drm/exynos: add fimc ipp driver drm/exynos: add rotator ipp driver drm/exynos: add gsc ipp driver drivers/gpu/drm/exynos/Kconfig | 24 + drivers/gpu/drm/exynos/Makefile |4 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 69 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 + drivers/gpu/drm/exynos/exynos_drm_fimc.c| 2017 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h| 34 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1897 drivers/gpu/drm/exynos/exynos_drm_gsc.h | 34 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2059 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 871 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-fimc.h | 669 + drivers/gpu/drm/exynos/regs-gsc.h | 295 drivers/gpu/drm/exynos/regs-rotator.h | 73 + include/drm/exynos_drm.h| 26 + include/uapi/drm/exynos_drm.h | 190 +++ 17 files changed, 8551 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h
[RFC v3 4/5] drm/exynos: add rotator ipp driver
Thank's for your comment. BR Eunchul Kim. On 12/12/2012 06:46 PM, Inki Dae wrote: > > One more comment. > > >> -Original Message- >> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >> Sent: Wednesday, December 12, 2012 6:26 PM >> To: Inki Dae >> Cc: dri-devel at lists.freedesktop.org; jy0.jeon at samsung.com; >> yj44.cho at samsung.com; jmock.shin at samsung.com; jaejoon.seo at >> samsung.com; >> kyungmin.park at samsung.com; sw0312.kim at samsung.com; Joonyoung Shim >> Subject: Re: [RFC v3 4/5] drm/exynos: add rotator ipp driver >> >> Thank's your comment. >> >> I answer your comment. please check that. >> >> Thank's >> >> BR >> Eunchul Kim >> >> On 12/12/2012 05:29 PM, Inki Dae wrote: >>> >>> >>>> -Original Message- >>>> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >>>> Sent: Wednesday, December 12, 2012 4:35 PM >>>> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >>>> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; jmock.shin at >>>> samsung.com; >>>> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >>>> chulspro.kim at samsung.com >>>> Subject: [RFC v3 4/5] drm/exynos: add rotator ipp driver >>>> >>>> Rotator supports rotation/crop/flip and input/output DMA operations >>>> Rotator ipp driver supports 90,180,270 degree rotaion and vertical, >>>> horizontal flip. >>>> and has some limitations(source and destination format have to be same, >> no >>>> scaler) >>>> >>>> Signed-off-by: Eunchul Kim >>>> Signed-off-by: Youngjun Cho >>>> --- >>>>drivers/gpu/drm/exynos/Kconfig |7 + >>>>drivers/gpu/drm/exynos/Makefile |1 + >>>>drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >>>>drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >>>>drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 >>>> +++ >>>>drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + >>>>drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ >>>>7 files changed, 939 insertions(+), 0 deletions(-) >>>>create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c >>>>create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h >>>>create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h >>>> >>>> diff --git a/drivers/gpu/drm/exynos/Kconfig >>>> b/drivers/gpu/drm/exynos/Kconfig >>>> index 4915ab6..4860835 100644 >>>> --- a/drivers/gpu/drm/exynos/Kconfig >>>> +++ b/drivers/gpu/drm/exynos/Kconfig >>>> @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC >>>>depends on DRM_EXYNOS_IPP >>>>help >>>> Choose this option if you want to use Exynos FIMC for DRM. >>>> + >>>> +config DRM_EXYNOS_ROTATOR >>>> + bool "Exynos DRM Rotator" >>>> + depends on DRM_EXYNOS_IPP >>>> + help >>>> +Choose this option if you want to use Exynos Rotator for DRM. >>>> + >>>> diff --git a/drivers/gpu/drm/exynos/Makefile >>>> b/drivers/gpu/drm/exynos/Makefile >>>> index 9710024..3b70668 100644 >>>> --- a/drivers/gpu/drm/exynos/Makefile >>>> +++ b/drivers/gpu/drm/exynos/Makefile >>>> @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += >>>> exynos_drm_vidi.o >>>>exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o >>>>exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o >>>>exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC) += exynos_drm_fimc.o >>>> +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)+= exynos_drm_rotator.o >>>> >>>>obj-$(CONFIG_DRM_EXYNOS)+= exynosdrm.o >>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> index 73f02ac..09d884b 100644 >>>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) >>>>goto out_fimc; >>>>#endif >>>> >>>> +#ifdef CONFIG_DRM_EXYNOS_ROTATOR >>>> + ret = platform_driver_register(_driver); >>>
[RFC v3 4/5] drm/exynos: add rotator ipp driver
Thank's your comment BR Eunchul Kim On 12/12/2012 07:39 PM, Inki Dae wrote: > > >> -Original Message- >> From: Inki Dae [mailto:inki.dae at samsung.com] >> Sent: Wednesday, December 12, 2012 7:01 PM >> To: 'Inki Dae'; 'Eunchul Kim' >> Cc: jy0.jeon at samsung.com; sw0312.kim at samsung.com; jaejoon.seo at >> samsung.com; >> kyungmin.park at samsung.com; dri-devel at lists.freedesktop.org; >> jmock.shin at samsung.com >> Subject: RE: [RFC v3 4/5] drm/exynos: add rotator ipp driver >> >> >> >>> -Original Message- >>> From: dri-devel-bounces+inki.dae=samsung.com at lists.freedesktop.org >>> [mailto:dri-devel-bounces+inki.dae=samsung.com at lists.freedesktop.org] On >>> Behalf Of Inki Dae >>> Sent: Wednesday, December 12, 2012 6:42 PM >>> To: 'Eunchul Kim' >>> Cc: jy0.jeon at samsung.com; sw0312.kim at samsung.com; >> jaejoon.seo at samsung.com; >>> kyungmin.park at samsung.com; dri-devel at lists.freedesktop.org; >>> jmock.shin at samsung.com >>> Subject: RE: [RFC v3 4/5] drm/exynos: add rotator ipp driver >>> >>> >>> >>>> -Original Message- >>>> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >>>> Sent: Wednesday, December 12, 2012 6:26 PM >>>> To: Inki Dae >>>> Cc: dri-devel at lists.freedesktop.org; jy0.jeon at samsung.com; >>>> yj44.cho at samsung.com; jmock.shin at samsung.com; jaejoon.seo at >>>> samsung.com; >>>> kyungmin.park at samsung.com; sw0312.kim at samsung.com; Joonyoung Shim >>>> Subject: Re: [RFC v3 4/5] drm/exynos: add rotator ipp driver >>>> >>>> Thank's your comment. >>>> >>>> I answer your comment. please check that. >>>> >>>> Thank's >>>> >>>> BR >>>> Eunchul Kim >>>> >>>> On 12/12/2012 05:29 PM, Inki Dae wrote: >>>>> >>>>> >>>>>> -Original Message- >>>>>> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >>>>>> Sent: Wednesday, December 12, 2012 4:35 PM >>>>>> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >>>>>> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; >>> jmock.shin at samsung.com; >>>>>> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >>>>>> chulspro.kim at samsung.com >>>>>> Subject: [RFC v3 4/5] drm/exynos: add rotator ipp driver >>>>>> >>>>>> Rotator supports rotation/crop/flip and input/output DMA operations >>>>>> Rotator ipp driver supports 90,180,270 degree rotaion and vertical, >>>>>> horizontal flip. >>>>>> and has some limitations(source and destination format have to be >>> same, >>>> no >>>>>> scaler) >>>>>> >>>>>> Signed-off-by: Eunchul Kim >>>>>> Signed-off-by: Youngjun Cho >>>>>> --- >>>>>>drivers/gpu/drm/exynos/Kconfig |7 + >>>>>>drivers/gpu/drm/exynos/Makefile |1 + >>>>>>drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >>>>>>drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >>>>>>drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 >>>>>> +++ >>>>>>drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + >>>>>>drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ >>>>>>7 files changed, 939 insertions(+), 0 deletions(-) >>>>>>create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c >>>>>>create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h >>>>>>create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h >>>>>> >>>>>> diff --git a/drivers/gpu/drm/exynos/Kconfig >>>>>> b/drivers/gpu/drm/exynos/Kconfig >>>>>> index 4915ab6..4860835 100644 >>>>>> --- a/drivers/gpu/drm/exynos/Kconfig >>>>>> +++ b/drivers/gpu/drm/exynos/Kconfig >>>>>> @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC >>>>>> depends on DRM_EXYNOS_IPP >>>>>> help >>>>>>Choose this option if you want to use Exynos FIMC for DRM. >>>>>> + >>>>>> +co
[RFC v3 4/5] drm/exynos: add rotator ipp driver
Thank's your comment. I answer your comment. please check that. Thank's BR Eunchul Kim On 12/12/2012 05:29 PM, Inki Dae wrote: > > >> -Original Message----- >> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >> Sent: Wednesday, December 12, 2012 4:35 PM >> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; jmock.shin at >> samsung.com; >> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >> chulspro.kim at samsung.com >> Subject: [RFC v3 4/5] drm/exynos: add rotator ipp driver >> >> Rotator supports rotation/crop/flip and input/output DMA operations >> Rotator ipp driver supports 90,180,270 degree rotaion and vertical, >> horizontal flip. >> and has some limitations(source and destination format have to be same, no >> scaler) >> >> Signed-off-by: Eunchul Kim >> Signed-off-by: Youngjun Cho >> --- >> drivers/gpu/drm/exynos/Kconfig |7 + >> drivers/gpu/drm/exynos/Makefile |1 + >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >> drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >> drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 >> +++ >> drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + >> drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ >> 7 files changed, 939 insertions(+), 0 deletions(-) >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h >> create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig >> b/drivers/gpu/drm/exynos/Kconfig >> index 4915ab6..4860835 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC >> depends on DRM_EXYNOS_IPP >> help >>Choose this option if you want to use Exynos FIMC for DRM. >> + >> +config DRM_EXYNOS_ROTATOR >> +bool "Exynos DRM Rotator" >> +depends on DRM_EXYNOS_IPP >> +help >> + Choose this option if you want to use Exynos Rotator for DRM. >> + >> diff --git a/drivers/gpu/drm/exynos/Makefile >> b/drivers/gpu/drm/exynos/Makefile >> index 9710024..3b70668 100644 >> --- a/drivers/gpu/drm/exynos/Makefile >> +++ b/drivers/gpu/drm/exynos/Makefile >> @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= >> exynos_drm_vidi.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o >> +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o >> >> obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> index 73f02ac..09d884b 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) >> goto out_fimc; >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_ROTATOR >> +ret = platform_driver_register(_driver); >> +if (ret < 0) >> +goto out_rotator; >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_IPP >> ret = platform_driver_register(_driver); >> if (ret < 0) >> @@ -406,6 +412,11 @@ out_drm: >> out_ipp: >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_ROTATOR >> +platform_driver_unregister(_driver); >> +out_rotator: >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_FIMC >> platform_driver_unregister(_driver); >> out_fimc: >> @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) >> platform_driver_unregister(_driver); >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_ROTATOR >> +platform_driver_unregister(_driver); >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_FIMC >> platform_driver_unregister(_driver); >> #endif >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h >> b/drivers/gpu/drm/exynos/exynos_drm_drv.h >> index 14f9490..a74e37c 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h >> @@ -353,5 +353,6 @@ extern struct platform_driver >> exynos_drm_common_hdmi_driver; >> extern struct platform_driver vidi_driver;
[RFC v3 1/5] drm/exynos: add ipp subsystem
Thank's your comment. I anwer your comment, please check that. Thank's BR Eunchul Kim. On 12/12/2012 05:18 PM, Inki Dae wrote: > > >> -Original Message----- >> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >> Sent: Wednesday, December 12, 2012 4:35 PM >> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; jmock.shin at >> samsung.com; >> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >> chulspro.kim at samsung.com >> Subject: [RFC v3 1/5] drm/exynos: add ipp subsystem >> >> IPP stand for Image Post Processing and supports image scaler/rotator >> /crop/flip/csc(color space conversion) and input/output DMA operations >> using ipp drivers. >> also supports writeback and display output operations. >> ipp driver include FIMC, Rotator, GSC, SC, so on. >> and ipp is integration device driver for each hardware. >> >> Signed-off-by: Eunchul Kim >> Signed-off-by: Jinyoung Jeon >> --- >> drivers/gpu/drm/exynos/Kconfig |6 + >> drivers/gpu/drm/exynos/Makefile |1 + >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 24 + >> drivers/gpu/drm/exynos/exynos_drm_drv.h |7 + >> drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2059 >> +++ >> drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 >> include/uapi/drm/exynos_drm.h | 190 +++ >> 7 files changed, 2553 insertions(+), 0 deletions(-) >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig >> b/drivers/gpu/drm/exynos/Kconfig >> index 4ea8cdc..bcf1c9d 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -45,3 +45,9 @@ config DRM_EXYNOS_G2D >> depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_G2D >> help >>Choose this option if you want to use Exynos G2D for DRM. >> + >> +config DRM_EXYNOS_IPP >> +bool "Exynos DRM IPP" >> +depends on DRM_EXYNOS >> +help >> + Choose this option if you want to use IPP feature for DRM. >> diff --git a/drivers/gpu/drm/exynos/Makefile >> b/drivers/gpu/drm/exynos/Makefile >> index 26813b8..6c536ce 100644 >> --- a/drivers/gpu/drm/exynos/Makefile >> +++ b/drivers/gpu/drm/exynos/Makefile >> @@ -16,5 +16,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= >> exynos_hdmi.o exynos_mixer.o \ >> exynos_drm_hdmi.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o >> +exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o >> >> obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> index 4a1168d..0eb8a97 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> @@ -40,6 +40,7 @@ >> #include "exynos_drm_vidi.h" >> #include "exynos_drm_dmabuf.h" >> #include "exynos_drm_g2d.h" >> +#include "exynos_drm_ipp.h" >> #include "exynos_drm_iommu.h" >> >> #define DRIVER_NAME"exynos" >> @@ -249,6 +250,14 @@ static struct drm_ioctl_desc exynos_ioctls[] = { >> exynos_g2d_set_cmdlist_ioctl, DRM_UNLOCKED | > DRM_AUTH), >> DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, >> exynos_g2d_exec_ioctl, DRM_UNLOCKED | DRM_AUTH), >> +DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_PROPERTY, >> +exynos_drm_ipp_get_property, DRM_UNLOCKED | > DRM_AUTH), >> +DRM_IOCTL_DEF_DRV(EXYNOS_IPP_SET_PROPERTY, >> +exynos_drm_ipp_set_property, DRM_UNLOCKED | > DRM_AUTH), >> +DRM_IOCTL_DEF_DRV(EXYNOS_IPP_QUEUE_BUF, >> +exynos_drm_ipp_queue_buf, DRM_UNLOCKED | DRM_AUTH), >> +DRM_IOCTL_DEF_DRV(EXYNOS_IPP_CMD_CTRL, >> +exynos_drm_ipp_cmd_ctrl, DRM_UNLOCKED | DRM_AUTH), >> }; >> >> static const struct file_operations exynos_drm_driver_fops = { >> @@ -363,6 +372,12 @@ static int __init exynos_drm_init(void) >> goto out_g2d; >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_IPP >> +ret = platform_driver_register(_driver); >> +if (ret < 0) >> +goto out_
[RFC v3 5/5] drm/exynos: add gsc ipp driver
GSC is stand for General SCaler and supports supports image scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA reads image data from the memory. output DMA writes image data to memory. GSC supports image rotation and imag effect functions. also supports writeback and display output operations. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |5 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1927 +++ drivers/gpu/drm/exynos/exynos_drm_gsc.h | 34 + drivers/gpu/drm/exynos/regs-gsc.h | 295 + 7 files changed, 2278 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4860835..c93d776 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -64,3 +64,8 @@ config DRM_EXYNOS_ROTATOR help Choose this option if you want to use Exynos Rotator for DRM. +config DRM_EXYNOS_GSC + bool "Exynos DRM GSC" + depends on DRM_EXYNOS_IPP && ARCH_EXYNOS5 + help + Choose this option if you want to use Exynos GSC for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 3b70668..639b49e 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -19,5 +19,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o +exynosdrm-$(CONFIG_DRM_EXYNOS_GSC) += exynos_drm_gsc.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 09d884b..e0a8e80 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -384,6 +384,12 @@ static int __init exynos_drm_init(void) goto out_rotator; #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_gsc; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -412,6 +418,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + platform_driver_unregister(_driver); +out_gsc: +#endif + #ifdef CONFIG_DRM_EXYNOS_ROTATOR platform_driver_unregister(_driver); out_rotator: @@ -462,6 +473,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_GSC + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_ROTATOR platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a74e37c..afe556c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -354,5 +354,6 @@ extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; extern struct platform_driver rotator_driver; +extern struct platform_driver gsc_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c new file mode 100644 index 000..a4475b0 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -0,0 +1,1927 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * Jinyoung Jeon + * Sangmin Lee + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-gsc.h" +#include "exynos_drm_ipp.h" +#include "exynos_drm_gsc.h" + +/* + * GSC is stand for General SCaler and + * supports image scaler/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * GSC supports image rotation and image effect functions. + */ + +#define GSC_MAX_DEVS 4 +#define GSC_MAX_SRC4 +#define GSC_MAX_DST16 +#define GSC_RESET_TIMEOUT 50 +#define GSC_BUF_STOP 1 +#define GSC_BUF_START 2 +#define GSC_REG_SZ 16 +#define GS
[RFC v3 4/5] drm/exynos: add rotator ipp driver
Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim Signed-off-by: Youngjun Cho --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 939 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool "Exynos DRM Rotator" + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..121569c --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -0,0 +1,829 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * YoungJun Cho + * Eunchul Kim + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-rotator.h" +#include "exynos_drm.h" +#include "exynos_drm_ipp.h" + +/* + * Rotator supports image crop/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + */ + +#define get_rot_context(dev) platform_get_drvdata(to_platform_device(dev)) +#define get_ctx_from_ippdrv(ippdrv)container_of(ippdrv,\ + struct rot_context, ippdrv); +#define rot_read(offset) readl(rot->regs + (offset)) +#define rot_write(cfg, offset) writel(cfg, rot->regs + (offset)) + +enum
[RFC v3 3/5] drm/exynos: add fimc ipp driver
FIMC is stand for Fully Interfactive Mobile Camera and supports image scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA reads image data from the memory. output DMA writes image data to memory. FIMC supports image rotation and image effect functions. also supports writeback and display output operations. Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/Kconfig |6 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2022 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h | 34 + drivers/gpu/drm/exynos/regs-fimc.h | 669 ++ include/drm/exynos_drm.h | 26 + 8 files changed, 2774 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index bcf1c9d..4915ab6 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -51,3 +51,9 @@ config DRM_EXYNOS_IPP depends on DRM_EXYNOS help Choose this option if you want to use IPP feature for DRM. + +config DRM_EXYNOS_FIMC + bool "Exynos DRM FIMC" + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos FIMC for DRM. diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 6c536ce..9710024 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -17,5 +17,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o +exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 0eb8a97..73f02ac 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -372,6 +372,12 @@ static int __init exynos_drm_init(void) goto out_g2d; #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + ret = platform_driver_register(_driver); + if (ret < 0) + goto out_fimc; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(_driver); if (ret < 0) @@ -400,6 +406,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + platform_driver_unregister(_driver); +out_fimc: +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); out_g2d: @@ -440,6 +451,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_FIMC + platform_driver_unregister(_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_G2D platform_driver_unregister(_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a365788..14f9490 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -352,5 +352,6 @@ extern struct platform_driver mixer_driver; extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; +extern struct platform_driver fimc_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c new file mode 100644 index 000..077f6a6 --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -0,0 +1,2022 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * Eunchul Kim + * Jinyoung Jeon + * Sangmin Lee + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include "regs-fimc.h" +#include "exynos_drm_ipp.h" +#include "exynos_drm_fimc.h" + +/* + * FIMC is stand for Fully Interactive Mobile Camera and + * supports image scaler/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + * FIMC supports image rotation and image effect functions. + */ + +#define FIMC_MAX_DEVS 4 +#define FIMC_MAX_SRC 2 +#define FIMC_MAX_DST 32 +#define FIMC_SHFACTOR 10 +#d
[RFC v3 2/5] drm/exynos: add iommu support for ipp
This patch adds iommu support for ipp. For this, it adds subdrv_probe/remove callback to enable or disable ipp iommu. we can get or put device address to a gem handle from user through exynos_drm_gem_get/put_dma_addr(). Signed-off-by: Eunchul Kim Signed-off-by: Jinyoung Jeon --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index eb12cb5..cb2165a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -23,6 +23,7 @@ #include "exynos_drm_drv.h" #include "exynos_drm_gem.h" #include "exynos_drm_ipp.h" +#include "exynos_drm_iommu.h" /* * IPP is stand for Image Post Processing and @@ -1783,10 +1784,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ippdrv->event_workq = ctx->event_workq; ippdrv->sched_event = ipp_sched_event; INIT_LIST_HEAD(>cmd_list); + + if (is_drm_iommu_supported(drm_dev)) { + ret = drm_iommu_attach_device(drm_dev, ippdrv->dev); + if (ret) { + DRM_ERROR("failed to activate iommu\n"); + goto err_iommu; + } + } } return 0; +err_iommu: + /* get ipp driver entry */ + list_for_each_entry_reverse(ippdrv, _drm_ippdrv_list, drv_list) + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv->dev); + err_idr: idr_remove_all(>ipp_idr); idr_remove_all(>prop_idr); @@ -1803,6 +1818,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) /* get ipp driver entry */ list_for_each_entry(ippdrv, _drm_ippdrv_list, drv_list) { + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv->dev); + ippdrv->drm_dev = NULL; exynos_drm_ippdrv_unregister(ippdrv); } -- 1.7.0.4
[RFC v3 0/5] drm/exynos: add ipp subsystem and each ipp drivers
eue_buf(fd, [i], EXYNOS_DRM_OPS_SRC, IPP_BUF_ENQUEUE, property.prop_id, i, gem1[i].handle); if (ret) { fprintf(stderr, "failed to ipp buf src map\n"); goto err_ipp_ctrl_close; } } for (i = 0; i < MAX_BUF; i++) { /* For destination buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_DST, IPP_BUF_ENQUEUE, property.prop_id, i, gem2[i].handle); if (ret) { fprintf(stderr, "failed to ipp buf dst map\n"); goto err_ipp_ctrl_close; } } /* Start */ gettimeofday(, NULL); ret = exynos_drm_ipp_cmd_ctrl(fd, _ctrl, property.prop_id, IPP_CTRL_PLAY); if (ret) { fprintf(stderr, "failed to ipp ctrl IPP_CMD_M2M start\n"); goto err_ipp_ctrl_close; } j=0; while (1) { struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 }; fd_set fds; FD_ZERO(); FD_SET(0, ); FD_SET(fd, ); ret = select(fd + 1, , NULL, NULL, ); if (ret <= 0) { fprintf(stderr, "select timed out or error.\n"); continue; } else if (FD_ISSET(0, )) { break; } gettimeofday(, NULL); usec[j] = (end.tv_sec - begin.tv_sec) * 100 + (end.tv_usec - begin.tv_usec); if(ipp_event_handler() < 0) break; if (++j > MAX_LOOP) break; gettimeofday(, NULL); } err_ipp_ctrl_close: /* For source buffer dequeue to IPP */ for (i = 0; i < MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_SRC, IPP_BUF_DEQUEUE, property.prop_id, i, gem1[i].handle); if (ret < 0) fprintf(stderr, "failed to ipp buf dst dequeue\n"); } /* For destination buffer dequeue to IPP */ for (i = 0; i < MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, [i], EXYNOS_DRM_OPS_DST, IPP_BUF_DEQUEUE, property.prop_id, i, gem2[i].handle); if (ret < 0) fprintf(stderr, "failed to ipp buf dst dequeue\n"); } /* Stop */ ret = exynos_drm_ipp_cmd_ctrl(fd, _ctrl, property.prop_id, IPP_CTRL_STOP); if (ret) fprintf(stderr, "failed to ipp ctrl IPP_CMD_WB stop\n"); return; } Eunchul Kim (5): drm/exynos: add ipp subsystem drm/exynos: add iommu support for ipp drm/exynos: add fimc ipp driver drm/exynos: add rotator ipp driver drm/exynos: add gsc ipp driver drivers/gpu/drm/exynos/Kconfig | 24 + drivers/gpu/drm/exynos/Makefile |4 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 69 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 + drivers/gpu/drm/exynos/exynos_drm_fimc.c| 2022 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h| 34 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1927 + drivers/gpu/drm/exynos/exynos_drm_gsc.h | 34 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2077 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-fimc.h | 669 + drivers/gpu/drm/exynos/regs-gsc.h | 295 drivers/gpu/drm/exynos/regs-rotator.h | 73 + include/drm/exynos_drm.h| 26 + include/uapi/drm/exynos_drm.h | 190 +++ 17 files changed, 8562 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h
Re: [RFC v3 4/5] drm/exynos: add rotator ipp driver
Thank's your comment. I answer your comment. please check that. Thank's BR Eunchul Kim On 12/12/2012 05:29 PM, Inki Dae wrote: -Original Message- From: Eunchul Kim [mailto:chulspro@samsung.com] Sent: Wednesday, December 12, 2012 4:35 PM To: dri-devel@lists.freedesktop.org; inki@samsung.com Cc: jy0.j...@samsung.com; yj44@samsung.com; jmock.s...@samsung.com; jaejoon@samsung.com; kyungmin.p...@samsung.com; chulspro@samsung.com Subject: [RFC v3 4/5] drm/exynos: add rotator ipp driver Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim chulspro@samsung.com Signed-off-by: Youngjun Cho yj44@samsung.com --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 939 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool Exynos DRM Rotator + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP)+= exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC) += exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(rotator_driver); + if (ret 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(ipp_driver); if (ret 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(ipp_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..121569c --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -0,0 +1,829 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * YoungJun Cho yj44@samsung.com + * Eunchul Kim chulspro@samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/err.h +#include linux/interrupt.h +#include linux/io.h +#include linux
Re: [RFC v3 4/5] drm/exynos: add rotator ipp driver
Thank's for your comment. BR Eunchul Kim. On 12/12/2012 06:46 PM, Inki Dae wrote: One more comment. -Original Message- From: Eunchul Kim [mailto:chulspro@samsung.com] Sent: Wednesday, December 12, 2012 6:26 PM To: Inki Dae Cc: dri-devel@lists.freedesktop.org; jy0.j...@samsung.com; yj44@samsung.com; jmock.s...@samsung.com; jaejoon@samsung.com; kyungmin.p...@samsung.com; sw0312@samsung.com; Joonyoung Shim Subject: Re: [RFC v3 4/5] drm/exynos: add rotator ipp driver Thank's your comment. I answer your comment. please check that. Thank's BR Eunchul Kim On 12/12/2012 05:29 PM, Inki Dae wrote: -Original Message- From: Eunchul Kim [mailto:chulspro@samsung.com] Sent: Wednesday, December 12, 2012 4:35 PM To: dri-devel@lists.freedesktop.org; inki@samsung.com Cc: jy0.j...@samsung.com; yj44@samsung.com; jmock.s...@samsung.com; jaejoon@samsung.com; kyungmin.p...@samsung.com; chulspro@samsung.com Subject: [RFC v3 4/5] drm/exynos: add rotator ipp driver Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim chulspro@samsung.com Signed-off-by: Youngjun Cho yj44@samsung.com --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 829 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 939 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool Exynos DRM Rotator + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC) += exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(rotator_driver); + if (ret 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(ipp_driver); if (ret 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(ipp_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..121569c --- /dev/null +++ b/drivers/gpu/drm/exynos
[RFC v4 0/5] drm/exynos: add ipp subsystem and each ipp drivers
, IPP_BUF_ENQUEUE, property.prop_id, i, gem1[i].handle); if (ret) { fprintf(stderr, failed to ipp buf src map\n); goto err_ipp_ctrl_close; } } for (i = 0; i MAX_BUF; i++) { /* For destination buffer map to IPP */ ret = exynos_drm_ipp_queue_buf(fd, qbuf2[i], EXYNOS_DRM_OPS_DST, IPP_BUF_ENQUEUE, property.prop_id, i, gem2[i].handle); if (ret) { fprintf(stderr, failed to ipp buf dst map\n); goto err_ipp_ctrl_close; } } /* Start */ gettimeofday(begin, NULL); ret = exynos_drm_ipp_cmd_ctrl(fd, cmd_ctrl, property.prop_id, IPP_CTRL_PLAY); if (ret) { fprintf(stderr, failed to ipp ctrl IPP_CMD_M2M start\n); goto err_ipp_ctrl_close; } j=0; while (1) { struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 }; fd_set fds; FD_ZERO(fds); FD_SET(0, fds); FD_SET(fd, fds); ret = select(fd + 1, fds, NULL, NULL, timeout); if (ret = 0) { fprintf(stderr, select timed out or error.\n); continue; } else if (FD_ISSET(0, fds)) { break; } gettimeofday(end, NULL); usec[j] = (end.tv_sec - begin.tv_sec) * 100 + (end.tv_usec - begin.tv_usec); if(ipp_event_handler() 0) break; if (++j MAX_LOOP) break; gettimeofday(begin, NULL); } err_ipp_ctrl_close: /* For source buffer dequeue to IPP */ for (i = 0; i MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, qbuf1[i], EXYNOS_DRM_OPS_SRC, IPP_BUF_DEQUEUE, property.prop_id, i, gem1[i].handle); if (ret 0) fprintf(stderr, failed to ipp buf dst dequeue\n); } /* For destination buffer dequeue to IPP */ for (i = 0; i MAX_BUF; i++) { ret = exynos_drm_ipp_queue_buf(fd, qbuf2[i], EXYNOS_DRM_OPS_DST, IPP_BUF_DEQUEUE, property.prop_id, i, gem2[i].handle); if (ret 0) fprintf(stderr, failed to ipp buf dst dequeue\n); } /* Stop */ ret = exynos_drm_ipp_cmd_ctrl(fd, cmd_ctrl, property.prop_id, IPP_CTRL_STOP); if (ret) fprintf(stderr, failed to ipp ctrl IPP_CMD_WB stop\n); return; } Eunchul Kim (5): drm/exynos: add ipp subsystem drm/exynos: add iommu support for ipp drm/exynos: add fimc ipp driver drm/exynos: add rotator ipp driver drm/exynos: add gsc ipp driver drivers/gpu/drm/exynos/Kconfig | 24 + drivers/gpu/drm/exynos/Makefile |4 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 69 + drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 + drivers/gpu/drm/exynos/exynos_drm_fimc.c| 2017 ++ drivers/gpu/drm/exynos/exynos_drm_fimc.h| 34 + drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1897 drivers/gpu/drm/exynos/exynos_drm_gsc.h | 34 + drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2059 +++ drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 drivers/gpu/drm/exynos/exynos_drm_rotator.c | 871 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-fimc.h | 669 + drivers/gpu/drm/exynos/regs-gsc.h | 295 drivers/gpu/drm/exynos/regs-rotator.h | 73 + include/drm/exynos_drm.h| 26 + include/uapi/drm/exynos_drm.h | 190 +++ 17 files changed, 8551 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[RFC v4 2/5] drm/exynos: add iommu support for ipp
This patch adds iommu support for ipp. For this, it adds subdrv_probe/remove callback to enable or disable ipp iommu. we can get or put device address to a gem handle from user through exynos_drm_gem_get/put_dma_addr(). Signed-off-by: Eunchul Kim chulspro@samsung.com Signed-off-by: Jinyoung Jeon jy0.j...@samsung.com --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index f95b407..e4b42cd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -24,6 +24,7 @@ #include exynos_drm_drv.h #include exynos_drm_gem.h #include exynos_drm_ipp.h +#include exynos_drm_iommu.h /* * IPP is stand for Image Post Processing and @@ -1765,10 +1766,24 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ippdrv-event_workq = ctx-event_workq; ippdrv-sched_event = ipp_sched_event; INIT_LIST_HEAD(ippdrv-cmd_list); + + if (is_drm_iommu_supported(drm_dev)) { + ret = drm_iommu_attach_device(drm_dev, ippdrv-dev); + if (ret) { + DRM_ERROR(failed to activate iommu\n); + goto err_iommu; + } + } } return 0; +err_iommu: + /* get ipp driver entry */ + list_for_each_entry_reverse(ippdrv, exynos_drm_ippdrv_list, drv_list) + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv-dev); + err_idr: idr_remove_all(ctx-ipp_idr); idr_remove_all(ctx-prop_idr); @@ -1785,6 +1800,9 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev) /* get ipp driver entry */ list_for_each_entry(ippdrv, exynos_drm_ippdrv_list, drv_list) { + if (is_drm_iommu_supported(drm_dev)) + drm_iommu_detach_device(drm_dev, ippdrv-dev); + ippdrv-drm_dev = NULL; exynos_drm_ippdrv_unregister(ippdrv); } -- 1.7.0.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[RFC v4 4/5] drm/exynos: add rotator ipp driver
Rotator supports rotation/crop/flip and input/output DMA operations Rotator ipp driver supports 90,180,270 degree rotaion and vertical, horizontal flip. and has some limitations(source and destination format have to be same, no scaler) Signed-off-by: Eunchul Kim chulspro@samsung.com Signed-off-by: Youngjun Cho yj44@samsung.com --- drivers/gpu/drm/exynos/Kconfig |7 + drivers/gpu/drm/exynos/Makefile |1 + drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + drivers/gpu/drm/exynos/exynos_drm_rotator.c | 871 +++ drivers/gpu/drm/exynos/exynos_drm_rotator.h | 13 + drivers/gpu/drm/exynos/regs-rotator.h | 73 +++ 7 files changed, 981 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.c create mode 100644 drivers/gpu/drm/exynos/exynos_drm_rotator.h create mode 100644 drivers/gpu/drm/exynos/regs-rotator.h diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 4915ab6..4860835 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig @@ -57,3 +57,10 @@ config DRM_EXYNOS_FIMC depends on DRM_EXYNOS_IPP help Choose this option if you want to use Exynos FIMC for DRM. + +config DRM_EXYNOS_ROTATOR + bool Exynos DRM Rotator + depends on DRM_EXYNOS_IPP + help + Choose this option if you want to use Exynos Rotator for DRM. + diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile index 9710024..3b70668 100644 --- a/drivers/gpu/drm/exynos/Makefile +++ b/drivers/gpu/drm/exynos/Makefile @@ -18,5 +18,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o +exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR) += exynos_drm_rotator.o obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 73f02ac..09d884b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -378,6 +378,12 @@ static int __init exynos_drm_init(void) goto out_fimc; #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + ret = platform_driver_register(rotator_driver); + if (ret 0) + goto out_rotator; +#endif + #ifdef CONFIG_DRM_EXYNOS_IPP ret = platform_driver_register(ipp_driver); if (ret 0) @@ -406,6 +412,11 @@ out_drm: out_ipp: #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +out_rotator: +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); out_fimc: @@ -451,6 +462,10 @@ static void __exit exynos_drm_exit(void) platform_driver_unregister(ipp_driver); #endif +#ifdef CONFIG_DRM_EXYNOS_ROTATOR + platform_driver_unregister(rotator_driver); +#endif + #ifdef CONFIG_DRM_EXYNOS_FIMC platform_driver_unregister(fimc_driver); #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 14f9490..a74e37c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -353,5 +353,6 @@ extern struct platform_driver exynos_drm_common_hdmi_driver; extern struct platform_driver vidi_driver; extern struct platform_driver g2d_driver; extern struct platform_driver fimc_driver; +extern struct platform_driver rotator_driver; extern struct platform_driver ipp_driver; #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c new file mode 100644 index 000..937f98f --- /dev/null +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -0,0 +1,871 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Authors: + * YoungJun Cho yj44@samsung.com + * Eunchul Kim chulspro@samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundationr + */ + +#include linux/kernel.h +#include linux/module.h +#include linux/err.h +#include linux/interrupt.h +#include linux/io.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/pm_runtime.h + +#include drm/drmP.h +#include drm/exynos_drm.h +#include regs-rotator.h +#include exynos_drm.h +#include exynos_drm_ipp.h + +/* + * Rotator supports image crop/rotator and input/output DMA operations. + * input DMA reads image data from the memory. + * output DMA writes image data to memory. + */ + +#define get_rot_context(dev) platform_get_drvdata(to_platform_device(dev)) +#define get_ctx_from_ippdrv(ippdrv)container_of(ippdrv
[RFC v2 5/5] drm/exynos: add gsc ipp driver
OK, I know what you mean. I talk about GSC feature with Inki.Dae. I will re-send our final source instead of first commit. please one more time review about next RFC v3. Thank's BR Eunchul Kim On 12/11/2012 05:31 PM, Joonyoung Shim wrote: > Hi, > > I want to see only just current codes, not for future. > > > On 12/11/2012 04:47 PM, Eunchul Kim wrote: >> Thank's your comments >> >> I answer your comments. please check that. >> >> Thank's >> >> BR >> >> Eunchul Kim >> >> On 12/11/2012 02:49 PM, Joonyoung Shim wrote: >>> Hi, >>> >>> On 12/10/2012 10:45 PM, Eunchul Kim wrote: >>>> GSC is stand for General SCaler and supports supports >>>> image scaler/rotator/crop/flip/csc and input/output DMA operations. >>>> input DMA reads image data from the memory. >>>> output DMA writes image data to memory. >>>> GSC supports image rotation and imag effect functions, also supports >>>> writeback and display output operations. >>>> >>> >>> Please align lines in paragraph. >> >> - like this ? "GSC supports image rotation and imag effect functions, >> also supports writeback and display output operations." >> > > You can get follow result if you use vi when you make commit using "git > commit -s" > > GSC is stand for General SCaler and supports supports image > scaler/rotator/crop/flip/csc and input/output DMA operations. input DMA > reads image data from the memory. output DMA writes image data to > memory. GSC supports image rotation and imag effect functions, also > supports writeback and display output operations. - I will check that. > >>> >>>> >>>> Signed-off-by: Eunchul Kim >>>> Signed-off-by: Jinyoung Jeon >>>> --- >>>> drivers/gpu/drm/exynos/Kconfig |5 + >>>> drivers/gpu/drm/exynos/Makefile |1 + >>>> drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >>>> drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >>>> drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1476 >>>> +++ >>>> drivers/gpu/drm/exynos/exynos_drm_gsc.h | 35 + >>>> drivers/gpu/drm/exynos/regs-gsc.h | 295 ++ >>>> include/drm/exynos_drm.h| 15 + >>>> 8 files changed, 1843 insertions(+), 0 deletions(-) >>>> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c >>>> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h >>>> create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h >>>> >>>> diff --git a/drivers/gpu/drm/exynos/Kconfig >>>> b/drivers/gpu/drm/exynos/Kconfig >>>> index 4860835..c93d776 100644 >>>> --- a/drivers/gpu/drm/exynos/Kconfig >>>> +++ b/drivers/gpu/drm/exynos/Kconfig >>>> @@ -64,3 +64,8 @@ config DRM_EXYNOS_ROTATOR >>>> help >>>> Choose this option if you want to use Exynos Rotator for DRM. >>>> +config DRM_EXYNOS_GSC >>>> +bool "Exynos DRM GSC" >>>> +depends on DRM_EXYNOS_IPP && ARCH_EXYNOS5 >>>> +help >>>> + Choose this option if you want to use Exynos GSC for DRM. >>>> diff --git a/drivers/gpu/drm/exynos/Makefile >>>> b/drivers/gpu/drm/exynos/Makefile >>>> index 3b70668..639b49e 100644 >>>> --- a/drivers/gpu/drm/exynos/Makefile >>>> +++ b/drivers/gpu/drm/exynos/Makefile >>>> @@ -19,5 +19,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= >>>> exynos_drm_g2d.o >>>> exynosdrm-$(CONFIG_DRM_EXYNOS_IPP)+= exynos_drm_ipp.o >>>> exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o >>>> exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)+= exynos_drm_rotator.o >>>> +exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)+= exynos_drm_gsc.o >>>> obj-$(CONFIG_DRM_EXYNOS)+= exynosdrm.o >>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> index 09d884b..e0a8e80 100644 >>>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> @@ -384,6 +384,12 @@ static int __init exynos_drm_init(void) >>>> goto out_rotator; >>>> #endif >>>> +#ifdef CONFIG_DRM_EXYNOS_GSC >>>> +ret = platform_driver_register(_driver); >>>> +if (ret < 0) >>>> +
[RFC v2 1/5] drm/exynos: add ipp subsystem
Thank's for comments. I answer your comment, please check that. Thank's BR Eunchul Kim. On 12/11/2012 04:17 PM, Inki Dae wrote: > > >> -Original Message----- >> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >> Sent: Tuesday, December 11, 2012 2:55 PM >> To: Inki Dae >> Cc: dri-devel at lists.freedesktop.org; jy0.jeon at samsung.com; >> yj44.cho at samsung.com; jmock.shin at samsung.com; jaejoon.seo at >> samsung.com; >> kyungmin.park at samsung.com >> Subject: Re: [RFC v2 1/5] drm/exynos: add ipp subsystem >> >> Thank's your comments. >> >> I answer your requestion. please check that. >> >> Thank's >> >> BR >> Eunchul Kim >> >> On 12/11/2012 01:37 PM, Inki Dae wrote: >>> >>> >>>> -Original Message- >>>> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >>>> Sent: Monday, December 10, 2012 10:46 PM >>>> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >>>> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; jmock.shin at >>>> samsung.com; >>>> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >>>> chulspro.kim at samsung.com >>>> Subject: [RFC v2 1/5] drm/exynos: add ipp subsystem >>>> >>>> IPP stand for Image Post Processing and supports image scaler/rotator >>>> /crop/flip/csc(color space conversion) and input/output DMA operations >>>> using ipp drivers. >>>> also supports writeback and display output operations. >>>> ipp driver include FIMC, Rotator, GSC, SC, so on. >>>> and ipp is integration device driver for each hardware. >>>> >>>> Signed-off-by: Eunchul Kim >>>> Signed-off-by: Jinyoung Jeon >>>> --- >>>>drivers/gpu/drm/exynos/Kconfig |6 + >>>>drivers/gpu/drm/exynos/Makefile |1 + >>>>drivers/gpu/drm/exynos/exynos_drm_drv.c | 24 + >>>>drivers/gpu/drm/exynos/exynos_drm_drv.h |7 + >>>>drivers/gpu/drm/exynos/exynos_drm_ipp.c | 1944 >>>> +++ >>>>drivers/gpu/drm/exynos/exynos_drm_ipp.h | 266 + >>>>include/uapi/drm/exynos_drm.h | 189 +++ >>>>7 files changed, 2437 insertions(+), 0 deletions(-) >>>>create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.c >>>>create mode 100644 drivers/gpu/drm/exynos/exynos_drm_ipp.h >>>> >>>> diff --git a/drivers/gpu/drm/exynos/Kconfig >>>> b/drivers/gpu/drm/exynos/Kconfig >>>> index 4ea8cdc..bcf1c9d 100644 >>>> --- a/drivers/gpu/drm/exynos/Kconfig >>>> +++ b/drivers/gpu/drm/exynos/Kconfig >>>> @@ -45,3 +45,9 @@ config DRM_EXYNOS_G2D >>>>depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_G2D >>>>help >>>> Choose this option if you want to use Exynos G2D for DRM. >>>> + >>>> +config DRM_EXYNOS_IPP >>>> + bool "Exynos DRM IPP" >>>> + depends on DRM_EXYNOS >>>> + help >>>> +Choose this option if you want to use IPP feature for DRM. >>>> diff --git a/drivers/gpu/drm/exynos/Makefile >>>> b/drivers/gpu/drm/exynos/Makefile >>>> index 26813b8..6c536ce 100644 >>>> --- a/drivers/gpu/drm/exynos/Makefile >>>> +++ b/drivers/gpu/drm/exynos/Makefile >>>> @@ -16,5 +16,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += >>>> exynos_hdmi.o exynos_mixer.o \ >>>> exynos_drm_hdmi.o >>>>exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI) += exynos_drm_vidi.o >>>>exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o >>>> +exynosdrm-$(CONFIG_DRM_EXYNOS_IPP)+= exynos_drm_ipp.o >>>> >>>>obj-$(CONFIG_DRM_EXYNOS)+= exynosdrm.o >>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> index 4a1168d..0eb8a97 100644 >>>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >>>> @@ -40,6 +40,7 @@ >>>>#include "exynos_drm_vidi.h" >>>>#include "exynos_drm_dmabuf.h" >>>>#include "exynos_drm_g2d.h" >>>> +#include "exynos_drm_ipp.h" >>>>#include "exynos_drm_iommu.h"
[RFC v2 5/5] drm/exynos: add gsc ipp driver
Thank's your comments I answer your comments. please check that. Thank's BR Eunchul Kim On 12/11/2012 02:49 PM, Joonyoung Shim wrote: > Hi, > > On 12/10/2012 10:45 PM, Eunchul Kim wrote: >> GSC is stand for General SCaler and supports supports >> image scaler/rotator/crop/flip/csc and input/output DMA operations. >> input DMA reads image data from the memory. >> output DMA writes image data to memory. >> GSC supports image rotation and imag effect functions, also supports >> writeback and display output operations. >> > > Please align lines in paragraph. - like this ? "GSC supports image rotation and imag effect functions, also supports writeback and display output operations." > >> >> Signed-off-by: Eunchul Kim >> Signed-off-by: Jinyoung Jeon >> --- >> drivers/gpu/drm/exynos/Kconfig |5 + >> drivers/gpu/drm/exynos/Makefile |1 + >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >> drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >> drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1476 >> +++ >> drivers/gpu/drm/exynos/exynos_drm_gsc.h | 35 + >> drivers/gpu/drm/exynos/regs-gsc.h | 295 ++ >> include/drm/exynos_drm.h| 15 + >> 8 files changed, 1843 insertions(+), 0 deletions(-) >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.c >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_gsc.h >> create mode 100644 drivers/gpu/drm/exynos/regs-gsc.h >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig >> b/drivers/gpu/drm/exynos/Kconfig >> index 4860835..c93d776 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -64,3 +64,8 @@ config DRM_EXYNOS_ROTATOR >> help >> Choose this option if you want to use Exynos Rotator for DRM. >> +config DRM_EXYNOS_GSC >> +bool "Exynos DRM GSC" >> +depends on DRM_EXYNOS_IPP && ARCH_EXYNOS5 >> +help >> + Choose this option if you want to use Exynos GSC for DRM. >> diff --git a/drivers/gpu/drm/exynos/Makefile >> b/drivers/gpu/drm/exynos/Makefile >> index 3b70668..639b49e 100644 >> --- a/drivers/gpu/drm/exynos/Makefile >> +++ b/drivers/gpu/drm/exynos/Makefile >> @@ -19,5 +19,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)+= >> exynos_drm_g2d.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_IPP)+= exynos_drm_ipp.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC)+= exynos_drm_fimc.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_ROTATOR)+= exynos_drm_rotator.o >> +exynosdrm-$(CONFIG_DRM_EXYNOS_GSC)+= exynos_drm_gsc.o >> obj-$(CONFIG_DRM_EXYNOS)+= exynosdrm.o >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> index 09d884b..e0a8e80 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> @@ -384,6 +384,12 @@ static int __init exynos_drm_init(void) >> goto out_rotator; >> #endif >> +#ifdef CONFIG_DRM_EXYNOS_GSC >> +ret = platform_driver_register(_driver); >> +if (ret < 0) >> +goto out_gsc; >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_IPP >> ret = platform_driver_register(_driver); >> if (ret < 0) >> @@ -412,6 +418,11 @@ out_drm: >> out_ipp: >> #endif >> +#ifdef CONFIG_DRM_EXYNOS_GSC >> +platform_driver_unregister(_driver); >> +out_gsc: >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_ROTATOR >> platform_driver_unregister(_driver); >> out_rotator: >> @@ -462,6 +473,10 @@ static void __exit exynos_drm_exit(void) >> platform_driver_unregister(_driver); >> #endif >> +#ifdef CONFIG_DRM_EXYNOS_GSC >> +platform_driver_unregister(_driver); >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_ROTATOR >> platform_driver_unregister(_driver); >> #endif >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h >> b/drivers/gpu/drm/exynos/exynos_drm_drv.h >> index a74e37c..afe556c 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h >> @@ -354,5 +354,6 @@ extern struct platform_driver vidi_driver; >> extern struct platform_driver g2d_driver; >> extern struct platform_driver fimc_driver; >> extern struct platform_driver rotator_driver; >> +extern struct platform_driver gsc_driver; >> extern struct platform_driver ipp_driver; >> #endif >> diff --git a/
[RFC v2 3/5] drm/exynos: add fimc ipp driver
Thank's your comments. I answer your comments. please check that. Thank's BR Eunchul Kim On 12/11/2012 02:16 PM, Inki Dae wrote: > > >> -Original Message----- >> From: Eunchul Kim [mailto:chulspro.kim at samsung.com] >> Sent: Monday, December 10, 2012 10:46 PM >> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com >> Cc: jy0.jeon at samsung.com; yj44.cho at samsung.com; jmock.shin at >> samsung.com; >> jaejoon.seo at samsung.com; kyungmin.park at samsung.com; >> chulspro.kim at samsung.com >> Subject: [RFC v2 3/5] drm/exynos: add fimc ipp driver >> >> FIMC is stand for Fully Interfactive Mobile Camera and >> supports image scaler/rotator/crop/flip/csc and input/output DMA >> operations. >> input DMA reads image data from the memory. >> output DMA writes image data to memory. >> FIMC supports image rotation and image effect functions. >> also supports writeback and display output operations. >> >> Signed-off-by: Eunchul Kim >> Signed-off-by: Jinyoung Jeon >> --- >> drivers/gpu/drm/exynos/Kconfig |6 + >> drivers/gpu/drm/exynos/Makefile |1 + >> drivers/gpu/drm/exynos/exynos_drm_drv.c | 15 + >> drivers/gpu/drm/exynos/exynos_drm_drv.h |1 + >> drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2041 >> ++ >> drivers/gpu/drm/exynos/exynos_drm_fimc.h | 35 + >> drivers/gpu/drm/exynos/regs-fimc.h | 669 ++ >> include/drm/exynos_drm.h | 34 + >> 8 files changed, 2802 insertions(+), 0 deletions(-) >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.c >> create mode 100644 drivers/gpu/drm/exynos/exynos_drm_fimc.h >> create mode 100644 drivers/gpu/drm/exynos/regs-fimc.h >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig >> b/drivers/gpu/drm/exynos/Kconfig >> index bcf1c9d..4915ab6 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -51,3 +51,9 @@ config DRM_EXYNOS_IPP >> depends on DRM_EXYNOS >> help >>Choose this option if you want to use IPP feature for DRM. >> + >> +config DRM_EXYNOS_FIMC >> +bool "Exynos DRM FIMC" >> +depends on DRM_EXYNOS_IPP >> +help >> + Choose this option if you want to use Exynos FIMC for DRM. >> diff --git a/drivers/gpu/drm/exynos/Makefile >> b/drivers/gpu/drm/exynos/Makefile >> index 6c536ce..9710024 100644 >> --- a/drivers/gpu/drm/exynos/Makefile >> +++ b/drivers/gpu/drm/exynos/Makefile >> @@ -17,5 +17,6 @@ exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= >> exynos_hdmi.o exynos_mixer.o \ >> exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o >> exynosdrm-$(CONFIG_DRM_EXYNOS_IPP) += exynos_drm_ipp.o >> +exynosdrm-$(CONFIG_DRM_EXYNOS_FIMC) += exynos_drm_fimc.o >> >> obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> index 0eb8a97..73f02ac 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c >> @@ -372,6 +372,12 @@ static int __init exynos_drm_init(void) >> goto out_g2d; >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_FIMC >> +ret = platform_driver_register(_driver); >> +if (ret < 0) >> +goto out_fimc; >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_IPP >> ret = platform_driver_register(_driver); >> if (ret < 0) >> @@ -400,6 +406,11 @@ out_drm: >> out_ipp: >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_FIMC >> +platform_driver_unregister(_driver); >> +out_fimc: >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_G2D >> platform_driver_unregister(_driver); >> out_g2d: >> @@ -440,6 +451,10 @@ static void __exit exynos_drm_exit(void) >> platform_driver_unregister(_driver); >> #endif >> >> +#ifdef CONFIG_DRM_EXYNOS_FIMC >> +platform_driver_unregister(_driver); >> +#endif >> + >> #ifdef CONFIG_DRM_EXYNOS_G2D >> platform_driver_unregister(_driver); >> #endif >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h >> b/drivers/gpu/drm/exynos/exynos_drm_drv.h >> index a365788..14f9490 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h >> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h >> @@ -352,5 +352,6 @@ extern str