From: Jaime Velasco Juan <jsagarribay@gmail.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: dri-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/2] drm/radeon/kms: switch to condition waiting for reclocking
Date: Wed, 3 Mar 2010 18:47:02 +0000 [thread overview]
Message-ID: <20100303184702.GA4309@pogo> (raw)
In-Reply-To: <1267564012-3710-1-git-send-email-zajec5@gmail.com>
El mar. 02 de mar. de 2010, a las 22:06:51 +0100, Rafał Miłecki escribió:
> We tried to implement interruptible waiting with timeout (it was broken
> anyway) which was not a good idea as explained by Andrew. It's possible
> to avoid using additional variable but actually it inroduces using more
> complex in-kernel tools. So simply add one variable for condition.
>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
This seems to work now, although there are "not in vbl..." messages. It's
possible there are some corruptions still, but I haven't noticed any:
[ 479.503327] [drm] Requested: e: 68000 m: 80000 p: 16
[ 479.503339] [drm] Setting: e: 68000 m: 80000 p: 16
[ 479.503383] [drm] not in vbl for pm change 00020002 00000000 at entry
[ 479.503525] [drm] not in vbl for pm change 00020002 00000000 at exit
[ 479.903366] [drm] Requested: e: 11000 m: 40500 p: 16
[ 479.903376] [drm] Setting: e: 11000 m: 40500 p: 16
[ 483.106679] [drm] Requested: e: 68000 m: 80000 p: 16
[ 483.106689] [drm] Setting: e: 68000 m: 80000 p: 16
[ 483.118542] [drm] not in vbl for pm change 00020002 00000000 at exit
[ 483.616689] [drm] Requested: e: 11000 m: 40500 p: 16
[ 483.616698] [drm] Setting: e: 11000 m: 40500 p: 16
[ 483.617637] [drm] not in vbl for pm change 00020002 00000000 at exit
Tested-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Thanks.
> drivers/gpu/drm/radeon/r100.c | 2 ++
> drivers/gpu/drm/radeon/r600.c | 2 ++
> drivers/gpu/drm/radeon/radeon.h | 1 +
> drivers/gpu/drm/radeon/radeon_pm.c | 8 +++++---
> drivers/gpu/drm/radeon/rs600.c | 2 ++
> 5 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 91eb762..73f9a79 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -312,10 +312,12 @@ int r100_irq_process(struct radeon_device *rdev)
> /* Vertical blank interrupts */
> if (status & RADEON_CRTC_VBLANK_STAT) {
> drm_handle_vblank(rdev->ddev, 0);
> + rdev->pm.vblank_sync = true;
> wake_up(&rdev->irq.vblank_queue);
> }
> if (status & RADEON_CRTC2_VBLANK_STAT) {
> drm_handle_vblank(rdev->ddev, 1);
> + rdev->pm.vblank_sync = true;
> wake_up(&rdev->irq.vblank_queue);
> }
> if (status & RADEON_FP_DETECT_STAT) {
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index c522901..5b56a1b 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -2765,6 +2765,7 @@ restart_ih:
> case 0: /* D1 vblank */
> if (disp_int & LB_D1_VBLANK_INTERRUPT) {
> drm_handle_vblank(rdev->ddev, 0);
> + rdev->pm.vblank_sync = true;
> wake_up(&rdev->irq.vblank_queue);
> disp_int &= ~LB_D1_VBLANK_INTERRUPT;
> DRM_DEBUG("IH: D1 vblank\n");
> @@ -2786,6 +2787,7 @@ restart_ih:
> case 0: /* D2 vblank */
> if (disp_int & LB_D2_VBLANK_INTERRUPT) {
> drm_handle_vblank(rdev->ddev, 1);
> + rdev->pm.vblank_sync = true;
> wake_up(&rdev->irq.vblank_queue);
> disp_int &= ~LB_D2_VBLANK_INTERRUPT;
> DRM_DEBUG("IH: D2 vblank\n");
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index 829e26e..0d7caee 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -687,6 +687,7 @@ struct radeon_pm {
> bool downclocked;
> int active_crtcs;
> int req_vblank;
> + bool vblank_sync;
> fixed20_12 max_bandwidth;
> fixed20_12 igp_sideport_mclk;
> fixed20_12 igp_system_mclk;
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index d4d1c39..d800b86 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -353,10 +353,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
> rdev->pm.req_vblank |= (1 << 1);
> drm_vblank_get(rdev->ddev, 1);
> }
> - if (rdev->pm.active_crtcs)
> - wait_event_interruptible_timeout(
> - rdev->irq.vblank_queue, 0,
> + if (rdev->pm.active_crtcs) {
> + rdev->pm.vblank_sync = false;
> + wait_event_timeout(
> + rdev->irq.vblank_queue, rdev->pm.vblank_sync,
> msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT));
> + }
> if (rdev->pm.req_vblank & (1 << 0)) {
> rdev->pm.req_vblank &= ~(1 << 0);
> drm_vblank_put(rdev->ddev, 0);
> diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
> index 47f046b..ac7c27a 100644
> --- a/drivers/gpu/drm/radeon/rs600.c
> +++ b/drivers/gpu/drm/radeon/rs600.c
> @@ -392,10 +392,12 @@ int rs600_irq_process(struct radeon_device *rdev)
> /* Vertical blank interrupts */
> if (G_007EDC_LB_D1_VBLANK_INTERRUPT(r500_disp_int)) {
> drm_handle_vblank(rdev->ddev, 0);
> + rdev->pm.vblank_sync = true;
> wake_up(&rdev->irq.vblank_queue);
> }
> if (G_007EDC_LB_D2_VBLANK_INTERRUPT(r500_disp_int)) {
> drm_handle_vblank(rdev->ddev, 1);
> + rdev->pm.vblank_sync = true;
> wake_up(&rdev->irq.vblank_queue);
> }
> if (G_007EDC_DC_HOT_PLUG_DETECT1_INTERRUPT(r500_disp_int)) {
> --
> 1.6.4.2
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
next prev parent reply other threads:[~2010-03-03 18:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 21:06 [PATCH 1/2] drm/radeon/kms: switch to condition waiting for reclocking Rafał Miłecki
2010-03-02 21:06 ` [PATCH 2/2] drm/radeon/kms: prepare for more reclocking operations Rafał Miłecki
2010-03-03 18:47 ` Jaime Velasco Juan [this message]
2010-03-03 22:11 ` [PATCH 1/2] drm/radeon/kms: switch to condition waiting for reclocking Rafał Miłecki
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=20100303184702.GA4309@pogo \
--to=jsagarribay@gmail.com \
--cc=dri-devel@lists.sourceforge.net \
--cc=zajec5@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 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.