All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: John Keeping <john@metanate.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org, stable@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] drm/rockchip: allocate correct crtc state structure on reset
Date: Fri, 15 Jul 2016 10:46:38 +0800	[thread overview]
Message-ID: <57884E8E.3000504@rock-chips.com> (raw)
In-Reply-To: <20160714152915.31235-1-john@metanate.com>

On 2016年07月14日 23:29, John Keeping wrote:
> Because we are using a custom crtc_state structure, we must override the
> reset helper to allocate the correct amount of memory.
>
> Cc: stable@vger.kernel.org
> Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
Thanks for the fixes, Applied to my drm-fixes


> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 1c4d5b5a70a2..21e1247098be 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1048,6 +1048,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)
>   	drm_crtc_cleanup(crtc);
>   }
>   
> +static void vop_crtc_reset(struct drm_crtc *crtc)
> +{
> +	if (crtc->state)
> +		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
> +	kfree(crtc->state);
> +
> +	crtc->state = kzalloc(sizeof(struct rockchip_crtc_state), GFP_KERNEL);
> +	if (crtc->state)
> +		crtc->state->crtc = crtc;
> +}
> +
>   static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc)
>   {
>   	struct rockchip_crtc_state *rockchip_state;
> @@ -1073,7 +1084,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = {
>   	.set_config = drm_atomic_helper_set_config,
>   	.page_flip = drm_atomic_helper_page_flip,
>   	.destroy = vop_crtc_destroy,
> -	.reset = drm_atomic_helper_crtc_reset,
> +	.reset = vop_crtc_reset,
>   	.atomic_duplicate_state = vop_crtc_duplicate_state,
>   	.atomic_destroy_state = vop_crtc_destroy_state,
>   };


-- 
Mark Yao


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: mark.yao@rock-chips.com (Mark yao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drm/rockchip: allocate correct crtc state structure on reset
Date: Fri, 15 Jul 2016 10:46:38 +0800	[thread overview]
Message-ID: <57884E8E.3000504@rock-chips.com> (raw)
In-Reply-To: <20160714152915.31235-1-john@metanate.com>

On 2016?07?14? 23:29, John Keeping wrote:
> Because we are using a custom crtc_state structure, we must override the
> reset helper to allocate the correct amount of memory.
>
> Cc: stable at vger.kernel.org
> Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
Thanks for the fixes, Applied to my drm-fixes


> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 1c4d5b5a70a2..21e1247098be 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1048,6 +1048,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)
>   	drm_crtc_cleanup(crtc);
>   }
>   
> +static void vop_crtc_reset(struct drm_crtc *crtc)
> +{
> +	if (crtc->state)
> +		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
> +	kfree(crtc->state);
> +
> +	crtc->state = kzalloc(sizeof(struct rockchip_crtc_state), GFP_KERNEL);
> +	if (crtc->state)
> +		crtc->state->crtc = crtc;
> +}
> +
>   static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc)
>   {
>   	struct rockchip_crtc_state *rockchip_state;
> @@ -1073,7 +1084,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = {
>   	.set_config = drm_atomic_helper_set_config,
>   	.page_flip = drm_atomic_helper_page_flip,
>   	.destroy = vop_crtc_destroy,
> -	.reset = drm_atomic_helper_crtc_reset,
> +	.reset = vop_crtc_reset,
>   	.atomic_duplicate_state = vop_crtc_duplicate_state,
>   	.atomic_destroy_state = vop_crtc_destroy_state,
>   };


-- 
?ark Yao

WARNING: multiple messages have this Message-ID (diff)
From: Mark yao <mark.yao@rock-chips.com>
To: John Keeping <john@metanate.com>
Cc: David Airlie <airlied@linux.ie>, Heiko Stuebner <heiko@sntech.de>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] drm/rockchip: allocate correct crtc state structure on reset
Date: Fri, 15 Jul 2016 10:46:38 +0800	[thread overview]
Message-ID: <57884E8E.3000504@rock-chips.com> (raw)
In-Reply-To: <20160714152915.31235-1-john@metanate.com>

On 2016年07月14日 23:29, John Keeping wrote:
> Because we are using a custom crtc_state structure, we must override the
> reset helper to allocate the correct amount of memory.
>
> Cc: stable@vger.kernel.org
> Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
Thanks for the fixes, Applied to my drm-fixes


> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 1c4d5b5a70a2..21e1247098be 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1048,6 +1048,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)
>   	drm_crtc_cleanup(crtc);
>   }
>   
> +static void vop_crtc_reset(struct drm_crtc *crtc)
> +{
> +	if (crtc->state)
> +		__drm_atomic_helper_crtc_destroy_state(crtc, crtc->state);
> +	kfree(crtc->state);
> +
> +	crtc->state = kzalloc(sizeof(struct rockchip_crtc_state), GFP_KERNEL);
> +	if (crtc->state)
> +		crtc->state->crtc = crtc;
> +}
> +
>   static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc)
>   {
>   	struct rockchip_crtc_state *rockchip_state;
> @@ -1073,7 +1084,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = {
>   	.set_config = drm_atomic_helper_set_config,
>   	.page_flip = drm_atomic_helper_page_flip,
>   	.destroy = vop_crtc_destroy,
> -	.reset = drm_atomic_helper_crtc_reset,
> +	.reset = vop_crtc_reset,
>   	.atomic_duplicate_state = vop_crtc_duplicate_state,
>   	.atomic_destroy_state = vop_crtc_destroy_state,
>   };


-- 
Mark Yao

  parent reply	other threads:[~2016-07-15  2:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 15:29 [PATCH] drm/rockchip: allocate correct crtc state structure on reset John Keeping
2016-07-14 15:29 ` John Keeping
2016-07-14 15:29 ` John Keeping
2016-07-14 15:35 ` Sean Paul
2016-07-14 15:35   ` Sean Paul
2016-07-14 15:35   ` Sean Paul
2016-07-15  2:46 ` Mark yao [this message]
2016-07-15  2:46   ` Mark yao
2016-07-15  2:46   ` Mark yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57884E8E.3000504@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john@metanate.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.