dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
  • * [PATCH AUTOSEL 4.19 49/81] drm/sun4i: Set device driver data at bind time for use in unbind
           [not found] <20190507053554.30848-1-sashal@kernel.org>
           [not found] ` <20190507053554.30848-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
    @ 2019-05-07  5:35 ` Sasha Levin
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 50/81] drm/sun4i: Fix component unbinding and component master deletion Sasha Levin
                       ` (3 subsequent siblings)
      5 siblings, 0 replies; 7+ messages in thread
    From: Sasha Levin @ 2019-05-07  5:35 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Paul Kocialkowski, Maxime Ripard, dri-devel, Sasha Levin
    
    From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    
    [ Upstream commit 02b92adbe33e6dbd15dc6e32540b22f47c4ff0a2 ]
    
    Our sun4i_drv_unbind gets the drm device using dev_get_drvdata.
    However, that driver data is never set in sun4i_drv_bind.
    
    Set it there to avoid getting a NULL pointer at unbind time.
    
    Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
    Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190418132727.5128-3-paul.kocialkowski@bootlin.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/sun4i/sun4i_drv.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
    index 8b0cd08034e0..7cac01c72c02 100644
    --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
    +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
    @@ -92,6 +92,8 @@ static int sun4i_drv_bind(struct device *dev)
     		ret = -ENOMEM;
     		goto free_drm;
     	}
    +
    +	dev_set_drvdata(dev, drm);
     	drm->dev_private = drv;
     	INIT_LIST_HEAD(&drv->frontend_list);
     	INIT_LIST_HEAD(&drv->engine_list);
    -- 
    2.20.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 7+ messages in thread
  • * [PATCH AUTOSEL 4.19 50/81] drm/sun4i: Fix component unbinding and component master deletion
           [not found] <20190507053554.30848-1-sashal@kernel.org>
           [not found] ` <20190507053554.30848-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 49/81] drm/sun4i: Set device driver data at bind time for use in unbind Sasha Levin
    @ 2019-05-07  5:35 ` Sasha Levin
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 53/81] gpu: ipu-v3: dp: fix CSC handling Sasha Levin
                       ` (2 subsequent siblings)
      5 siblings, 0 replies; 7+ messages in thread
    From: Sasha Levin @ 2019-05-07  5:35 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Paul Kocialkowski, Maxime Ripard, dri-devel, Sasha Levin
    
    From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    
    [ Upstream commit f5a9ed867c83875546c9aadd4ed8e785e9adcc3c ]
    
    For our component-backed driver to be properly removed, we need to
    delete the component master in sun4i_drv_remove and make sure to call
    component_unbind_all in the master's unbind so that all components are
    unbound when the master is.
    
    Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support")
    Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190418132727.5128-4-paul.kocialkowski@bootlin.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
    index 7cac01c72c02..62703630090a 100644
    --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
    +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
    @@ -160,6 +160,8 @@ static void sun4i_drv_unbind(struct device *dev)
     	drm_mode_config_cleanup(drm);
     	of_reserved_mem_device_release(dev);
     	drm_dev_put(drm);
    +
    +	component_unbind_all(dev, NULL);
     }
     
     static const struct component_master_ops sun4i_drv_master_ops = {
    @@ -407,6 +409,8 @@ static int sun4i_drv_probe(struct platform_device *pdev)
     
     static int sun4i_drv_remove(struct platform_device *pdev)
     {
    +	component_master_del(&pdev->dev, &sun4i_drv_master_ops);
    +
     	return 0;
     }
     
    -- 
    2.20.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 7+ messages in thread
  • * [PATCH AUTOSEL 4.19 53/81] gpu: ipu-v3: dp: fix CSC handling
           [not found] <20190507053554.30848-1-sashal@kernel.org>
                       ` (2 preceding siblings ...)
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 50/81] drm/sun4i: Fix component unbinding and component master deletion Sasha Levin
    @ 2019-05-07  5:35 ` Sasha Levin
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 54/81] drm/imx: don't skip DP channel disable for background plane Sasha Levin
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 59/81] drm/sun4i: Unbind components before releasing DRM and memory Sasha Levin
      5 siblings, 0 replies; 7+ messages in thread
    From: Sasha Levin @ 2019-05-07  5:35 UTC (permalink / raw)
      To: linux-kernel, stable; +Cc: Sasha Levin, dri-devel, Jonathan Marek
    
    From: Lucas Stach <l.stach@pengutronix.de>
    
    [ Upstream commit d4fad0a426c6e26f48c9a7cdd21a7fe9c198d645 ]
    
    Initialize the flow input colorspaces to unknown and reset to that value
    when the channel gets disabled. This avoids the state getting mixed up
    with a previous mode.
    
    Also keep the CSC settings for the background flow intact when disabling
    the foreground flow.
    
    Root-caused-by: Jonathan Marek <jonathan@marek.ca>
    Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
    Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/ipu-v3/ipu-dp.c | 12 +++++++++---
     1 file changed, 9 insertions(+), 3 deletions(-)
    
    diff --git a/drivers/gpu/ipu-v3/ipu-dp.c b/drivers/gpu/ipu-v3/ipu-dp.c
    index 9b2b3fa479c4..5e44ff1f2085 100644
    --- a/drivers/gpu/ipu-v3/ipu-dp.c
    +++ b/drivers/gpu/ipu-v3/ipu-dp.c
    @@ -195,7 +195,8 @@ int ipu_dp_setup_channel(struct ipu_dp *dp,
     		ipu_dp_csc_init(flow, flow->foreground.in_cs, flow->out_cs,
     				DP_COM_CONF_CSC_DEF_BOTH);
     	} else {
    -		if (flow->foreground.in_cs == flow->out_cs)
    +		if (flow->foreground.in_cs == IPUV3_COLORSPACE_UNKNOWN ||
    +		    flow->foreground.in_cs == flow->out_cs)
     			/*
     			 * foreground identical to output, apply color
     			 * conversion on background
    @@ -261,6 +262,8 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync)
     	struct ipu_dp_priv *priv = flow->priv;
     	u32 reg, csc;
     
    +	dp->in_cs = IPUV3_COLORSPACE_UNKNOWN;
    +
     	if (!dp->foreground)
     		return;
     
    @@ -268,8 +271,9 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync)
     
     	reg = readl(flow->base + DP_COM_CONF);
     	csc = reg & DP_COM_CONF_CSC_DEF_MASK;
    -	if (csc == DP_COM_CONF_CSC_DEF_FG)
    -		reg &= ~DP_COM_CONF_CSC_DEF_MASK;
    +	reg &= ~DP_COM_CONF_CSC_DEF_MASK;
    +	if (csc == DP_COM_CONF_CSC_DEF_BOTH || csc == DP_COM_CONF_CSC_DEF_BG)
    +		reg |= DP_COM_CONF_CSC_DEF_BG;
     
     	reg &= ~DP_COM_CONF_FG_EN;
     	writel(reg, flow->base + DP_COM_CONF);
    @@ -347,6 +351,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base)
     	mutex_init(&priv->mutex);
     
     	for (i = 0; i < IPUV3_NUM_FLOWS; i++) {
    +		priv->flow[i].background.in_cs = IPUV3_COLORSPACE_UNKNOWN;
    +		priv->flow[i].foreground.in_cs = IPUV3_COLORSPACE_UNKNOWN;
     		priv->flow[i].foreground.foreground = true;
     		priv->flow[i].base = priv->base + ipu_dp_flow_base[i];
     		priv->flow[i].priv = priv;
    -- 
    2.20.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 7+ messages in thread
  • * [PATCH AUTOSEL 4.19 54/81] drm/imx: don't skip DP channel disable for background plane
           [not found] <20190507053554.30848-1-sashal@kernel.org>
                       ` (3 preceding siblings ...)
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 53/81] gpu: ipu-v3: dp: fix CSC handling Sasha Levin
    @ 2019-05-07  5:35 ` Sasha Levin
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 59/81] drm/sun4i: Unbind components before releasing DRM and memory Sasha Levin
      5 siblings, 0 replies; 7+ messages in thread
    From: Sasha Levin @ 2019-05-07  5:35 UTC (permalink / raw)
      To: linux-kernel, stable; +Cc: Sasha Levin, dri-devel
    
    From: Lucas Stach <l.stach@pengutronix.de>
    
    [ Upstream commit 7bcde275eb1d0ac8793c77c7e666a886eb16633d ]
    
    In order to make sure that the plane color space gets reset correctly.
    
    Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
    Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/imx/ipuv3-crtc.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
    index 7d4b710b837a..11e2dcdd6b18 100644
    --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
    +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
    @@ -78,7 +78,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc,
     	if (disable_partial)
     		ipu_plane_disable(ipu_crtc->plane[1], true);
     	if (disable_full)
    -		ipu_plane_disable(ipu_crtc->plane[0], false);
    +		ipu_plane_disable(ipu_crtc->plane[0], true);
     }
     
     static void ipu_crtc_atomic_disable(struct drm_crtc *crtc,
    -- 
    2.20.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 7+ messages in thread
  • * [PATCH AUTOSEL 4.19 59/81] drm/sun4i: Unbind components before releasing DRM and memory
           [not found] <20190507053554.30848-1-sashal@kernel.org>
                       ` (4 preceding siblings ...)
      2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 54/81] drm/imx: don't skip DP channel disable for background plane Sasha Levin
    @ 2019-05-07  5:35 ` Sasha Levin
      5 siblings, 0 replies; 7+ messages in thread
    From: Sasha Levin @ 2019-05-07  5:35 UTC (permalink / raw)
      To: linux-kernel, stable
      Cc: Paul Kocialkowski, Sasha Levin, Chen-Yu Tsai, dri-devel
    
    From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    
    [ Upstream commit e02bc29b2cfa7806830d6da8b2322cddd67e8dfe ]
    
    Our components may still be using the DRM device driver (if only to
    access our driver's private data), so make sure to unbind them before
    the final drm_dev_put.
    
    Also release our reserved memory after component unbind instead of
    before to match reverse creation order.
    
    Fixes: f5a9ed867c83 ("drm/sun4i: Fix component unbinding and component master deletion")
    Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    Reviewed-by: Chen-Yu Tsai <wens@csie.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190424090413.6918-1-paul.kocialkowski@bootlin.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
     drivers/gpu/drm/sun4i/sun4i_drv.c | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
    index 62703630090a..57f61ec4bc6b 100644
    --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
    +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
    @@ -158,10 +158,11 @@ static void sun4i_drv_unbind(struct device *dev)
     	drm_kms_helper_poll_fini(drm);
     	sun4i_framebuffer_free(drm);
     	drm_mode_config_cleanup(drm);
    -	of_reserved_mem_device_release(dev);
    -	drm_dev_put(drm);
     
     	component_unbind_all(dev, NULL);
    +	of_reserved_mem_device_release(dev);
    +
    +	drm_dev_put(drm);
     }
     
     static const struct component_master_ops sun4i_drv_master_ops = {
    -- 
    2.20.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 7+ messages in thread

  • end of thread, other threads:[~2019-05-07  5:37 UTC | newest]
    
    Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20190507053554.30848-1-sashal@kernel.org>
         [not found] ` <20190507053554.30848-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
    2019-05-07  5:34   ` [PATCH AUTOSEL 4.19 20/81] drm/amd/display: extending AUX SW Timeout Sasha Levin
    2019-05-07  5:34   ` [PATCH AUTOSEL 4.19 28/81] drm/amd/display: If one stream full updates, full update all planes Sasha Levin
    2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 49/81] drm/sun4i: Set device driver data at bind time for use in unbind Sasha Levin
    2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 50/81] drm/sun4i: Fix component unbinding and component master deletion Sasha Levin
    2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 53/81] gpu: ipu-v3: dp: fix CSC handling Sasha Levin
    2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 54/81] drm/imx: don't skip DP channel disable for background plane Sasha Levin
    2019-05-07  5:35 ` [PATCH AUTOSEL 4.19 59/81] drm/sun4i: Unbind components before releasing DRM and memory Sasha Levin
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).