All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nv50/disp: Fix modeset on G94
@ 2014-10-30 21:57 Roy Spliet
       [not found] ` <1414706265-13208-1-git-send-email-rspliet-pPYjZ15w/Xhulxpn9UvDqw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Roy Spliet @ 2014-10-30 21:57 UTC (permalink / raw)
  To: Nouveau Mailinglist; +Cc: Roy Spliet

Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression spotted
on several G94 (FDObz #85160). This device seems to expect the vblank period to
be set after setting scale instead of before.

V2: shove this in a separate function

This is a candidate bug-fix for 3.18

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
Tested-by: Michael Riesch <michael@riesch.at>
Tested-by: "poma" <pomidorabelisima@gmail.com>
Tested-by: Adam Williamson <adamw@happyassassin.net>
---
 drivers/gpu/drm/nouveau/nv50_display.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index ae873d1..2f24a08 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -791,6 +791,23 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
 }
 
 static int
+nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32 usec)
+{
+	struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
+	u32 *push;
+
+	push = evo_wait(mast, 8);
+	if (!push)
+		return -ENOMEM;
+
+	evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1);
+	evo_data(push, usec);
+	evo_kick(push, mast);
+
+	return 0;
+}
+
+static int
 nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update)
 {
 	struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
@@ -1104,14 +1121,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
 			evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2);
 			evo_data(push, 0x00800000 | mode->clock);
 			evo_data(push, (ilace == 2) ? 2 : 0);
-			evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8);
+			evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6);
 			evo_data(push, 0x00000000);
 			evo_data(push, (vactive << 16) | hactive);
 			evo_data(push, ( vsynce << 16) | hsynce);
 			evo_data(push, (vblanke << 16) | hblanke);
 			evo_data(push, (vblanks << 16) | hblanks);
 			evo_data(push, (vblan2e << 16) | vblan2s);
-			evo_data(push, vblankus);
+			evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1);
 			evo_data(push, 0x00000000);
 			evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2);
 			evo_data(push, 0x00000311);
@@ -1141,6 +1158,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
 	nv_connector = nouveau_crtc_connector_get(nv_crtc);
 	nv50_crtc_set_dither(nv_crtc, false);
 	nv50_crtc_set_scale(nv_crtc, false);
+
+	/* G94 only accepts this after setting scale */
+	if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA)
+		nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus);
+
 	nv50_crtc_set_color_vibrance(nv_crtc, false);
 	nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false);
 	return 0;
-- 
2.1.0



_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] nv50/disp: Fix modeset on G94
       [not found] ` <1414706265-13208-1-git-send-email-rspliet-pPYjZ15w/Xhulxpn9UvDqw@public.gmane.org>
@ 2014-10-30 22:00   ` Ilia Mirkin
       [not found]     ` <CAKb7UvhnxLciY+v1B+m0zc1tT090_wVfXatwOK2ygXd1M_jVRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Ilia Mirkin @ 2014-10-30 22:00 UTC (permalink / raw)
  To: Roy Spliet; +Cc: Nouveau Mailinglist

On Thu, Oct 30, 2014 at 5:57 PM, Roy Spliet <rspliet@eclipso.eu> wrote:
> Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression spotted
> on several G94 (FDObz #85160). This device seems to expect the vblank period to

I believe that's often done as a

Bugzilla: https://bugs.freedesktop.org/bla

annotation

> be set after setting scale instead of before.
>
> V2: shove this in a separate function
>
> This is a candidate bug-fix for 3.18
>
> Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
> Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
> Tested-by: Michael Riesch <michael@riesch.at>
> Tested-by: "poma" <pomidorabelisima@gmail.com>
> Tested-by: Adam Williamson <adamw@happyassassin.net>
> ---
>  drivers/gpu/drm/nouveau/nv50_display.c | 26 ++++++++++++++++++++++++--
>  1 file changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
> index ae873d1..2f24a08 100644
> --- a/drivers/gpu/drm/nouveau/nv50_display.c
> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
> @@ -791,6 +791,23 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
>  }
>
>  static int
> +nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32 usec)

