Commit 8201f1e8 authored by Dave Airlie's avatar Dave Airlie

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

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

   Just several fixups,
   - fix page fault and vblank timeout issues due to delayed vblank handling.
   - fix panel driver probing to fail without te-gpios property.
   - fix potential security hole by using "%pK" format.
   - fix wrong if statement condition.

   And one cleanup which removes Exynos4415 SoC support which is not supported
   anymore.

* 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos/dsi: make te-gpios optional
  drm/exynos: Print kernel pointers in a restricted form
  drm/exynos/decon5433: fix software trigger mask
  drm/exynos/fimd: signal frame done interrupt at front porch
  drm/exynos/decon5433: signal frame done interrupt at front porch
  drm/exynos/decon5433: fix vblank event handling
  drm/exynos: move crtc event handling to drivers callbacks
  drm/exynos: Remove support for Exynos4415 (SoC not supported anymore)
  drm/exynos/decon5433: & vs | typo
parents d08997cb 22e098da
...@@ -4,7 +4,6 @@ Required properties: ...@@ -4,7 +4,6 @@ Required properties:
- compatible: value should be one of the following - compatible: value should be one of the following
"samsung,exynos3250-mipi-dsi" /* for Exynos3250/3472 SoCs */ "samsung,exynos3250-mipi-dsi" /* for Exynos3250/3472 SoCs */
"samsung,exynos4210-mipi-dsi" /* for Exynos4 SoCs */ "samsung,exynos4210-mipi-dsi" /* for Exynos4 SoCs */
"samsung,exynos4415-mipi-dsi" /* for Exynos4415 SoC */
"samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */ "samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */
"samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */ "samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */
"samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */ "samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */
......
...@@ -11,7 +11,6 @@ Required properties: ...@@ -11,7 +11,6 @@ Required properties:
"samsung,s5pv210-fimd"; /* for S5PV210 SoC */ "samsung,s5pv210-fimd"; /* for S5PV210 SoC */
"samsung,exynos3250-fimd"; /* for Exynos3250/3472 SoCs */ "samsung,exynos3250-fimd"; /* for Exynos3250/3472 SoCs */
"samsung,exynos4210-fimd"; /* for Exynos4 SoCs */ "samsung,exynos4210-fimd"; /* for Exynos4 SoCs */
"samsung,exynos4415-fimd"; /* for Exynos4415 SoC */
"samsung,exynos5250-fimd"; /* for Exynos5250 SoCs */ "samsung,exynos5250-fimd"; /* for Exynos5250 SoCs */
"samsung,exynos5420-fimd"; /* for Exynos5420/5422/5800 SoCs */ "samsung,exynos5420-fimd"; /* for Exynos5420/5422/5800 SoCs */
......
...@@ -68,6 +68,8 @@ struct decon_context { ...@@ -68,6 +68,8 @@ struct decon_context {
unsigned long flags; unsigned long flags;
unsigned long out_type; unsigned long out_type;
int first_win; int first_win;
spinlock_t vblank_lock;
u32 frame_id;
}; };
static const uint32_t decon_formats[] = { static const uint32_t decon_formats[] = {
...@@ -103,7 +105,7 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc) ...@@ -103,7 +105,7 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc)
if (ctx->out_type & IFTYPE_I80) if (ctx->out_type & IFTYPE_I80)
val |= VIDINTCON0_FRAMEDONE; val |= VIDINTCON0_FRAMEDONE;
else else
val |= VIDINTCON0_INTFRMEN; val |= VIDINTCON0_INTFRMEN | VIDINTCON0_FRAMESEL_FP;
writel(val, ctx->addr + DECON_VIDINTCON0); writel(val, ctx->addr + DECON_VIDINTCON0);
} }
...@@ -122,14 +124,56 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc) ...@@ -122,14 +124,56 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc)
writel(0, ctx->addr + DECON_VIDINTCON0); writel(0, ctx->addr + DECON_VIDINTCON0);
} }
/* return number of starts/ends of frame transmissions since reset */
static u32 decon_get_frame_count(struct decon_context *ctx, bool end)
{
u32 frm, pfrm, status, cnt = 2;
/* To get consistent result repeat read until frame id is stable.
* Usually the loop will be executed once, in rare cases when the loop
* is executed at frame change time 2nd pass will be needed.
*/
frm = readl(ctx->addr + DECON_CRFMID);
do {
status = readl(ctx->addr + DECON_VIDCON1);
pfrm = frm;
frm = readl(ctx->addr + DECON_CRFMID);
} while (frm != pfrm && --cnt);
/* CRFMID is incremented on BPORCH in case of I80 and on VSYNC in case
* of RGB, it should be taken into account.
*/
if (!frm)
return 0;
switch (status & (VIDCON1_VSTATUS_MASK | VIDCON1_I80_ACTIVE)) {
case VIDCON1_VSTATUS_VS:
if (!(ctx->out_type & IFTYPE_I80))
--frm;
break;
case VIDCON1_VSTATUS_BP:
--frm;
break;
case VIDCON1_I80_ACTIVE:
case VIDCON1_VSTATUS_AC:
if (end)
--frm;
break;
default:
break;
}
return frm;
}
static void decon_setup_trigger(struct decon_context *ctx) static void decon_setup_trigger(struct decon_context *ctx)
{ {
if (!(ctx->out_type & (IFTYPE_I80 | I80_HW_TRG))) if (!(ctx->out_type & (IFTYPE_I80 | I80_HW_TRG)))
return; return;
if (!(ctx->out_type & I80_HW_TRG)) { if (!(ctx->out_type & I80_HW_TRG)) {
writel(TRIGCON_TE_AUTO_MASK | TRIGCON_SWTRIGEN writel(TRIGCON_TRIGEN_PER_F | TRIGCON_TRIGEN_F |
| TRIGCON_TE_AUTO_MASK | TRIGCON_SWTRIGEN, TRIGCON_TE_AUTO_MASK | TRIGCON_SWTRIGEN,
ctx->addr + DECON_TRIGCON); ctx->addr + DECON_TRIGCON);
return; return;
} }
...@@ -365,11 +409,14 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, ...@@ -365,11 +409,14 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc,
static void decon_atomic_flush(struct exynos_drm_crtc *crtc) static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
{ {
struct decon_context *ctx = crtc->ctx; struct decon_context *ctx = crtc->ctx;
unsigned long flags;
int i; int i;
if (test_bit(BIT_SUSPENDED, &ctx->flags)) if (test_bit(BIT_SUSPENDED, &ctx->flags))
return; return;
spin_lock_irqsave(&ctx->vblank_lock, flags);
for (i = ctx->first_win; i < WINDOWS_NR; i++) for (i = ctx->first_win; i < WINDOWS_NR; i++)
decon_shadow_protect_win(ctx, i, false); decon_shadow_protect_win(ctx, i, false);
...@@ -378,11 +425,18 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) ...@@ -378,11 +425,18 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
if (ctx->out_type & IFTYPE_I80) if (ctx->out_type & IFTYPE_I80)
set_bit(BIT_WIN_UPDATED, &ctx->flags); set_bit(BIT_WIN_UPDATED, &ctx->flags);
ctx->frame_id = decon_get_frame_count(ctx, true);
exynos_crtc_handle_event(crtc);
spin_unlock_irqrestore(&ctx->vblank_lock, flags);
} }
static void decon_swreset(struct decon_context *ctx) static void decon_swreset(struct decon_context *ctx)
{ {
unsigned int tries; unsigned int tries;
unsigned long flags;
writel(0, ctx->addr + DECON_VIDCON0); writel(0, ctx->addr + DECON_VIDCON0);
for (tries = 2000; tries; --tries) { for (tries = 2000; tries; --tries) {
...@@ -400,6 +454,10 @@ static void decon_swreset(struct decon_context *ctx) ...@@ -400,6 +454,10 @@ static void decon_swreset(struct decon_context *ctx)
WARN(tries == 0, "failed to software reset DECON\n"); WARN(tries == 0, "failed to software reset DECON\n");
spin_lock_irqsave(&ctx->vblank_lock, flags);
ctx->frame_id = 0;
spin_unlock_irqrestore(&ctx->vblank_lock, flags);
if (!(ctx->out_type & IFTYPE_HDMI)) if (!(ctx->out_type & IFTYPE_HDMI))
return; return;
...@@ -578,6 +636,24 @@ static const struct component_ops decon_component_ops = { ...@@ -578,6 +636,24 @@ static const struct component_ops decon_component_ops = {
.unbind = decon_unbind, .unbind = decon_unbind,
}; };
static void decon_handle_vblank(struct decon_context *ctx)
{
u32 frm;
spin_lock(&ctx->vblank_lock);
frm = decon_get_frame_count(ctx, true);
if (frm != ctx->frame_id) {
/* handle only if incremented, take care of wrap-around */
if ((s32)(frm - ctx->frame_id) > 0)
drm_crtc_handle_vblank(&ctx->crtc->base);
ctx->frame_id = frm;
}
spin_unlock(&ctx->vblank_lock);
}
static irqreturn_t decon_irq_handler(int irq, void *dev_id) static irqreturn_t decon_irq_handler(int irq, void *dev_id)
{ {
struct decon_context *ctx = dev_id; struct decon_context *ctx = dev_id;
...@@ -598,7 +674,7 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id) ...@@ -598,7 +674,7 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id)
(VIDOUT_INTERLACE_EN_F | VIDOUT_INTERLACE_FIELD_F)) (VIDOUT_INTERLACE_EN_F | VIDOUT_INTERLACE_FIELD_F))
return IRQ_HANDLED; return IRQ_HANDLED;
} }
drm_crtc_handle_vblank(&ctx->crtc->base); decon_handle_vblank(ctx);
} }
out: out:
...@@ -671,6 +747,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) ...@@ -671,6 +747,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
__set_bit(BIT_SUSPENDED, &ctx->flags); __set_bit(BIT_SUSPENDED, &ctx->flags);
ctx->dev = dev; ctx->dev = dev;
ctx->out_type = (unsigned long)of_device_get_match_data(dev); ctx->out_type = (unsigned long)of_device_get_match_data(dev);
spin_lock_init(&ctx->vblank_lock);
if (ctx->out_type & IFTYPE_HDMI) { if (ctx->out_type & IFTYPE_HDMI) {
ctx->first_win = 1; ctx->first_win = 1;
...@@ -678,7 +755,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) ...@@ -678,7 +755,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
ctx->out_type |= IFTYPE_I80; ctx->out_type |= IFTYPE_I80;
} }
if (ctx->out_type | I80_HW_TRG) { if (ctx->out_type & I80_HW_TRG) {
ctx->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, ctx->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node,
"samsung,disp-sysreg"); "samsung,disp-sysreg");
if (IS_ERR(ctx->sysreg)) { if (IS_ERR(ctx->sysreg)) {
......
...@@ -526,6 +526,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) ...@@ -526,6 +526,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
for (i = 0; i < WINDOWS_NR; i++) for (i = 0; i < WINDOWS_NR; i++)
decon_shadow_protect_win(ctx, i, false); decon_shadow_protect_win(ctx, i, false);
exynos_crtc_handle_event(crtc);
} }
static void decon_init(struct decon_context *ctx) static void decon_init(struct decon_context *ctx)
......
...@@ -85,16 +85,28 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, ...@@ -85,16 +85,28 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state) struct drm_crtc_state *old_crtc_state)
{ {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
struct drm_pending_vblank_event *event;
unsigned long flags;
if (exynos_crtc->ops->atomic_flush) if (exynos_crtc->ops->atomic_flush)
exynos_crtc->ops->atomic_flush(exynos_crtc); exynos_crtc->ops->atomic_flush(exynos_crtc);
}
static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
.enable = exynos_drm_crtc_enable,
.disable = exynos_drm_crtc_disable,
.mode_set_nofb = exynos_drm_crtc_mode_set_nofb,
.atomic_check = exynos_crtc_atomic_check,
.atomic_begin = exynos_crtc_atomic_begin,
.atomic_flush = exynos_crtc_atomic_flush,
};
void exynos_crtc_handle_event(struct exynos_drm_crtc *exynos_crtc)
{
struct drm_crtc *crtc = &exynos_crtc->base;
struct drm_pending_vblank_event *event = crtc->state->event;
unsigned long flags;
event = crtc->state->event;
if (event) { if (event) {
crtc->state->event = NULL; crtc->state->event = NULL;
spin_lock_irqsave(&crtc->dev->event_lock, flags); spin_lock_irqsave(&crtc->dev->event_lock, flags);
if (drm_crtc_vblank_get(crtc) == 0) if (drm_crtc_vblank_get(crtc) == 0)
drm_crtc_arm_vblank_event(crtc, event); drm_crtc_arm_vblank_event(crtc, event);
...@@ -105,15 +117,6 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, ...@@ -105,15 +117,6 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc,
} }
static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
.enable = exynos_drm_crtc_enable,
.disable = exynos_drm_crtc_disable,
.mode_set_nofb = exynos_drm_crtc_mode_set_nofb,
.atomic_check = exynos_crtc_atomic_check,
.atomic_begin = exynos_crtc_atomic_begin,
.atomic_flush = exynos_crtc_atomic_flush,
};
static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) static void exynos_drm_crtc_destroy(struct drm_crtc *crtc)
{ {
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
......
...@@ -40,4 +40,6 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev, ...@@ -40,4 +40,6 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,
*/ */
void exynos_drm_crtc_te_handler(struct drm_crtc *crtc); void exynos_drm_crtc_te_handler(struct drm_crtc *crtc);
void exynos_crtc_handle_event(struct exynos_drm_crtc *exynos_crtc);
#endif #endif
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
#define DSIM_SYNC_INFORM (1 << 27) #define DSIM_SYNC_INFORM (1 << 27)
#define DSIM_EOT_DISABLE (1 << 28) #define DSIM_EOT_DISABLE (1 << 28)
#define DSIM_MFLUSH_VS (1 << 29) #define DSIM_MFLUSH_VS (1 << 29)
/* This flag is valid only for exynos3250/3472/4415/5260/5430 */ /* This flag is valid only for exynos3250/3472/5260/5430 */
#define DSIM_CLKLANE_STOP (1 << 30) #define DSIM_CLKLANE_STOP (1 << 30)
/* DSIM_ESCMODE */ /* DSIM_ESCMODE */
...@@ -473,17 +473,6 @@ static const struct exynos_dsi_driver_data exynos4_dsi_driver_data = { ...@@ -473,17 +473,6 @@ static const struct exynos_dsi_driver_data exynos4_dsi_driver_data = {
.reg_values = reg_values, .reg_values = reg_values,
}; };
static const struct exynos_dsi_driver_data exynos4415_dsi_driver_data = {
.reg_ofs = exynos_reg_ofs,
.plltmr_reg = 0x58,
.has_clklane_stop = 1,
.num_clks = 2,
.max_freq = 1000,
.wait_for_reset = 1,
.num_bits_resol = 11,
.reg_values = reg_values,
};
static const struct exynos_dsi_driver_data exynos5_dsi_driver_data = { static const struct exynos_dsi_driver_data exynos5_dsi_driver_data = {
.reg_ofs = exynos_reg_ofs, .reg_ofs = exynos_reg_ofs,
.plltmr_reg = 0x58, .plltmr_reg = 0x58,
...@@ -521,8 +510,6 @@ static const struct of_device_id exynos_dsi_of_match[] = { ...@@ -521,8 +510,6 @@ static const struct of_device_id exynos_dsi_of_match[] = {
.data = &exynos3_dsi_driver_data }, .data = &exynos3_dsi_driver_data },
{ .compatible = "samsung,exynos4210-mipi-dsi", { .compatible = "samsung,exynos4210-mipi-dsi",
.data = &exynos4_dsi_driver_data }, .data = &exynos4_dsi_driver_data },
{ .compatible = "samsung,exynos4415-mipi-dsi",
.data = &exynos4415_dsi_driver_data },
{ .compatible = "samsung,exynos5410-mipi-dsi", { .compatible = "samsung,exynos5410-mipi-dsi",
.data = &exynos5_dsi_driver_data }, .data = &exynos5_dsi_driver_data },
{ .compatible = "samsung,exynos5422-mipi-dsi", { .compatible = "samsung,exynos5422-mipi-dsi",
...@@ -979,7 +966,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi, ...@@ -979,7 +966,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi,
bool first = !xfer->tx_done; bool first = !xfer->tx_done;
u32 reg; u32 reg;
dev_dbg(dev, "< xfer %p: tx len %u, done %u, rx len %u, done %u\n", dev_dbg(dev, "< xfer %pK: tx len %u, done %u, rx len %u, done %u\n",
xfer, length, xfer->tx_done, xfer->rx_len, xfer->rx_done); xfer, length, xfer->tx_done, xfer->rx_len, xfer->rx_done);
if (length > DSI_TX_FIFO_SIZE) if (length > DSI_TX_FIFO_SIZE)
...@@ -1177,7 +1164,7 @@ static bool exynos_dsi_transfer_finish(struct exynos_dsi *dsi) ...@@ -1177,7 +1164,7 @@ static bool exynos_dsi_transfer_finish(struct exynos_dsi *dsi)
spin_unlock_irqrestore(&dsi->transfer_lock, flags); spin_unlock_irqrestore(&dsi->transfer_lock, flags);
dev_dbg(dsi->dev, dev_dbg(dsi->dev,
"> xfer %p, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n", "> xfer %pK, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
xfer, xfer->packet.payload_length, xfer->tx_done, xfer->rx_len, xfer, xfer->packet.payload_length, xfer->tx_done, xfer->rx_len,
xfer->rx_done); xfer->rx_done);
...@@ -1348,9 +1335,12 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi) ...@@ -1348,9 +1335,12 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi)
int te_gpio_irq; int te_gpio_irq;
dsi->te_gpio = of_get_named_gpio(dsi->panel_node, "te-gpios", 0); dsi->te_gpio = of_get_named_gpio(dsi->panel_node, "te-gpios", 0);
if (dsi->te_gpio == -ENOENT)
return 0;
if (!gpio_is_valid(dsi->te_gpio)) { if (!gpio_is_valid(dsi->te_gpio)) {
dev_err(dsi->dev, "no te-gpios specified\n");
ret = dsi->te_gpio; ret = dsi->te_gpio;
dev_err(dsi->dev, "cannot get te-gpios, %d\n", ret);
goto out; goto out;
} }
......
...@@ -1695,7 +1695,7 @@ static int fimc_probe(struct platform_device *pdev) ...@@ -1695,7 +1695,7 @@ static int fimc_probe(struct platform_device *pdev)
goto err_put_clk; goto err_put_clk;
} }
DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv); DRM_DEBUG_KMS("id[%d]ippdrv[%pK]\n", ctx->id, ippdrv);
spin_lock_init(&ctx->lock); spin_lock_init(&ctx->lock);
platform_set_drvdata(pdev, ctx); platform_set_drvdata(pdev, ctx);
......
...@@ -71,10 +71,10 @@ ...@@ -71,10 +71,10 @@
#define TRIGCON 0x1A4 #define TRIGCON 0x1A4
#define TRGMODE_ENABLE (1 << 0) #define TRGMODE_ENABLE (1 << 0)
#define SWTRGCMD_ENABLE (1 << 1) #define SWTRGCMD_ENABLE (1 << 1)
/* Exynos3250, 3472, 4415, 5260 5410, 5420 and 5422 only supported. */ /* Exynos3250, 3472, 5260 5410, 5420 and 5422 only supported. */
#define HWTRGEN_ENABLE (1 << 3) #define HWTRGEN_ENABLE (1 << 3)
#define HWTRGMASK_ENABLE (1 << 4) #define HWTRGMASK_ENABLE (1 << 4)
/* Exynos3250, 3472, 4415, 5260, 5420 and 5422 only supported. */ /* Exynos3250, 3472, 5260, 5420 and 5422 only supported. */
#define HWTRIGEN_PER_ENABLE (1 << 31) #define HWTRIGEN_PER_ENABLE (1 << 31)
/* display mode change control register except exynos4 */ /* display mode change control register except exynos4 */
...@@ -138,18 +138,6 @@ static struct fimd_driver_data exynos4_fimd_driver_data = { ...@@ -138,18 +138,6 @@ static struct fimd_driver_data exynos4_fimd_driver_data = {
.has_vtsel = 1, .has_vtsel = 1,
}; };
static struct fimd_driver_data exynos4415_fimd_driver_data = {
.timing_base = 0x20000,
.lcdblk_offset = 0x210,
.lcdblk_vt_shift = 10,
.lcdblk_bypass_shift = 1,
.trg_type = I80_HW_TRG,
.has_shadowcon = 1,
.has_vidoutcon = 1,
.has_vtsel = 1,
.has_trigger_per_te = 1,
};
static struct fimd_driver_data exynos5_fimd_driver_data = { static struct fimd_driver_data exynos5_fimd_driver_data = {
.timing_base = 0x20000, .timing_base = 0x20000,
.lcdblk_offset = 0x214, .lcdblk_offset = 0x214,
...@@ -210,8 +198,6 @@ static const struct of_device_id fimd_driver_dt_match[] = { ...@@ -210,8 +198,6 @@ static const struct of_device_id fimd_driver_dt_match[] = {
.data = &exynos3_fimd_driver_data }, .data = &exynos3_fimd_driver_data },
{ .compatible = "samsung,exynos4210-fimd", { .compatible = "samsung,exynos4210-fimd",
.data = &exynos4_fimd_driver_data }, .data = &exynos4_fimd_driver_data },
{ .compatible = "samsung,exynos4415-fimd",
.data = &exynos4415_fimd_driver_data },
{ .compatible = "samsung,exynos5250-fimd", { .compatible = "samsung,exynos5250-fimd",
.data = &exynos5_fimd_driver_data }, .data = &exynos5_fimd_driver_data },
{ .compatible = "samsung,exynos5420-fimd", { .compatible = "samsung,exynos5420-fimd",
...@@ -257,7 +243,7 @@ static int fimd_enable_vblank(struct exynos_drm_crtc *crtc) ...@@ -257,7 +243,7 @@ static int fimd_enable_vblank(struct exynos_drm_crtc *crtc)
val |= VIDINTCON0_INT_FRAME; val |= VIDINTCON0_INT_FRAME;
val &= ~VIDINTCON0_FRAMESEL0_MASK; val &= ~VIDINTCON0_FRAMESEL0_MASK;
val |= VIDINTCON0_FRAMESEL0_VSYNC; val |= VIDINTCON0_FRAMESEL0_FRONTPORCH;
val &= ~VIDINTCON0_FRAMESEL1_MASK; val &= ~VIDINTCON0_FRAMESEL1_MASK;
val |= VIDINTCON0_FRAMESEL1_NONE; val |= VIDINTCON0_FRAMESEL1_NONE;
} }
...@@ -723,6 +709,8 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc) ...@@ -723,6 +709,8 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc)
for (i = 0; i < WINDOWS_NR; i++) for (i = 0; i < WINDOWS_NR; i++)
fimd_shadow_protect_win(ctx, i, false); fimd_shadow_protect_win(ctx, i, false);
exynos_crtc_handle_event(crtc);
} }
static void fimd_update_plane(struct exynos_drm_crtc *crtc, static void fimd_update_plane(struct exynos_drm_crtc *crtc,
......
...@@ -218,7 +218,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev, ...@@ -218,7 +218,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
DRM_DEBUG_KMS("created file object = %p\n", obj->filp); DRM_DEBUG_KMS("created file object = %pK\n", obj->filp);
return exynos_gem; return exynos_gem;
} }
......
...@@ -1723,7 +1723,7 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1723,7 +1723,7 @@ static int gsc_probe(struct platform_device *pdev)
return ret; return ret;
} }
DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv); DRM_DEBUG_KMS("id[%d]ippdrv[%pK]\n", ctx->id, ippdrv);
mutex_init(&ctx->lock); mutex_init(&ctx->lock);
platform_set_drvdata(pdev, ctx); platform_set_drvdata(pdev, ctx);
......
...@@ -208,7 +208,7 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id) ...@@ -208,7 +208,7 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id)
* e.g PAUSE state, queue buf, command control. * e.g PAUSE state, queue buf, command control.
*/ */
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", count++, ippdrv); DRM_DEBUG_KMS("count[%d]ippdrv[%pK]\n", count++, ippdrv);
mutex_lock(&ippdrv->cmd_lock); mutex_lock(&ippdrv->cmd_lock);
list_for_each_entry(c_node, &ippdrv->cmd_list, list) { list_for_each_entry(c_node, &ippdrv->cmd_list, list) {
...@@ -388,7 +388,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, ...@@ -388,7 +388,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
} }
property->prop_id = ret; property->prop_id = ret;
DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%p]\n", DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%pK]\n",
property->prop_id, property->cmd, ippdrv); property->prop_id, property->cmd, ippdrv);
/* stored property information and ippdrv in private data */ /* stored property information and ippdrv in private data */
...@@ -518,7 +518,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev, ...@@ -518,7 +518,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev,
{ {
int i; int i;
DRM_DEBUG_KMS("node[%p]\n", m_node); DRM_DEBUG_KMS("node[%pK]\n", m_node);
if (!m_node) { if (!m_node) {
DRM_ERROR("invalid dequeue node.\n"); DRM_ERROR("invalid dequeue node.\n");
...@@ -562,7 +562,7 @@ static struct drm_exynos_ipp_mem_node ...@@ -562,7 +562,7 @@ static struct drm_exynos_ipp_mem_node
m_node->buf_id = qbuf->buf_id; m_node->buf_id = qbuf->buf_id;
INIT_LIST_HEAD(&m_node->list); INIT_LIST_HEAD(&m_node->list);
DRM_DEBUG_KMS("m_node[%p]ops_id[%d]\n", m_node, qbuf->ops_id); DRM_DEBUG_KMS("m_node[%pK]ops_id[%d]\n", m_node, qbuf->ops_id);
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id); DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id);
for_each_ipp_planar(i) { for_each_ipp_planar(i) {
...@@ -659,7 +659,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node, ...@@ -659,7 +659,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node,
mutex_lock(&c_node->event_lock); mutex_lock(&c_node->event_lock);
list_for_each_entry_safe(e, te, &c_node->event_list, base.link) { list_for_each_entry_safe(e, te, &c_node->event_list, base.link) {
DRM_DEBUG_KMS("count[%d]e[%p]\n", count++, e); DRM_DEBUG_KMS("count[%d]e[%pK]\n", count++, e);
/* /*
* qbuf == NULL condition means all event deletion. * qbuf == NULL condition means all event deletion.
...@@ -750,7 +750,7 @@ static struct drm_exynos_ipp_mem_node ...@@ -750,7 +750,7 @@ static struct drm_exynos_ipp_mem_node
/* find memory node from memory list */ /* find memory node from memory list */
list_for_each_entry(m_node, head, list) { list_for_each_entry(m_node, head, list) {
DRM_DEBUG_KMS("count[%d]m_node[%p]\n", count++, m_node); DRM_DEBUG_KMS("count[%d]m_node[%pK]\n", count++, m_node);
/* compare buffer id */ /* compare buffer id */
if (m_node->buf_id == qbuf->buf_id) if (m_node->buf_id == qbuf->buf_id)
...@@ -767,7 +767,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv, ...@@ -767,7 +767,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv,
struct exynos_drm_ipp_ops *ops = NULL; struct exynos_drm_ipp_ops *ops = NULL;
int ret = 0; int ret = 0;
DRM_DEBUG_KMS("node[%p]\n", m_node); DRM_DEBUG_KMS("node[%pK]\n", m_node);
if (!m_node) { if (!m_node) {
DRM_ERROR("invalid queue node.\n"); DRM_ERROR("invalid queue node.\n");
...@@ -1232,7 +1232,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, ...@@ -1232,7 +1232,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
m_node = list_first_entry(head, m_node = list_first_entry(head,
struct drm_exynos_ipp_mem_node, list); struct drm_exynos_ipp_mem_node, list);
DRM_DEBUG_KMS("m_node[%p]\n", m_node); DRM_DEBUG_KMS("m_node[%pK]\n", m_node);
ret = ipp_set_mem_node(ippdrv, c_node, m_node); ret = ipp_set_mem_node(ippdrv, c_node, m_node);
if (ret) { if (ret) {
...@@ -1601,7 +1601,7 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) ...@@ -1601,7 +1601,7 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
} }
ippdrv->prop_list.ipp_id = ret; ippdrv->prop_list.ipp_id = ret;
DRM_DEBUG_KMS("count[%d]ippdrv[%p]ipp_id[%d]\n", DRM_DEBUG_KMS("count[%d]ippdrv[%pK]ipp_id[%d]\n",
count++, ippdrv, ret); count++, ippdrv, ret);
/* store parent device for node */ /* store parent device for node */
...@@ -1659,7 +1659,7 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev, ...@@ -1659,7 +1659,7 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev,
file_priv->ipp_dev = dev; file_priv->ipp_dev = dev;
DRM_DEBUG_KMS("done priv[%p]\n", dev); DRM_DEBUG_KMS("done priv[%pK]\n", dev);
return 0; return 0;
} }
...@@ -1676,7 +1676,7 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev, ...@@ -1676,7 +1676,7 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev,
mutex_lock(&ippdrv->cmd_lock); mutex_lock(&ippdrv->cmd_lock);
list_for_each_entry_safe(c_node, tc_node, list_for_each_entry_safe(c_node, tc_node,
&ippdrv->cmd_list, list) { &ippdrv->cmd_list, list) {
DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", DRM_DEBUG_KMS("count[%d]ippdrv[%pK]\n",
count++, ippdrv); count++, ippdrv);
if (c_node->filp == file) { if (c_node->filp == file) {
......
...@@ -748,7 +748,7 @@ static int rotator_probe(struct platform_device *pdev) ...@@ -748,7 +748,7 @@ static int rotator_probe(struct platform_device *pdev)
goto err_ippdrv_register; goto err_ippdrv_register;
} }
DRM_DEBUG_KMS("ippdrv[%p]\n", ippdrv); DRM_DEBUG_KMS("ippdrv[%pK]\n", ippdrv);
platform_set_drvdata(pdev, rot); platform_set_drvdata(pdev, rot);
......
...@@ -170,6 +170,7 @@ static const struct exynos_drm_crtc_ops vidi_crtc_ops = { ...@@ -170,6 +170,7 @@ static const struct exynos_drm_crtc_ops vidi_crtc_ops = {
.enable_vblank = vidi_enable_vblank, .enable_vblank = vidi_enable_vblank,
.disable_vblank = vidi_disable_vblank, .disable_vblank = vidi_disable_vblank,
.update_plane = vidi_update_plane, .update_plane = vidi_update_plane,
.atomic_flush = exynos_crtc_handle_event,
}; };
static void vidi_fake_vblank_timer(unsigned long arg) static void vidi_fake_vblank_timer(unsigned long arg)
......
...@@ -1012,6 +1012,7 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) ...@@ -1012,6 +1012,7 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc)
return; return;
mixer_vsync_set_update(mixer_ctx, true); mixer_vsync_set_update(mixer_ctx, true);
exynos_crtc_handle_event(crtc);
} }
static void mixer_enable(struct exynos_drm_crtc *crtc) static void mixer_enable(struct exynos_drm_crtc *crtc)
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#define DECON_FRAMEFIFO_STATUS 0x0524 #define DECON_FRAMEFIFO_STATUS 0x0524
#define DECON_CMU 0x1404 #define DECON_CMU 0x1404
#define DECON_UPDATE 0x1410 #define DECON_UPDATE 0x1410
#define DECON_CRFMID 0x1414
#define DECON_UPDATE_SCHEME 0x1438 #define DECON_UPDATE_SCHEME 0x1438
#define DECON_VIDCON1 0x2000 #define DECON_VIDCON1 0x2000
#define DECON_VIDCON2 0x2004 #define DECON_VIDCON2 0x2004
...@@ -126,6 +127,10 @@ ...@@ -126,6 +127,10 @@
/* VIDINTCON0 */ /* VIDINTCON0 */
#define VIDINTCON0_FRAMEDONE (1 << 17) #define VIDINTCON0_FRAMEDONE (1 << 17)
#define VIDINTCON0_FRAMESEL_BP (0 << 15)
#define VIDINTCON0_FRAMESEL_VS (1 << 15)
#define VIDINTCON0_FRAMESEL_AC (2 << 15)
#define VIDINTCON0_FRAMESEL_FP (3 << 15)
#define VIDINTCON0_INTFRMEN (1 << 12) #define VIDINTCON0_INTFRMEN (1 << 12)
#define VIDINTCON0_INTEN (1 << 0) #define VIDINTCON0_INTEN (1 << 0)
...@@ -142,6 +147,13 @@ ...@@ -142,6 +147,13 @@
#define STANDALONE_UPDATE_F (1 << 0) #define STANDALONE_UPDATE_F (1 << 0)
/* DECON_VIDCON1 */ /* DECON_VIDCON1 */
#define VIDCON1_LINECNT_MASK (0x0fff << 16)
#define VIDCON1_I80_ACTIVE (1 << 15)
#define VIDCON1_VSTATUS_MASK (0x3 << 13)
#define VIDCON1_VSTATUS_VS (0 << 13)
#define VIDCON1_VSTATUS_BP (1 << 13)
#define VIDCON1_VSTATUS_AC (2 << 13)
#define VIDCON1_VSTATUS_FP (3 << 13)
#define VIDCON1_VCLK_MASK (0x3 << 9) #define VIDCON1_VCLK_MASK (0x3 << 9)
#define VIDCON1_VCLK_RUN_VDEN_DISABLE (0x3 << 9) #define VIDCON1_VCLK_RUN_VDEN_DISABLE (0x3 << 9)
#define VIDCON1_VCLK_HOLD (0x0 << 9) #define VIDCON1_VCLK_HOLD (0x0 << 9)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment