diff mbox

[v2] drm/nouveau: wait for vblank on page flipping

Message ID 51545EE3.8020406@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst March 28, 2013, 3:16 p.m. UTC
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
---
Oops, fixed to apply this time..

Comments

Peter Hurley March 28, 2013, 9:33 p.m. UTC | #1
On Thu, 2013-03-28 at 16:16 +0100, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> ---
> Oops, fixed to apply this time..
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
> index 4610c3a..020542e 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_display.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
> @@ -593,7 +597,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
>  
>  	/* Emit a page flip */
>  	if (nv_device(drm->device)->card_type >= NV_50) {
> -		ret = nv50_display_flip_next(crtc, fb, chan, 0);
> +		ret = nv50_display_flip_next(crtc, fb, chan, 1);

Why would this work?

>  		if (ret) {
>  			mutex_unlock(&chan->cli->mutex);
>  			goto fail_unreserve;
Ben Skeggs March 29, 2013, 2:20 a.m. UTC | #2
On Fri, Mar 29, 2013 at 7:33 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
> On Thu, 2013-03-28 at 16:16 +0100, Maarten Lankhorst wrote:
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
>> ---
>> Oops, fixed to apply this time..
>>
>> diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
>> index 4610c3a..020542e 100644
>> --- a/drivers/gpu/drm/nouveau/nouveau_display.c
>> +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
>> @@ -593,7 +597,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
>>
>>       /* Emit a page flip */
>>       if (nv_device(drm->device)->card_type >= NV_50) {
>> -             ret = nv50_display_flip_next(crtc, fb, chan, 0);
>> +             ret = nv50_display_flip_next(crtc, fb, chan, 1);
>
> Why would this work?
Because, when I added the code to support all this I kept it in mind
and added a switch to use it.

Now.  The reason I never switched this on is that (as I *already*
mentioned in #nouveau to Maarten about another patch to enable vblank
unconditionally in the DDX.......) we already have huge problems with
memory bandwidth due to our cards usually starting up at low clock
speeds.  When I added page flipping support it made a huge difference
to some games etc that were barely playable before.

So, it'd be really nice to be able to do this, yes.  But, before I'll
accept the patches a few things need to happen.  I'd have done it
before, but, I've always had higher priority things in the way (like,
fixing the reclocking issue...)..

1. Fix the X server so that the page flipping path (dri2.c, line 1125)
will be called even if theres no swap_interval set, this will allow
page flipping to be used even in the absence of a sync-to-vblank
request too.
2. Remove the GLXVBlank option from the nouveau ddx completely,
default it to on.  The application/user can now control it via other
means anyway (drawable swap_interval).
3. Fix the DRM page flip ioctl to take a flag to request a non-vsync'd
flip, and hook that bit up to the nv50_display_flip_next() call

I think that's everything... This will let us support both the speed
improvements from flipping, and sync-to-vblank as the user chooses.

Ben.

>
>>               if (ret) {
>>                       mutex_unlock(&chan->cli->mutex);
>>                       goto fail_unreserve;
>
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 4610c3a..020542e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -593,7 +597,7 @@  nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 
 	/* Emit a page flip */
 	if (nv_device(drm->device)->card_type >= NV_50) {
-		ret = nv50_display_flip_next(crtc, fb, chan, 0);
+		ret = nv50_display_flip_next(crtc, fb, chan, 1);
 		if (ret) {
 			mutex_unlock(&chan->cli->mutex);
 			goto fail_unreserve;