What's "dmi"?

> +{
> +       struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
> +       u32 *push;
> +
> +       push = evo_wait(mast, 8);

Just needs to be 2, no?

> +       if (!push)
> +               return -ENOMEM;
> +
> +       evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1);
> +       evo_data(push, usec);
> +       evo_kick(push, mast);
> +
> +       return 0;
> +}
> +
> +static int
>  nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update)
>  {
>         struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
> @@ -1104,14 +1121,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
>                         evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2);
>                         evo_data(push, 0x00800000 | mode->clock);
>                         evo_data(push, (ilace == 2) ? 2 : 0);
> -                       evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8);
> +                       evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6);
>                         evo_data(push, 0x00000000);
>                         evo_data(push, (vactive << 16) | hactive);
>                         evo_data(push, ( vsynce << 16) | hsynce);
>                         evo_data(push, (vblanke << 16) | hblanke);
>                         evo_data(push, (vblanks << 16) | hblanks);
>                         evo_data(push, (vblan2e << 16) | vblan2s);
> -                       evo_data(push, vblankus);
> +                       evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1);
>                         evo_data(push, 0x00000000);
>                         evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2);
>                         evo_data(push, 0x00000311);
> @@ -1141,6 +1158,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
>         nv_connector = nouveau_crtc_connector_get(nv_crtc);
>         nv50_crtc_set_dither(nv_crtc, false);
>         nv50_crtc_set_scale(nv_crtc, false);
> +
> +       /* G94 only accepts this after setting scale */
> +       if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA)
> +               nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus);
> +
>         nv50_crtc_set_color_vibrance(nv_crtc, false);
>         nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false);
>         return 0;
> --
> 2.1.0
>
>
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nv50/disp: Fix modeset on G94
       [not found]     ` <CAKb7UvhnxLciY+v1B+m0zc1tT090_wVfXatwOK2ygXd1M_jVRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-10-30 23:52       ` Ben Skeggs
       [not found]         ` <CACAvsv5y3LMVnEyDGB-aLgyWnkJQDujP8WhZUfq9J=8g_RxrCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Skeggs @ 2014-10-30 23:52 UTC (permalink / raw)
  To: Ilia Mirkin; +Cc: Nouveau Mailinglist, Roy Spliet

On Fri, Oct 31, 2014 at 8:00 AM, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> On Thu, Oct 30, 2014 at 5:57 PM, Roy Spliet <rspliet@eclipso.eu> wrote:
>> Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression spotted
>> on several G94 (FDObz #85160). This device seems to expect the vblank period to
>
> I believe that's often done as a
>
> Bugzilla: https://bugs.freedesktop.org/bla
>
> annotation
>
>> be set after setting scale instead of before.
>>
>> V2: shove this in a separate function
>>
>> This is a candidate bug-fix for 3.18
>>
>> Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
>> Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
>> Tested-by: Michael Riesch <michael@riesch.at>
>> Tested-by: "poma" <pomidorabelisima@gmail.com>
>> Tested-by: Adam Williamson <adamw@happyassassin.net>
>> ---
>>  drivers/gpu/drm/nouveau/nv50_display.c | 26 ++++++++++++++++++++++++--
>>  1 file changed, 24 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
>> index ae873d1..2f24a08 100644
>> --- a/drivers/gpu/drm/nouveau/nv50_display.c
>> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
>> @@ -791,6 +791,23 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update)
>>  }
>>
>>  static int
>> +nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32 usec)
>
> What's "dmi"?
SetRasterVertBlankDmi is the name of method 0x828.  I presume it's
Display Memory Interface or something to that effect.

>
>> +{
>> +       struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
>> +       u32 *push;
>> +
>> +       push = evo_wait(mast, 8);
>
> Just needs to be 2, no?
Yes, doesn't matter too much though.

>
>> +       if (!push)
>> +               return -ENOMEM;
>> +
>> +       evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1);
>> +       evo_data(push, usec);
>> +       evo_kick(push, mast);
>> +
>> +       return 0;
>> +}
>> +
>> +static int
>>  nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update)
>>  {
>>         struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
>> @@ -1104,14 +1121,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
>>                         evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2);
>>                         evo_data(push, 0x00800000 | mode->clock);
>>                         evo_data(push, (ilace == 2) ? 2 : 0);
>> -                       evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8);
>> +                       evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6);
>>                         evo_data(push, 0x00000000);
>>                         evo_data(push, (vactive << 16) | hactive);
>>                         evo_data(push, ( vsynce << 16) | hsynce);
>>                         evo_data(push, (vblanke << 16) | hblanke);
>>                         evo_data(push, (vblanks << 16) | hblanks);
>>                         evo_data(push, (vblan2e << 16) | vblan2s);
>> -                       evo_data(push, vblankus);
>> +                       evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1);
>>                         evo_data(push, 0x00000000);
>>                         evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2);
>>                         evo_data(push, 0x00000311);
>> @@ -1141,6 +1158,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
>>         nv_connector = nouveau_crtc_connector_get(nv_crtc);
>>         nv50_crtc_set_dither(nv_crtc, false);
>>         nv50_crtc_set_scale(nv_crtc, false);
>> +
>> +       /* G94 only accepts this after setting scale */
>> +       if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA)
>> +               nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus);
>> +
>>         nv50_crtc_set_color_vibrance(nv_crtc, false);
>>         nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false);
>>         return 0;
>> --
>> 2.1.0
>>
>>
>>
>> _______________________________________________
>> Nouveau mailing list
>> Nouveau@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/nouveau
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nv50/disp: Fix modeset on G94
       [not found]         ` <CACAvsv5y3LMVnEyDGB-aLgyWnkJQDujP8WhZUfq9J=8g_RxrCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-10-31 10:28           ` Roy Spliet
       [not found]             ` <723e85bac4ee58d0c1820fa445ed8965-oCZ8gVdGmpNhe3Fb0padOQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Roy Spliet @ 2014-10-31 10:28 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


