dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paul Menzel <pmenzel+amd-gfx-KUpvgZVWgV9o1qOY/usvUg@public.gmane.org>
To: Mario Kleiner <mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Nicholas Kazlauskas
	<nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 3/4] drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank.
Date: Tue, 19 Mar 2019 08:17:54 +0100	[thread overview]
Message-ID: <35d35342-e6a5-189e-e4f3-f5b2d693754a@molgen.mpg.de> (raw)
In-Reply-To: <20190318171952.24302-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Dear Mario,


On 18.03.19 18:19, Mario Kleiner wrote:
> In VRR mode, proper vblank/pageflip timestamps can only be computed
> after the display scanout position has left front-porch. Therefore
> delay calls to drm_crtc_handle_vblank(), and thereby calls to
> drm_update_vblank_count() and pageflip event delivery, to after the
> end of front-porch when in VRR mode.
> 
> We add a new vupdate irq, which triggers at the end of the vupdate
> interval, ie. at the end of vblank, and calls the core vblank handler
> function. The new irq handler is not executed in standard non-VRR
> mode, so vblank handling for fixed refresh rate mode is identical
> to the past implementation.
> 
> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h                |   1 +
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 129 ++++++++++++++++++++-
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |   9 ++
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c  |  22 ++++
>   .../amd/display/dc/irq/dce110/irq_service_dce110.c |   7 +-
>   .../amd/display/dc/irq/dce120/irq_service_dce120.c |   7 +-
>   .../amd/display/dc/irq/dce80/irq_service_dce80.c   |   6 +-
>   .../amd/display/dc/irq/dcn10/irq_service_dcn10.c   |  40 +++++--
>   8 files changed, 205 insertions(+), 16 deletions(-)

[…]

`scripts/checkpatch.pl` shows two errors on your commit.

> +	/* Use VUPDATE interrupt */
> +	for (i = VISLANDS30_IV_SRCID_D1_V_UPDATE_INT; i <= VISLANDS30_IV_SRCID_D6_V_UPDATE_INT; i+=2) {

ERROR: spaces required around that '+=' (ctx:VxV)
#107: FILE: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1490:
+	for (i = VISLANDS30_IV_SRCID_D1_V_UPDATE_INT; i <= 
VISLANDS30_IV_SRCID_D6_V_UPDATE_INT; i+=2) {
  	 
                    ^

[…]

>   static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
>   {
>   	enum dc_irq_source irq_source;
>   	struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
>   	struct amdgpu_device *adev = crtc->dev->dev_private;
> +	struct dm_crtc_state *acrtc_state = to_dm_crtc_state(crtc->state);
> +	int rc = 0;
> +
> +	if (enable) {
> +		/* vblank irq on -> Only need vupdate irq in vrr mode */
> +		if (amdgpu_dm_vrr_active(acrtc_state))
> +			rc = dm_set_vupdate_irq(crtc, true);
> +	}
> +	else {
> +		/* vblank irq off -> vupdate irq off */
> +		rc = dm_set_vupdate_irq(crtc, false);
> +	}

ERROR: else should follow close brace '}'
#198: FILE: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:3346:
+	}
+	else {

Also:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
#258: FILE: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c:679:
+					   unsigned crtc_id,

[…]


Kind regards,

Paul
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-03-19  7:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 17:19 AMD Freesync patches for proper vblank and pageflip timestamping in VRR mode Mario Kleiner
2019-03-18 17:19 ` [PATCH 1/4] drm/amd/display: Prevent vblank irq disable while VRR is active Mario Kleiner
     [not found]   ` <20190318171952.24302-2-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-03-18 17:29     ` Kazlauskas, Nicholas
2019-03-20  8:14       ` Mario Kleiner
     [not found] ` <20190318171952.24302-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-03-18 17:19   ` [PATCH 2/4] drm/amd/display: Rework vrr flip throttling for late vblank irq Mario Kleiner
2019-03-18 17:59     ` Kazlauskas, Nicholas
2019-03-18 17:19   ` [PATCH 4/4] drm/amd/display: Make pageflip event delivery compatible with VRR Mario Kleiner
     [not found]     ` <20190318171952.24302-5-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-03-19 13:05       ` Kazlauskas, Nicholas
2019-03-18 17:19 ` [PATCH 3/4] drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank Mario Kleiner
     [not found]   ` <20190318171952.24302-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-03-19  7:17     ` Paul Menzel [this message]
2019-03-19 13:23     ` Kazlauskas, Nicholas
     [not found]       ` <8ef78169-1893-0aee-9cb1-cce4054ebbcc-5C7GfCeVMHo@public.gmane.org>
2019-03-19 13:32         ` Kazlauskas, Nicholas
2019-03-20  7:51           ` Mario Kleiner
2019-03-20 12:53             ` Kazlauskas, Nicholas
     [not found]               ` <b00cc1c5-f710-6c75-cdd2-c9ad30c633aa-5C7GfCeVMHo@public.gmane.org>
2019-03-21  9:39                 ` Mario Kleiner
2019-03-21 15:38                   ` Wentland, Harry
     [not found]                     ` <929bad72-fb12-661e-d7e3-ac837d32c01c-5C7GfCeVMHo@public.gmane.org>
2019-03-21 15:48                       ` Kazlauskas, Nicholas

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=35d35342-e6a5-189e-e4f3-f5b2d693754a@molgen.mpg.de \
    --to=pmenzel+amd-gfx-kupvgzvwgv9o1qoy/usvug@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.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 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).