dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Oleg Vasilev <oleg.vasilev@intel.com>
Cc: Shayenne Moura <shayenneluzmoura@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/vkms: stop generating CRCs on buffer overflow
Date: Thu, 13 Jun 2019 15:07:11 +0200	[thread overview]
Message-ID: <20190613130711.GL23020@phenom.ffwll.local> (raw)
In-Reply-To: <20190613121802.2193-2-oleg.vasilev@intel.com>

On Thu, Jun 13, 2019 at 03:18:01PM +0300, Oleg Vasilev wrote:
> Because interrupts are generated artifitially, kernel bug may lead to
> infinte attempts to submit CRC.
> 
> Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
> ---
>  drivers/gpu/drm/vkms/vkms_crc.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_crc.c b/drivers/gpu/drm/vkms/vkms_crc.c
> index d7b409a3c0f8..bc717a8888b5 100644
> --- a/drivers/gpu/drm/vkms/vkms_crc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crc.c
> @@ -167,6 +167,7 @@ void vkms_crc_work_handle(struct work_struct *work)
>  	u32 crc32 = 0;
>  	u64 frame_start, frame_end;
>  	unsigned long flags;
> +	int ret;
>  
>  	spin_lock_irqsave(&out->state_lock, flags);
>  	frame_start = crtc_state->frame_start;
> @@ -202,7 +203,14 @@ void vkms_crc_work_handle(struct work_struct *work)
>  	 * missing frames
>  	 */
>  	while (frame_start <= frame_end)
> -		drm_crtc_add_crc_entry(crtc, true, frame_start++, &crc32);
> +	{

Bikeshed: Kernel codingstyle puts this on the same line as the closing )
of the while/if/for.

Aside from that not sure that's useful here, we've fixed the bug by now
...
-Daniel

> +		ret = drm_crtc_add_crc_entry(crtc, true, frame_start++, &crc32);
> +		if (ret) {
> +			DRM_WARN("VKMS stop generating CRCs\n");
> +			out->crc_enabled = false;
> +			break;
> +		}
> +	}
>  
>  out:
>  	/* to avoid using the same value for frame number again */
> -- 
> 2.21.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-06-13 13:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 12:18 [PATCH 1/3] drm: add debug print to update_vblank_count Oleg Vasilev
2019-06-13 12:18 ` [PATCH 2/3] drm/vkms: stop generating CRCs on buffer overflow Oleg Vasilev
2019-06-13 13:07   ` Daniel Vetter [this message]
2019-06-18  1:53     ` Rodrigo Siqueira
2019-06-18  8:38       ` Daniel Vetter
2019-06-13 12:18 ` [PATCH 3/3] drm/vkms: add crc sources list Oleg Vasilev
2019-06-18  2:14   ` Rodrigo Siqueira
2019-06-19  2:10   ` Rodrigo Siqueira
2019-06-14 16:19 ` [PATCH 1/3] drm: add debug print to update_vblank_count Ville Syrjälä

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=20190613130711.GL23020@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=oleg.vasilev@intel.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=shayenneluzmoura@gmail.com \
    /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 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).