--- Ursprüngliche Nachricht ---
Von: Ben Skeggs <skeggsb@gmail.com>
Datum: 00:52:05 31-10-2014
An: Ilia Mirkin <imirkin@alum.mit.edu>
Betreff: Re: [Nouveau] [PATCH] nv50/disp: Fix modeset on G94

> On Fri, Oct 31, 2014 at 8:00 AM, Ilia Mirkin <imirkin@alum.mit.edu>
> wrote:
> > On Thu, Oct 30, 2014 at 5:57 PM, Roy Spliet <rspliet@eclipso.eu>
> wrote:
> >> Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression
> spotted
> >> on several G94 (FDObz #85160). This device seems to expect the vblank
> period to
> >
> > I believe that's often done as a
> >
> > Bugzilla: https://bugs.freedesktop.org/bla
> >
> > annotation
> >
> >> be set after setting scale instead of before.
> >>
> >> V2: shove this in a separate function
> >>
> >> This is a candidate bug-fix for 3.18
> >>
> >> Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
> >> Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
> >> Tested-by: Michael Riesch <michael@riesch.at>
> >> Tested-by: "poma" <pomidorabelisima@gmail.com>
> >> Tested-by: Adam Williamson <adamw@happyassassin.net>
> >> ---
> >>  drivers/gpu/drm/nouveau/nv50_display.c | 26 ++++++++++++++++++++++++--
> 
> >>  1 file changed, 24 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
> 
> >> index ae873d1..2f24a08 100644
> >> --- a/drivers/gpu/drm/nouveau/nv50_display.c
> >> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
> >> @@ -791,6 +791,23 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc,
> bool update)
> >>  }
> >>
> >>  static int
> >> +nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32
> usec)
> >
> > What's "dmi"?
> SetRasterVertBlankDmi is the name of method 0x828.  I presume it's
> Display Memory Interface or something to that effect.
> 
> >
> >> +{
> >> +       struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
> 
> >> +       u32 *push;
> >> +
> >> +       push = evo_wait(mast, 8);
> >
> > Just needs to be 2, no?
> Yes, doesn't matter too much though.
If it is, we might need to fix nv50_crtc_mode_set() too; it seems to assume the second parameter in evo_wait() is bytes, not words.

> 
> >
> >> +       if (!push)
> >> +               return -ENOMEM;
> >> +
> >> +       evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1);
> 
> >> +       evo_data(push, usec);
> >> +       evo_kick(push, mast);
> >> +
> >> +       return 0;
> >> +}
> >> +
> >> +static int
> >>  nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool
> update)
> >>  {
> >>         struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
> 
> >> @@ -1104,14 +1121,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc,
> struct drm_display_mode *umode,
> >>                         evo_mthd(push, 0x0804 + (nv_crtc->index
> * 0x400), 2);
> >>                         evo_data(push, 0x00800000 | mode->clock);
> 
> >>                         evo_data(push, (ilace == 2) ? 2 : 0);
> >> -                       evo_mthd(push, 0x0810 + (nv_crtc->index
> * 0x400), 8);
> >> +                       evo_mthd(push, 0x0810 + (nv_crtc->index
> * 0x400), 6);
> >>                         evo_data(push, 0x00000000);
> >>                         evo_data(push, (vactive << 16) | hactive);
> 
> >>                         evo_data(push, ( vsynce << 16) | hsynce);
> 
> >>                         evo_data(push, (vblanke << 16) | hblanke);
> 
> >>                         evo_data(push, (vblanks << 16) | hblanks);
> 
> >>                         evo_data(push, (vblan2e << 16) | vblan2s);
> 
> >> -                       evo_data(push, vblankus);
> >> +                       evo_mthd(push, 0x082c + (nv_crtc->index
> * 0x400), 1);
> >>                         evo_data(push, 0x00000000);
> >>                         evo_mthd(push, 0x0900 + (nv_crtc->index
> * 0x400), 2);
> >>                         evo_data(push, 0x00000311);
> >> @@ -1141,6 +1158,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc,
> struct drm_display_mode *umode,
> >>         nv_connector = nouveau_crtc_connector_get(nv_crtc);
> >>         nv50_crtc_set_dither(nv_crtc, false);
> >>         nv50_crtc_set_scale(nv_crtc, false);
> >> +
> >> +       /* G94 only accepts this after setting scale */
> >> +       if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA)
> >> +               nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus);
> 
> >> +
> >>         nv50_crtc_set_color_vibrance(nv_crtc, false);
> >>         nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x,
> y, false);
> >>         return 0;
> >> --
> >> 2.1.0
> >>
> >>
> >>
> >> _______________________________________________
> >> Nouveau mailing list
> >> Nouveau@lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/nouveau
> > _______________________________________________
> > Nouveau mailing list
> > Nouveau@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/nouveau
> 


