linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Subject: Re: [PATCH v2 4/5] drm/tegra: Implement VBLANK support
Date: Fri, 15 Feb 2013 23:38:14 +0100	[thread overview]
Message-ID: <511EB8D6.8090401@gmail.com> (raw)
In-Reply-To: <20130211091301.GC3423@avionic-0098.mockup.avionic-design.de>


[-- Attachment #1.1: Type: text/plain, Size: 2792 bytes --]

On 02/11/2013 10:13 AM, Thierry Reding wrote:
> On Tue, Jan 22, 2013 at 06:37:39PM +0100, Mario Kleiner wrote:
>> On 14.01.13 17:05, Thierry Reding wrote:
>>> Implement support for the VBLANK IOCTL. Note that Tegra is somewhat
>>> special in this case because it doesn't use the generic IRQ support
>>> provided by the DRM core (DRIVER_HAVE_IRQ) but rather registers one
>>> interrupt handler for each display controller.
>>>
>>> While at it, clean up the way that interrupts are enabled to ensure
>>> that the VBLANK interrupt only gets enabled when required.
>>>
>>> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
>> ... snip ...
>>
>>>   struct drm_driver tegra_drm_driver = {
>>>   	.driver_features = DRIVER_BUS_PLATFORM | DRIVER_MODESET | DRIVER_GEM,
>>>   	.load = tegra_drm_load,
>>> @@ -96,6 +136,10 @@ struct drm_driver tegra_drm_driver = {
>>>   	.open = tegra_drm_open,
>>>   	.lastclose = tegra_drm_lastclose,
>>>
>>> +	.get_vblank_counter = drm_vblank_count,
>> -> .get_vblank_counter = drm_vblank_count is a no-op.
>>
>> .get_vblank_counter() is supposed to return some real hardware
>> vblank counter value to reinitialize the software vblank counter at
>> vbl irq enable time. That software counter gets queried via
>> drm_vblank_count(). If you hook this up to drm_vblank_count() it
>> essentially returns a constant, frozen vblank count, it has the same
>> effect as returning zero or any other constant value -- You lose all
>> vblank counter increments during vblank irq off time. The same
>> problem is present in nouveau-kms.
>>
>> I think it would be better to either implement a real hw counter
>> query, or some function with a /* TODO: Implement me properly */
>> comment which returns zero, so it is clear something is missing
>> here.
> I've finally managed to find some time to look into this some more. The
> comment atop the drm_driver.get_vblank_counter() field actually suggests
> that drivers should set this to drm_vblank_count if no real hardware
> counter is supported.

It certainly works fine that way. I just think it hides that some 
implementation is missing there, whereas an extra no-op function makes 
that clear to the reader.

> Now it seems like we may get functionality to obtain the real VBLANK
> counter once the syncpoint support is merged, so maybe we can leave this
> as-is until then and replace it with a proper implementation at that
> point in time?

Perfectly fine with me.

ciao,
-mario

> Alternatively I could use a small wrapper with an explicit comment that
> this should be implemented using the upcoming syncpoint support.
>
> Thierry
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


[-- Attachment #1.2: Type: text/html, Size: 4131 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2013-02-15 22:38 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 16:05 [PATCH v2 0/5] drm/tegra: Miscellaneous enhancements Thierry Reding
     [not found] ` <1358179560-26799-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-14 16:05   ` [PATCH v2 1/5] drm: Allow vblank support without DRIVER_HAVE_IRQ Thierry Reding
2013-01-14 16:05   ` [PATCH v2 2/5] drm/tegra: Add plane support Thierry Reding
     [not found]     ` <1358179560-26799-3-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-14 17:03       ` Lucas Stach
2013-01-15 11:19         ` Thierry Reding
2013-01-15  9:53       ` Mark Zhang
     [not found]         ` <50F526FF.1010101-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-15 10:50           ` Lucas Stach
2013-01-18  3:59             ` Mark Zhang
2013-01-15 11:35           ` Ville Syrjälä
     [not found]             ` <20130115113532.GC3503-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-01-15 11:50               ` Thierry Reding
2013-01-14 16:05   ` [PATCH v2 3/5] drm/tegra: Implement .mode_set_base() Thierry Reding
     [not found]     ` <1358179560-26799-4-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-14 17:14       ` Lucas Stach
2013-01-17  6:10       ` Mark Zhang
2013-01-14 16:05   ` [PATCH v2 4/5] drm/tegra: Implement VBLANK support Thierry Reding
     [not found]     ` <1358179560-26799-5-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-22 17:37       ` Mario Kleiner
     [not found]         ` <50FECE63.7090009-TdbV1Z3I5XE0NhjG498hmQ@public.gmane.org>
2013-01-22 18:39           ` Lucas Stach
2013-01-22 18:49             ` Jon Mayo
     [not found]               ` <CADWT_cOjVg9-hB+jWuEUr+Ou-YECBN73WQXNy17qXf3TO1ZjpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-22 19:59                 ` Mario Kleiner
     [not found]                   ` <50FEEF92.9060009-TdbV1Z3I5XE0NhjG498hmQ@public.gmane.org>
2013-01-23  8:02                     ` Terje Bergström
     [not found]                       ` <50FF990C.3040902-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-02-11  9:08                         ` Thierry Reding
     [not found]                           ` <20130211090840.GB3423-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-02-11 15:43                             ` Terje Bergström
2013-01-22 19:20             ` Mario Kleiner
     [not found]               ` <50FEE681.7020208-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-22 19:27                 ` Jon Mayo
     [not found]                   ` <CADWT_cOpSBR+DiKwQ4PvYk8-o88Wf5=Tz+ho_g4MdUVKMtc-dw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-22 20:08                     ` Mario Kleiner
2013-02-11  9:13           ` Thierry Reding
2013-02-15 22:38             ` Mario Kleiner [this message]
2013-01-14 16:06   ` [PATCH v2 5/5] drm/tegra: Implement page-flipping support Thierry Reding
     [not found]     ` <1358179560-26799-6-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2013-01-16 11:10       ` Mark Zhang
     [not found]         ` <50F68AB2.4030408-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-01-16 11:53           ` Lucas Stach
2013-01-17  4:49             ` Mark Zhang
2013-01-17  6:33       ` Mark Zhang
2013-01-22  8:31       ` Terje Bergström
     [not found]         ` <50FE4E4F.6080506-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-22  8:57           ` Thierry Reding
     [not found]             ` <20130122085756.GA6315-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-01-22  9:15               ` Lucas Stach
2013-01-22  9:31                 ` Thierry Reding
     [not found]                   ` <20130122093150.GA22264-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2013-01-22  9:44                     ` Terje Bergström
     [not found]                       ` <50FE5F61.4080103-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-22  9:48                         ` Lucas Stach
2013-01-22 10:39                           ` Terje Bergström
2013-01-22  9:35                 ` Terje Bergström
2013-01-22 17:27           ` Mario Kleiner
     [not found]             ` <50FECBFC.8080307-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-11  9:00               ` Thierry Reding
     [not found]                 ` <20130211090001.GA3423-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-02-15 22:34                   ` Mario Kleiner

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=511EB8D6.8090401@gmail.com \
    --to=mario.kleiner.de@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mario.kleiner@tuebingen.mpg.de \
    --cc=thierry.reding@avionic-design.de \
    /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).