All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Deng, Emily" <Emily.Deng-5C7GfCeVMHo@public.gmane.org>
To: Alex Deucher
	<alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "Deucher, Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>
Subject: RE: [PATCH 3/7] drm/amdgpu/virtual_dce: clean up interrupt handling
Date: Sat, 8 Oct 2016 08:23:01 +0000	[thread overview]
Message-ID: <DM5PR12MB1659E6A3FC4E0DC150350F258FD90@DM5PR12MB1659.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1475255328-21598-3-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>

Reviewed-By: Emily Deng <Emily.Deng@amd.com>

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Alex Deucher
> Sent: Saturday, October 01, 2016 1:09 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: [PATCH 3/7] drm/amdgpu/virtual_dce: clean up interrupt handling
> 
> We handle the virtual interrupts from a timer so no need to try an look like
> we are handling IV ring events.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 109 +++++++++++++++--------
> --------
>  1 file changed, 54 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 8163622..29e0ce0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -39,9 +39,6 @@
> 
>  static void dce_virtual_set_display_funcs(struct amdgpu_device *adev);
> static void dce_virtual_set_irq_funcs(struct amdgpu_device *adev); -static
> int dce_virtual_pageflip_irq(struct amdgpu_device *adev,
> -				  struct amdgpu_irq_src *source,
> -				  struct amdgpu_iv_entry *entry);
> 
>  /**
>   * dce_virtual_vblank_wait - vblank wait asic callback.
> @@ -659,14 +656,64 @@ static void dce_virtual_set_display_funcs(struct
> amdgpu_device *adev)
>  		adev->mode_info.funcs = &dce_virtual_display_funcs;  }
> 
> +static int dce_virtual_pageflip(struct amdgpu_device *adev,
> +				unsigned crtc_id)
> +{
> +	unsigned long flags;
> +	struct amdgpu_crtc *amdgpu_crtc;
> +	struct amdgpu_flip_work *works;
> +
> +	amdgpu_crtc = adev->mode_info.crtcs[crtc_id];
> +
> +	if (crtc_id >= adev->mode_info.num_crtc) {
> +		DRM_ERROR("invalid pageflip crtc %d\n", crtc_id);
> +		return -EINVAL;
> +	}
> +
> +	/* IRQ could occur when in initial stage */
> +	if (amdgpu_crtc == NULL)
> +		return 0;
> +
> +	spin_lock_irqsave(&adev->ddev->event_lock, flags);
> +	works = amdgpu_crtc->pflip_works;
> +	if (amdgpu_crtc->pflip_status != AMDGPU_FLIP_SUBMITTED) {
> +		DRM_DEBUG_DRIVER("amdgpu_crtc->pflip_status = %d != "
> +			"AMDGPU_FLIP_SUBMITTED(%d)\n",
> +			amdgpu_crtc->pflip_status,
> +			AMDGPU_FLIP_SUBMITTED);
> +		spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
> +		return 0;
> +	}
> +
> +	/* page flip completed. clean up */
> +	amdgpu_crtc->pflip_status = AMDGPU_FLIP_NONE;
> +	amdgpu_crtc->pflip_works = NULL;
> +
> +	/* wakeup usersapce */
> +	if (works->event)
> +		drm_crtc_send_vblank_event(&amdgpu_crtc->base, works-
> >event);
> +
> +	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
> +
> +	drm_crtc_vblank_put(&amdgpu_crtc->base);
> +	schedule_work(&works->unpin_work);
> +
> +	return 0;
> +}
> +
>  static enum hrtimer_restart dce_virtual_vblank_timer_handle(struct hrtimer
> *vblank_timer)  {
> -	struct amdgpu_mode_info *mode_info = container_of(vblank_timer,
> struct amdgpu_mode_info ,vblank_timer);
> -	struct amdgpu_device *adev = container_of(mode_info, struct
> amdgpu_device ,mode_info);
> +	struct amdgpu_mode_info *mode_info =
> +		container_of(vblank_timer, struct amdgpu_mode_info ,
> vblank_timer);
> +	struct amdgpu_device *adev =
> +		container_of(mode_info, struct amdgpu_device ,
> mode_info);
>  	unsigned crtc = 0;
> +
>  	drm_handle_vblank(adev->ddev, crtc);
> -	dce_virtual_pageflip_irq(adev, NULL, NULL);
> -	hrtimer_start(vblank_timer, ktime_set(0,
> DCE_VIRTUAL_VBLANK_PERIOD), HRTIMER_MODE_REL);
> +	dce_virtual_pageflip(adev, crtc);
> +	hrtimer_start(vblank_timer, ktime_set(0,
> DCE_VIRTUAL_VBLANK_PERIOD),
> +		      HRTIMER_MODE_REL);
> +
>  	return HRTIMER_NORESTART;
>  }
> 
> @@ -710,54 +757,6 @@ static int dce_virtual_set_crtc_irq_state(struct
> amdgpu_device *adev,
>  	return 0;
>  }
> 
> -static int dce_virtual_pageflip_irq(struct amdgpu_device *adev,
> -				  struct amdgpu_irq_src *source,
> -				  struct amdgpu_iv_entry *entry)
> -{
> -	unsigned long flags;
> -	unsigned crtc_id = 0;
> -	struct amdgpu_crtc *amdgpu_crtc;
> -	struct amdgpu_flip_work *works;
> -
> -	crtc_id = 0;
> -	amdgpu_crtc = adev->mode_info.crtcs[crtc_id];
> -
> -	if (crtc_id >= adev->mode_info.num_crtc) {
> -		DRM_ERROR("invalid pageflip crtc %d\n", crtc_id);
> -		return -EINVAL;
> -	}
> -
> -	/* IRQ could occur when in initial stage */
> -	if (amdgpu_crtc == NULL)
> -		return 0;
> -
> -	spin_lock_irqsave(&adev->ddev->event_lock, flags);
> -	works = amdgpu_crtc->pflip_works;
> -	if (amdgpu_crtc->pflip_status != AMDGPU_FLIP_SUBMITTED) {
> -		DRM_DEBUG_DRIVER("amdgpu_crtc->pflip_status = %d != "
> -			"AMDGPU_FLIP_SUBMITTED(%d)\n",
> -			amdgpu_crtc->pflip_status,
> -			AMDGPU_FLIP_SUBMITTED);
> -		spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
> -		return 0;
> -	}
> -
> -	/* page flip completed. clean up */
> -	amdgpu_crtc->pflip_status = AMDGPU_FLIP_NONE;
> -	amdgpu_crtc->pflip_works = NULL;
> -
> -	/* wakeup usersapce */
> -	if (works->event)
> -		drm_crtc_send_vblank_event(&amdgpu_crtc->base, works-
> >event);
> -
> -	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
> -
> -	drm_crtc_vblank_put(&amdgpu_crtc->base);
> -	schedule_work(&works->unpin_work);
> -
> -	return 0;
> -}
> -
>  static const struct amdgpu_irq_src_funcs dce_virtual_crtc_irq_funcs = {
>  	.set = dce_virtual_set_crtc_irq_state,
>  	.process = NULL,
> --
> 2.5.5
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2016-10-08  8:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30 17:08 [PATCH 1/7] drm/amdgpu/virtual_dce: drop pageflip_irq funcs Alex Deucher
     [not found] ` <1475255328-21598-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-09-30 17:08   ` [PATCH 2/7] drm/amdgpu/virtual_dce: no need to an irq process callback Alex Deucher
     [not found]     ` <1475255328-21598-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-10-08  8:22       ` Deng, Emily
2016-09-30 17:08   ` [PATCH 3/7] drm/amdgpu/virtual_dce: clean up interrupt handling Alex Deucher
     [not found]     ` <1475255328-21598-3-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-10-08  8:23       ` Deng, Emily [this message]
2016-10-08  8:23       ` Deng, Emily
2016-09-30 17:08   ` [PATCH 4/7] drm/amdgpu: simplify encoder and connector setup Alex Deucher
     [not found]     ` <1475255328-21598-4-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-10-08  8:22       ` Deng, Emily
2016-09-30 17:08   ` [PATCH 5/7] Revert "drm/amdgpu: Add virtual connector and encoder macros." Alex Deucher
     [not found]     ` <1475255328-21598-5-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-10-08  8:22       ` Deng, Emily
2016-09-30 17:08   ` [PATCH 6/7] drm/amdgpu: rename amdgpu_whether_enable_virtual_display Alex Deucher
     [not found]     ` <1475255328-21598-6-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-10-08  8:23       ` Deng, Emily
2016-09-30 17:08   ` [PATCH 7/7] drm/amd/amdgpu: For virtual display, enable multi crtcs. (v3) Alex Deucher
     [not found]     ` <1475255328-21598-7-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2016-10-08  8:22       ` Deng, Emily
2016-09-30 17:52   ` [PATCH 1/7] drm/amdgpu/virtual_dce: drop pageflip_irq funcs Christian König
2016-10-08  8:24   ` Deng, Emily

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=DM5PR12MB1659E6A3FC4E0DC150350F258FD90@DM5PR12MB1659.namprd12.prod.outlook.com \
    --to=emily.deng-5c7gfcevmho@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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 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.