_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nv50/disp: Fix modeset on G94
       [not found]             ` <723e85bac4ee58d0c1820fa445ed8965-oCZ8gVdGmpNhe3Fb0padOQ@public.gmane.org>
@ 2014-11-10 21:32               ` poma
  0 siblings, 0 replies; 6+ messages in thread
From: poma @ 2014-11-10 21:32 UTC (permalink / raw)
  To: Roy Spliet, Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 31.10.2014 11:28, Roy Spliet wrote:
> 
> --- Ursprüngliche Nachricht ---
> Von: Ben Skeggs <skeggsb@gmail.com>
> Datum: 00:52:05 31-10-2014
> An: Ilia Mirkin <imirkin@alum.mit.edu>
> Betreff: Re: [Nouveau] [PATCH] nv50/disp: Fix modeset on G94
> 
>> On Fri, Oct 31, 2014 at 8:00 AM, Ilia Mirkin <imirkin@alum.mit.edu>
>> wrote:
>>> On Thu, Oct 30, 2014 at 5:57 PM, Roy Spliet <rspliet@eclipso.eu>
>> wrote:
>>>> Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression
>> spotted
>>>> on several G94 (FDObz #85160). This device seems to expect the vblank
>> period to
>>>
>>> I believe that's often done as a
>>>
>>> Bugzilla: https://bugs.freedesktop.org/bla
>>>
>>> annotation
>>>
>>>> be set after setting scale instead of before.
>>>>
>>>> V2: shove this in a separate function
>>>>
>>>> This is a candidate bug-fix for 3.18
>>>>
>>>> Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
>>>> Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
>>>> Tested-by: Michael Riesch <michael@riesch.at>
>>>> Tested-by: "poma" <pomidorabelisima@gmail.com>
>>>> Tested-by: Adam Williamson <adamw@happyassassin.net>
>>>> ---
>>>>  drivers/gpu/drm/nouveau/nv50_display.c | 26 ++++++++++++++++++++++++--
>>
>>>>  1 file changed, 24 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
>>
>>>> index ae873d1..2f24a08 100644
>>>> --- a/drivers/gpu/drm/nouveau/nv50_display.c
>>>> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
>>>> @@ -791,6 +791,23 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc,
>> bool update)
>>>>  }
>>>>
>>>>  static int
>>>> +nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32
>> usec)
>>>
>>> What's "dmi"?
>> SetRasterVertBlankDmi is the name of method 0x828.  I presume it's
>> Display Memory Interface or something to that effect.
>>
>>>
>>>> +{
>>>> +       struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
>>
>>>> +       u32 *push;
>>>> +
>>>> +       push = evo_wait(mast, 8);
>>>
>>> Just needs to be 2, no?
>> Yes, doesn't matter too much though.
> If it is, we might need to fix nv50_crtc_mode_set() too; it seems to assume the second parameter in evo_wait() is bytes, not words.
> 
>>
>>>
>>>> +       if (!push)
>>>> +               return -ENOMEM;
>>>> +
>>>> +       evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1);
>>
>>>> +       evo_data(push, usec);
>>>> +       evo_kick(push, mast);
>>>> +
>>>> +       return 0;
>>>> +}
>>>> +
>>>> +static int
>>>>  nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool
>> update)
>>>>  {
>>>>         struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev);
>>
>>>> @@ -1104,14 +1121,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc,
>> struct drm_display_mode *umode,
>>>>                         evo_mthd(push, 0x0804 + (nv_crtc->index
>> * 0x400), 2);
>>>>                         evo_data(push, 0x00800000 | mode->clock);
>>
>>>>                         evo_data(push, (ilace == 2) ? 2 : 0);
>>>> -                       evo_mthd(push, 0x0810 + (nv_crtc->index
>> * 0x400), 8);
>>>> +                       evo_mthd(push, 0x0810 + (nv_crtc->index
>> * 0x400), 6);
>>>>                         evo_data(push, 0x00000000);
>>>>                         evo_data(push, (vactive << 16) | hactive);
>>
>>>>                         evo_data(push, ( vsynce << 16) | hsynce);
>>
>>>>                         evo_data(push, (vblanke << 16) | hblanke);
>>
>>>>                         evo_data(push, (vblanks << 16) | hblanks);
>>
>>>>                         evo_data(push, (vblan2e << 16) | vblan2s);
>>
>>>> -                       evo_data(push, vblankus);
>>>> +                       evo_mthd(push, 0x082c + (nv_crtc->index
>> * 0x400), 1);
>>>>                         evo_data(push, 0x00000000);
>>>>                         evo_mthd(push, 0x0900 + (nv_crtc->index
>> * 0x400), 2);
>>>>                         evo_data(push, 0x00000311);
>>>> @@ -1141,6 +1158,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc,
>> struct drm_display_mode *umode,
>>>>         nv_connector = nouveau_crtc_connector_get(nv_crtc);
>>>>         nv50_crtc_set_dither(nv_crtc, false);
>>>>         nv50_crtc_set_scale(nv_crtc, false);
>>>> +
>>>> +       /* G94 only accepts this after setting scale */
>>>> +       if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA)
>>>> +               nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus);
>>
>>>> +
>>>>         nv50_crtc_set_color_vibrance(nv_crtc, false);
>>>>         nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x,
>> y, false);
>>>>         return 0;
>>>> --
>>>> 2.1.0
>>>>


