All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Jaime Velasco Juan <jsagarribay@gmail.com>
Cc: airlied@linux.ie, dri-devel@lists.sourceforge.net
Subject: Re: [PATCH] radeon/PM Really wait for vblank before reclocking
Date: Wed, 17 Feb 2010 19:33:39 +0100	[thread overview]
Message-ID: <b170af451002171033s6114c5c8x359b2f4ce505094c@mail.gmail.com> (raw)
In-Reply-To: <b170af451002171022k6a1cca22rcf88e08727294e9b@mail.gmail.com>

W dniu 17 lutego 2010 19:22 użytkownik Rafał Miłecki <zajec5@gmail.com> napisał:
> W dniu 15 lutego 2010 18:52 użytkownik Rafał Miłecki <zajec5@gmail.com> napisał:
>> 2010/2/15 Jaime Velasco Juan <jsagarribay@gmail.com>:
>>> The old code used a false condition so it always waited until
>>> timeout
>>>
>>> Signed-off-by: Jaime Velasco Juan <jsagarribay@gmail.com>
>>> ---
>>>  drivers/gpu/drm/radeon/radeon_pm.c |   10 ++++++----
>>>  1 files changed, 6 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
>>> index a8e151e..842952f 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_pm.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
>>> @@ -337,10 +337,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,
>>> -                       msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT));
>>> +       if (rdev->pm.active_crtcs) {
>>> +               long timeout = msecs_to_jiffies(RADEON_WAIT_VBLANK_TIMEOUT);
>>> +               __wait_event_interruptible_timeout(
>>> +                       rdev->irq.vblank_queue, 1,
>>> +                       timeout);
>>> +       }
>>
>> Yeah, it seems logic was wrong, thanks.
>
> To make it clear (I didn't understand that correctly earlier):
>
> include/linux/wait.h:
> wait_event_interruptible_timeout - sleep until a condition gets true
> or a timeout elapses
>
> So using your __ prefix and "1" as condition argument is some hack
> that could work indeed...
>
> But maybe there is some "real" kernel function that simply waits for
> wake_up with timeout?

Your solution doesn't work because __wait_event_interruptible checks
once more for condition before scheduling. If finds "1" and so it
breaks loop immediately.

-- 
Rafał

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

      reply	other threads:[~2010-02-17 18:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 15:09 [PATCH] radeon/PM Really wait for vblank before reclocking Jaime Velasco Juan
2010-02-15 17:52 ` Rafał Miłecki
2010-02-16 13:41   ` Jaime Velasco Juan
2010-02-16 15:54     ` Alex Deucher
2010-02-17 18:22   ` Rafał Miłecki
2010-02-17 18:33     ` Rafał Miłecki [this message]

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=b170af451002171033s6114c5c8x359b2f4ce505094c@mail.gmail.com \
    --to=zajec5@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jsagarribay@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.