All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
	dri-devel@lists.freedesktop.org,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Dave Airlie" <airlied@redhat.com>
Subject: Re: [PATCH 1/2] drm: Shortcircuit vblank queries
Date: Tue, 14 Apr 2015 20:56:52 +0200	[thread overview]
Message-ID: <552D62F4.6080107@gmail.com> (raw)
In-Reply-To: <20150414183651.GP16216@nuc-i3427.alporthouse.com>



On 04/14/2015 08:36 PM, Chris Wilson wrote:
> On Tue, Apr 14, 2015 at 08:22:20PM +0200, Mario Kleiner wrote:
>> On 04/05/2015 05:40 PM, Chris Wilson wrote:
>>> Avoid adding to the waitqueue and reprobing the current vblank if the
>>> caller is only querying the current vblank sequence and timestamp and
>>> so we would return immediately.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>> Cc: Daniel Vetter <daniel@ffwll.ch>
>>> Cc: Michel Dänzer <michel@daenzer.net>
>>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>> Cc: Dave Airlie <airlied@redhat.com>,
>>> Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
>>> ---
>>>   drivers/gpu/drm/drm_irq.c | 18 ++++++++++--------
>>>   1 file changed, 10 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
>>> index 6f5dc18779e2..ba80b51b4b00 100644
>>> --- a/drivers/gpu/drm/drm_irq.c
>>> +++ b/drivers/gpu/drm/drm_irq.c
>>> @@ -1617,14 +1617,16 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
>>>   		vblwait->request.sequence = seq + 1;
>>>   	}
>>>
>>> -	DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
>>> -		  vblwait->request.sequence, crtc);
>>> -	vblank->last_wait = vblwait->request.sequence;
>>> -	DRM_WAIT_ON(ret, vblank->queue, 3 * HZ,
>>> -		    (((drm_vblank_count(dev, crtc) -
>>> -		       vblwait->request.sequence) <= (1 << 23)) ||
>>> -		     !vblank->enabled ||
>>> -		     !dev->irq_enabled));
>>> +	if (vblwait->request.sequence != seq) {
>>> +		DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
>>> +			  vblwait->request.sequence, crtc);
>>> +		vblank->last_wait = vblwait->request.sequence;
>>> +		DRM_WAIT_ON(ret, vblank->queue, 3 * HZ,
>>> +			    (((drm_vblank_count(dev, crtc) -
>>> +			       vblwait->request.sequence) <= (1 << 23)) ||
>>> +			     !vblank->enabled ||
>>> +			     !dev->irq_enabled));
>>> +	}
>>>
>>>   	if (ret != -EINTR) {
>>>   		struct timeval now;
>>>
>>
>> It would be good to have some DRM_DEBUG output for the skip-the-wait
>> case as well, so one can still follow from dmesg output when a
>> client does a drmWaitVblank call even if it is only a query.
>
> We still have DRM_DEBUG("returning %d to client"), as well as the
> drmIoctl:DRM_DEBUG(ioctl->name), is that not sufficient?
> -Chris
>

Oh right, that's good enough. Maybe add "on crtc %d" to that DRM_DEBUG, 
to make it unambiguous for which crtc some count is returned?

-mario
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-04-14 18:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 15:44 [PATCH] drm: Return current vblank value for drmWaitVBlank queries Chris Wilson
2015-03-18  2:53 ` Michel Dänzer
2015-03-18  3:13   ` Michel Dänzer
2015-03-18  9:30   ` Chris Wilson
2015-03-18 14:52     ` Mario Kleiner
2015-03-19 14:33       ` Daniel Vetter
2015-03-19 15:04         ` Ville Syrjälä
2015-03-19 15:13           ` Chris Wilson
2015-03-19 15:36             ` [Intel-gfx] " Chris Wilson
2015-03-19 16:43           ` Mario Kleiner
2015-03-18 17:57 ` shuang.he
2015-04-02 11:34 ` [PATCH] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off) Chris Wilson
2015-04-02 19:01   ` shuang.he
2015-04-03  2:20   ` Michel Dänzer
2015-04-03  9:06     ` Chris Wilson
2015-04-05 15:40   ` [PATCH 1/2] drm: Shortcircuit vblank queries Chris Wilson
2015-04-05 15:40     ` [PATCH 2/2] " Chris Wilson
2015-04-14 18:43       ` Mario Kleiner
2015-04-15  6:37         ` Daniel Vetter
2015-04-14  9:42     ` [PATCH 1/2] " Michel Dänzer
2015-04-14 14:21       ` Chris Wilson
2015-04-14 18:17         ` Mario Kleiner
2015-04-14 18:30           ` Chris Wilson
2015-04-15  3:50         ` Michel Dänzer
2015-04-14 18:22     ` Mario Kleiner
2015-04-14 18:36       ` Chris Wilson
2015-04-14 18:56         ` Mario Kleiner [this message]
2015-04-15  1:03   ` [PATCH] drm: Defer disabling the vblank IRQ until the next interrupt (for instant-off) Mario Kleiner
2015-05-04  5:25     ` Mario Kleiner
2015-05-04  9:02       ` [PATCH v2] " Chris Wilson

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=552D62F4.6080107@gmail.com \
    --to=mario.kleiner.de@gmail.com \
    --cc=airlied@redhat.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=michel@daenzer.net \
    --cc=ville.syrjala@linux.intel.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.