All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
Cc: "nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Mario Kleiner
	<mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] Add Option "DRI3" to allow to disable DRI3 under EXA.
Date: Sat, 4 Jul 2015 19:23:43 +0100	[thread overview]
Message-ID: <CACvgo53NaCJ6r+1LdJEG78Zyi+SBfMu2y1Mkm2HCKUo7Co5zQw@mail.gmail.com> (raw)
In-Reply-To: <CAKb7UvhOcQ1-y2q3_8RZzvLewhsZ3A1OHC=vo3uBSwX3XTR0Eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

That would be great, as long as it does only that and does not go into
the "drivername" territory. As the said driver ;-)

"A driver name to use can be provided instead
of simple boolean value, which will be passed to the GL implementation for
it to load the appropriate backend."

-Emil

On 4 July 2015 at 18:17, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> IMO it'd be nice to keep this compatible with the intel driver, which
> has a "DRI" option, which can take the values 1, 2, 3. Obviously for
> nouveau, 1 makes no sense as that was dropped quite some time ago.
>
> See http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/man/intel.man#n68
>
> On Mon, Jun 29, 2015 at 11:30 PM, Mario Kleiner
> <mario.kleiner.de@gmail.com> wrote:
>> X-Server versions older than 1.16.3 have bugs in their
>> DRI3/Present implementation which impair nouveau, so
>> it is better to stick to good old DRI2 by default on
>> such servers. E.g., page flipping doesn't work at all
>> under DRI3/Present with older servers, and use of
>> extensions like OML_sync_control, SGI_video_sync or
>> INTEL_swap_events also causes failure of Present.
>>
>> nouveau's glamor accel backend currently doesn't work under
>> DRI2, so continue to use DRI3 whenever it is supported.
>>
>> Under the exa accel backend, DRI2 works just fine, so
>> disable DRI3 and choose DRI2 by default when nouveau
>> is built for X-Server < 1.16.3, and enable DRI3 if
>> building on later X-Servers which work reasonably well
>> under DRI3/Present.
>>
>> A new boolean xorg.conf Option "DRI3" allows to enforce or
>> prevent use of DRI3/Present under EXA acceleration for
>> testing.
>>
>> Also add a bit more output about status of Present and
>> DRI3 to aid debugging.
>>
>> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
>> ---
>>  man/nouveau.man    |  6 ++++++
>>  src/nouveau_dri2.c | 11 ++++++++++-
>>  src/nv_const.h     |  2 ++
>>  src/nv_driver.c    | 17 +++++++++++++++--
>>  4 files changed, 33 insertions(+), 3 deletions(-)
>>
>> diff --git a/man/nouveau.man b/man/nouveau.man
>> index 129bb7f..12cfbc0 100644
>> --- a/man/nouveau.man
>> +++ b/man/nouveau.man
>> @@ -125,6 +125,12 @@ that relies on correct presentation timing behaviour as defined in that
>>  specification.
>>  .br
>>  Default: 1.
>> +.TP
>> +.BI "Option \*qDRI3\*q \*q" boolean \*q
>> +Enable the DRI3 extension under exa acceleration if supported by server.
>> +A setting of "off" will only use DRI2 instead. Under glamor acceleration,
>> +DRI3 is always enabled if supported. Default: on for XOrg >= 1.16.3, off for
>> +earlier versions.
>>  .SH "SEE ALSO"
>>  __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
>>  .SH AUTHORS
>> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
>> index f22e319..d818976 100644
>> --- a/src/nouveau_dri2.c
>> +++ b/src/nouveau_dri2.c
>> @@ -1130,7 +1130,16 @@ nouveau_dri3_screen_init(ScreenPtr screen)
>>         if (buf && stat(buf, &render) == 0 &&
>>             master.st_mode == render.st_mode) {
>>                 pNv->render_node = buf;
>> -               return dri3_screen_init(screen, &nouveau_dri3_screen_info);
>> +               if (dri3_screen_init(screen, &nouveau_dri3_screen_info)) {
>> +                       xf86DrvMsg(pScrn->scrnIndex, X_INFO,
>> +                                  "DRI3 on EXA enabled\n");
>> +                       return TRUE;
>> +               }
>> +               else {
>> +                       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
>> +                                  "DRI3 on EXA initialization failed\n");
>> +                       return FALSE;
>> +               }
>>         } else
>>                 free(buf);
>>  #endif
>> diff --git a/src/nv_const.h b/src/nv_const.h
>> index f1b4e9b..df1e398 100644
>> --- a/src/nv_const.h
>> +++ b/src/nv_const.h
>> @@ -18,6 +18,7 @@ typedef enum {
>>      OPTION_SWAP_LIMIT,
>>      OPTION_ASYNC_COPY,
>>      OPTION_ACCELMETHOD,
>> +    OPTION_DRI3,
>>  } NVOpts;
>>
>>
>> @@ -34,6 +35,7 @@ static const OptionInfoRec NVOptions[] = {
>>      { OPTION_SWAP_LIMIT,       "SwapLimit",    OPTV_INTEGER,   {0}, FALSE },
>>      { OPTION_ASYNC_COPY,       "AsyncUTSDFS",  OPTV_BOOLEAN,   {0}, FALSE },
>>      { OPTION_ACCELMETHOD,      "AccelMethod",  OPTV_STRING,    {0}, FALSE },
>> +    { OPTION_DRI3,             "DRI3",         OPTV_BOOLEAN,   {0}, FALSE },
>>      { -1,                       NULL,           OPTV_NONE,      {0}, FALSE }
>>  };
>>
>> diff --git a/src/nv_driver.c b/src/nv_driver.c
>> index 8e2ae03..32f04d8 100644
>> --- a/src/nv_driver.c
>> +++ b/src/nv_driver.c
>> @@ -1470,7 +1470,13 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
>>
>>         xf86SetBlackWhitePixels(pScreen);
>>
>> -       nouveau_present_init(pScreen);
>> +       if (nouveau_present_init(pScreen) <= 0)
>> +               xf86DrvMsg(pScrn->scrnIndex, X_INFO,
>> +                          "Hardware support for Present disabled\n");
>> +       else
>> +               xf86DrvMsg(pScrn->scrnIndex, X_INFO,
>> +                          "Hardware support for Present enabled\n");
>> +
>>         nouveau_sync_init(pScreen);
>>         nouveau_dri2_init(pScreen);
>>         if (pNv->AccelMethod == GLAMOR) {
>> @@ -1478,7 +1484,14 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
>>                         return FALSE;
>>         } else
>>         if (pNv->AccelMethod == EXA) {
>> -               if (!nouveau_dri3_screen_init(pScreen))
>> +               /* Default to DRI3/Present on XOrg >= 1.16.3, DRI2 on older
>> +                * servers, as older servers have DRI3/Present bugs affecting
>> +                * nouveau.
>> +                */
>> +               ret = xf86ReturnOptValBool(pNv->Options, OPTION_DRI3,
>> +                                          XORG_VERSION_CURRENT >=
>> +                                          XORG_VERSION_NUMERIC(1,16,3,0,0));
>> +               if (ret && !nouveau_dri3_screen_init(pScreen))
>>                         return FALSE;
>>
>>                 if (!nouveau_exa_init(pScreen))
>> --
>> 1.9.1
>>
>> _______________________________________________
>> 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

  parent reply	other threads:[~2015-07-04 18:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  3:30 [PATCH] Add Option "DRI3" to allow to disable DRI3 under EXA Mario Kleiner
     [not found] ` <1435635043-3738-1-git-send-email-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-30  7:00   ` Martin Peres
2015-07-04 17:17   ` Ilia Mirkin
     [not found]     ` <CAKb7UvhOcQ1-y2q3_8RZzvLewhsZ3A1OHC=vo3uBSwX3XTR0Eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-04 18:23       ` Emil Velikov [this message]
     [not found]         ` <CACvgo53NaCJ6r+1LdJEG78Zyi+SBfMu2y1Mkm2HCKUo7Co5zQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-04 18:28           ` Ilia Mirkin
     [not found]             ` <CAKb7Uvj-7AeG8EQ58cZZhF1O7HU=E_VkKO8wi7LpitoNBmCjGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-04 19:03               ` Emil Velikov
     [not found]                 ` <CACvgo50R5kPGVAwDYTUSCkY-Cfh=HENFDT8OdT=nNKLG85=S9Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-07 19:51                   ` Ilia Mirkin
     [not found]                     ` <CAKb7UvhuYJxLk1zPQbdTgG_HQcbo0Zt_TnpHf7gD2apk+RYCdA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-14  3:43                       ` Mario Kleiner
     [not found]                         ` <55A48575.5060100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-14 15:26                           ` Ilia Mirkin
     [not found]                             ` <CAKb7Uvi7pCT-rkFxfpsmw-P0UhF86ZrEdtmJDc3kU+REz7oZ3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-14 19:00                               ` Mario Kleiner
     [not found]                                 ` <55A55C40.4000207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-14 19:12                                   ` Ilia Mirkin
2015-07-18 11:09                                   ` Dave Airlie
     [not found]                                     ` <CAPM=9ty34G39nceFnarvs0qOoJiyqjcsgXD0FdB4Ye_O1D+EhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-19  8:34                                       ` Mario Kleiner
     [not found]                                         ` <55AB6116.4000004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-22  4:39                                           ` Dave Airlie
     [not found]                                             ` <CAPM=9twESbxOf+r4cy=-B+FNpKQwm8dvgbA9b-6XNbo275KLKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-26  8:12                                               ` Mario Kleiner
2015-07-26 13:11                                       ` Pekka Paalanen
2015-07-24 15:40                           ` Ilia Mirkin

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=CACvgo53NaCJ6r+1LdJEG78Zyi+SBfMu2y1Mkm2HCKUo7Co5zQw@mail.gmail.com \
    --to=emil.l.velikov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org \
    --cc=mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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.