None of all this&that patches does not work anymore.


poma

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] nv50/disp: Fix modeset on G94
@ 2014-10-28 10:48 Roy Spliet
  0 siblings, 0 replies; 6+ messages in thread
From: Roy Spliet @ 2014-10-28 10:48 UTC (permalink / raw)
  To: Nouveau Mailinglist; +Cc: Roy Spliet

Commit 1dce6264045cd23e9c07574ed0bb31c7dce9354f introduced a regression spotted
on several G94 (FDObz #85160). This device seems to expect the vblank period to
be set after setting scale instead of before.

This is a candidate bug-fix for 3.18

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
Tested-by: Michael Riesch <michael@riesch.at>
Tested-by: "poma" <pomidorabelisima@gmail.com>
---
 drivers/gpu/drm/nouveau/nv50_display.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index ae873d1..5beb352 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -1104,14 +1104,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
 			evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2);
 			evo_data(push, 0x00800000 | mode->clock);
 			evo_data(push, (ilace == 2) ? 2 : 0);
-			evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8);
+			evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6);
 			evo_data(push, 0x00000000);
 			evo_data(push, (vactive << 16) | hactive);
 			evo_data(push, ( vsynce << 16) | hsynce);
 			evo_data(push, (vblanke << 16) | hblanke);
 			evo_data(push, (vblanks << 16) | hblanks);
 			evo_data(push, (vblan2e << 16) | vblan2s);
