Message ID | 1432880675-14178-1-git-send-email-jy0922.shim@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Joonyoung, 2015-05-29 Joonyoung Shim <jy0922.shim@samsung.com>: > Handle changes by removing copy from adjusted_mode to mode as using > adjusted_mode of crtc_state. > > Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> > --- > This is based on a patch "[PATCH v9 04/18] drm/exynos: atomic phase 1: > add .mode_set_nofb() callback" of Gustavo. > > drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++-- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- > drivers/gpu/drm/exynos/exynos_drm_plane.c | 13 +++++++------ > 3 files changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c > index 6714e5b..f29e4be 100644 > --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c > +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c > @@ -175,7 +175,7 @@ static bool decon_mode_fixup(struct exynos_drm_crtc *crtc, > static void decon_commit(struct exynos_drm_crtc *crtc) > { > struct decon_context *ctx = crtc->ctx; > - struct drm_display_mode *mode = &crtc->base.mode; > + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; > u32 val, clkdiv; > > if (ctx->suspended) > @@ -395,7 +395,7 @@ static void decon_shadow_protect_win(struct decon_context *ctx, > static void decon_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) > { > struct decon_context *ctx = crtc->ctx; > - struct drm_display_mode *mode = &crtc->base.mode; > + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; > struct exynos_drm_plane *plane; > int padding; > unsigned long val, alpha; > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index a0edab8..b326b31 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -337,7 +337,7 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, > static void fimd_commit(struct exynos_drm_crtc *crtc) > { > struct fimd_context *ctx = crtc->ctx; > - struct drm_display_mode *mode = &crtc->base.mode; > + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; Please take a look on the discussion here: http://www.spinics.net/lists/linux-samsung-soc/msg44734.html Tobias reports that he was seeing oops due to null pointer with an approach similar to this one. The lastest version of the patch is here: http://www.spinics.net/lists/linux-samsung-soc/msg44790.html Gustavo
On 05/30/2015 12:57 AM, Gustavo Padovan wrote: > Hi Joonyoung, > > 2015-05-29 Joonyoung Shim <jy0922.shim@samsung.com>: > >> Handle changes by removing copy from adjusted_mode to mode as using >> adjusted_mode of crtc_state. >> >> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> >> --- >> This is based on a patch "[PATCH v9 04/18] drm/exynos: atomic phase 1: >> add .mode_set_nofb() callback" of Gustavo. >> >> drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++-- >> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- >> drivers/gpu/drm/exynos/exynos_drm_plane.c | 13 +++++++------ >> 3 files changed, 10 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c >> index 6714e5b..f29e4be 100644 >> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c >> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c >> @@ -175,7 +175,7 @@ static bool decon_mode_fixup(struct exynos_drm_crtc *crtc, >> static void decon_commit(struct exynos_drm_crtc *crtc) >> { >> struct decon_context *ctx = crtc->ctx; >> - struct drm_display_mode *mode = &crtc->base.mode; >> + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; >> u32 val, clkdiv; >> >> if (ctx->suspended) >> @@ -395,7 +395,7 @@ static void decon_shadow_protect_win(struct decon_context *ctx, >> static void decon_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) >> { >> struct decon_context *ctx = crtc->ctx; >> - struct drm_display_mode *mode = &crtc->base.mode; >> + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; >> struct exynos_drm_plane *plane; >> int padding; >> unsigned long val, alpha; >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> index a0edab8..b326b31 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> @@ -337,7 +337,7 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, >> static void fimd_commit(struct exynos_drm_crtc *crtc) >> { >> struct fimd_context *ctx = crtc->ctx; >> - struct drm_display_mode *mode = &crtc->base.mode; >> + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; > > Please take a look on the discussion here: > > http://www.spinics.net/lists/linux-samsung-soc/msg44734.html > > Tobias reports that he was seeing oops due to null pointer with an > approach similar to this one. > > The lastest version of the patch is here: > > http://www.spinics.net/lists/linux-samsung-soc/msg44790.html > It's impossible crtc->base.state is NULL as driver is switched by atomic modeset functions, right? I don't get any oops by NULL pointer on boot now.
Hi Joonyoung, 2015-06-01 Joonyoung Shim <jy0922.shim@samsung.com>: > On 05/30/2015 12:57 AM, Gustavo Padovan wrote: > > Hi Joonyoung, > > > > 2015-05-29 Joonyoung Shim <jy0922.shim@samsung.com>: > > > >> Handle changes by removing copy from adjusted_mode to mode as using > >> adjusted_mode of crtc_state. > >> > >> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> > >> --- > >> This is based on a patch "[PATCH v9 04/18] drm/exynos: atomic phase 1: > >> add .mode_set_nofb() callback" of Gustavo. > >> > >> drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++-- > >> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- > >> drivers/gpu/drm/exynos/exynos_drm_plane.c | 13 +++++++------ > >> 3 files changed, 10 insertions(+), 9 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c > >> index 6714e5b..f29e4be 100644 > >> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c > >> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c > >> @@ -175,7 +175,7 @@ static bool decon_mode_fixup(struct exynos_drm_crtc *crtc, > >> static void decon_commit(struct exynos_drm_crtc *crtc) > >> { > >> struct decon_context *ctx = crtc->ctx; > >> - struct drm_display_mode *mode = &crtc->base.mode; > >> + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; > >> u32 val, clkdiv; > >> > >> if (ctx->suspended) > >> @@ -395,7 +395,7 @@ static void decon_shadow_protect_win(struct decon_context *ctx, > >> static void decon_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) > >> { > >> struct decon_context *ctx = crtc->ctx; > >> - struct drm_display_mode *mode = &crtc->base.mode; > >> + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; > >> struct exynos_drm_plane *plane; > >> int padding; > >> unsigned long val, alpha; > >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > >> index a0edab8..b326b31 100644 > >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > >> @@ -337,7 +337,7 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, > >> static void fimd_commit(struct exynos_drm_crtc *crtc) > >> { > >> struct fimd_context *ctx = crtc->ctx; > >> - struct drm_display_mode *mode = &crtc->base.mode; > >> + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; > > > > Please take a look on the discussion here: > > > > http://www.spinics.net/lists/linux-samsung-soc/msg44734.html > > > > Tobias reports that he was seeing oops due to null pointer with an > > approach similar to this one. > > > > The lastest version of the patch is here: > > > > http://www.spinics.net/lists/linux-samsung-soc/msg44790.html > > > > It's impossible crtc->base.state is NULL as driver is switched by atomic > modeset functions, right? Yes, I think so too, I'll rebase v10 on top of your patch. Gustavo
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 6714e5b..f29e4be 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -175,7 +175,7 @@ static bool decon_mode_fixup(struct exynos_drm_crtc *crtc, static void decon_commit(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; - struct drm_display_mode *mode = &crtc->base.mode; + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; u32 val, clkdiv; if (ctx->suspended) @@ -395,7 +395,7 @@ static void decon_shadow_protect_win(struct decon_context *ctx, static void decon_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) { struct decon_context *ctx = crtc->ctx; - struct drm_display_mode *mode = &crtc->base.mode; + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; struct exynos_drm_plane *plane; int padding; unsigned long val, alpha; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index a0edab8..b326b31 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -337,7 +337,7 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, static void fimd_commit(struct exynos_drm_crtc *crtc) { struct fimd_context *ctx = crtc->ctx; - struct drm_display_mode *mode = &crtc->base.mode; + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; struct fimd_driver_data *driver_data = ctx->driver_data; void *timing_base = ctx->regs + driver_data->timing_base; u32 val, clkdiv; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 6e1341e..f0067f7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -95,11 +95,12 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, uint32_t src_w, uint32_t src_h) { struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); + struct drm_display_mode *mode = &crtc->state->adjusted_mode; unsigned int actual_w; unsigned int actual_h; - actual_w = exynos_plane_get_size(crtc_x, crtc_w, crtc->mode.hdisplay); - actual_h = exynos_plane_get_size(crtc_y, crtc_h, crtc->mode.vdisplay); + actual_w = exynos_plane_get_size(crtc_x, crtc_w, mode->hdisplay); + actual_h = exynos_plane_get_size(crtc_y, crtc_h, mode->vdisplay); if (crtc_x < 0) { if (actual_w) @@ -135,10 +136,10 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, exynos_plane->crtc_height = actual_h; /* set drm mode data. */ - exynos_plane->mode_width = crtc->mode.hdisplay; - exynos_plane->mode_height = crtc->mode.vdisplay; - exynos_plane->refresh = crtc->mode.vrefresh; - exynos_plane->scan_flag = crtc->mode.flags; + exynos_plane->mode_width = mode->hdisplay; + exynos_plane->mode_height = mode->vdisplay; + exynos_plane->refresh = mode->vrefresh; + exynos_plane->scan_flag = mode->flags; DRM_DEBUG_KMS("plane : offset_x/y(%d,%d), width/height(%d,%d)", exynos_plane->crtc_x, exynos_plane->crtc_y,
Handle changes by removing copy from adjusted_mode to mode as using adjusted_mode of crtc_state. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> --- This is based on a patch "[PATCH v9 04/18] drm/exynos: atomic phase 1: add .mode_set_nofb() callback" of Gustavo. drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_plane.c | 13 +++++++------ 3 files changed, 10 insertions(+), 9 deletions(-)