-			evo_data(push, vblankus);
+			evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1);
 			evo_data(push, 0x00000000);
 			evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2);
 			evo_data(push, 0x00000311);
@@ -1141,6 +1141,17 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode,
 	nv_connector = nouveau_crtc_connector_get(nv_crtc);
 	nv50_crtc_set_dither(nv_crtc, false);
 	nv50_crtc_set_scale(nv_crtc, false);
+
+	/* G94 only accepts this after setting scale */
+	if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA) {
+		push = evo_wait(mast, 8);
+		if (push) {
+			evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1);
+			evo_data(push, vblankus);
+			evo_kick(push, mast);
+		}
+	}
+
 	nv50_crtc_set_color_vibrance(nv_crtc, false);
 	nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false);
 	return 0;
-- 
2.1.0



_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-10 21:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 21:57 [PATCH] nv50/disp: Fix modeset on G94 Roy Spliet
     [not found] ` <1414706265-13208-1-git-send-email-rspliet-pPYjZ15w/Xhulxpn9UvDqw@public.gmane.org>
2014-10-30 22:00   ` Ilia Mirkin
     [not found]     ` <CAKb7UvhnxLciY+v1B+m0zc1tT090_wVfXatwOK2ygXd1M_jVRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-30 23:52       ` Ben Skeggs
     [not found]         ` <CACAvsv5y3LMVnEyDGB-aLgyWnkJQDujP8WhZUfq9J=8g_RxrCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-31 10:28           ` Roy Spliet
     [not found]             ` <723e85bac4ee58d0c1820fa445ed8965-oCZ8gVdGmpNhe3Fb0padOQ@public.gmane.org>
2014-11-10 21:32               ` poma
  -- strict thread matches above, loose matches on Subject: below --
2014-10-28 10:48 Roy Spliet

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.