Re: [Mesa-dev] [PATCH] st/dri2: fix kms_swrast driconf option handling

2017-08-09 Thread Nicolai Hähnle

On 08.08.2017 19:07, Rob Herring wrote:

On Tue, Aug 8, 2017 at 11:56 AM, Ilia Mirkin  wrote:

On Tue, Aug 8, 2017 at 12:50 PM, Rob Herring  wrote:

Commit e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
moved the option cache to the pipe_loader_device. However, the
screen->dev pointer is not set when dri_init_options() is called. Move
the call to after the pipe_loader_sw_probe_kms() call so screen->dev is
set. This mirrors the code flow for dri2_init_screen().

Fixes: e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
Cc: Nicolai Hähnle 
Cc: Marek Olšák 
Signed-off-by: Rob Herring 
---
  src/gallium/state_trackers/dri/dri2.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c 
b/src/gallium/state_trackers/dri/dri2.c
index 3555107856c8..680826f58144 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -2164,9 +2164,8 @@ dri_kms_init_screen(__DRIscreen * sPriv)
 if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
goto free_screen;

-   dri_init_options(screen);
-
 if (pipe_loader_sw_probe_kms(>dev, fd))


{


+  dri_init_options(screen);
pscreen = pipe_loader_create_screen(screen->dev);


}


Good catch. By luck it worked for the non-error case.


With that fixed, the patch is

Reviewed-by: Nicolai Hähnle 




Rob



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/dri2: fix kms_swrast driconf option handling

2017-08-08 Thread Rob Herring
On Tue, Aug 8, 2017 at 11:56 AM, Ilia Mirkin  wrote:
> On Tue, Aug 8, 2017 at 12:50 PM, Rob Herring  wrote:
>> Commit e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
>> moved the option cache to the pipe_loader_device. However, the
>> screen->dev pointer is not set when dri_init_options() is called. Move
>> the call to after the pipe_loader_sw_probe_kms() call so screen->dev is
>> set. This mirrors the code flow for dri2_init_screen().
>>
>> Fixes: e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
>> Cc: Nicolai Hähnle 
>> Cc: Marek Olšák 
>> Signed-off-by: Rob Herring 
>> ---
>>  src/gallium/state_trackers/dri/dri2.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/dri/dri2.c 
>> b/src/gallium/state_trackers/dri/dri2.c
>> index 3555107856c8..680826f58144 100644
>> --- a/src/gallium/state_trackers/dri/dri2.c
>> +++ b/src/gallium/state_trackers/dri/dri2.c
>> @@ -2164,9 +2164,8 @@ dri_kms_init_screen(__DRIscreen * sPriv)
>> if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
>>goto free_screen;
>>
>> -   dri_init_options(screen);
>> -
>> if (pipe_loader_sw_probe_kms(>dev, fd))
>
> {
>
>> +  dri_init_options(screen);
>>pscreen = pipe_loader_create_screen(screen->dev);
>
> }

Good catch. By luck it worked for the non-error case.

Rob
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/dri2: fix kms_swrast driconf option handling

2017-08-08 Thread Ilia Mirkin
On Tue, Aug 8, 2017 at 12:50 PM, Rob Herring  wrote:
> Commit e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
> moved the option cache to the pipe_loader_device. However, the
> screen->dev pointer is not set when dri_init_options() is called. Move
> the call to after the pipe_loader_sw_probe_kms() call so screen->dev is
> set. This mirrors the code flow for dri2_init_screen().
>
> Fixes: e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
> Cc: Nicolai Hähnle 
> Cc: Marek Olšák 
> Signed-off-by: Rob Herring 
> ---
>  src/gallium/state_trackers/dri/dri2.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c 
> b/src/gallium/state_trackers/dri/dri2.c
> index 3555107856c8..680826f58144 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -2164,9 +2164,8 @@ dri_kms_init_screen(__DRIscreen * sPriv)
> if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
>goto free_screen;
>
> -   dri_init_options(screen);
> -
> if (pipe_loader_sw_probe_kms(>dev, fd))

{

> +  dri_init_options(screen);
>pscreen = pipe_loader_create_screen(screen->dev);

}

>
> if (!pscreen)
> --
> 2.11.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] st/dri2: fix kms_swrast driconf option handling

2017-08-08 Thread Rob Herring
Commit e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
moved the option cache to the pipe_loader_device. However, the
screen->dev pointer is not set when dri_init_options() is called. Move
the call to after the pipe_loader_sw_probe_kms() call so screen->dev is
set. This mirrors the code flow for dri2_init_screen().

Fixes: e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader")
Cc: Nicolai Hähnle 
Cc: Marek Olšák 
Signed-off-by: Rob Herring 
---
 src/gallium/state_trackers/dri/dri2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c 
b/src/gallium/state_trackers/dri/dri2.c
index 3555107856c8..680826f58144 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -2164,9 +2164,8 @@ dri_kms_init_screen(__DRIscreen * sPriv)
if (screen->fd < 0 || (fd = fcntl(screen->fd, F_DUPFD_CLOEXEC, 3)) < 0)
   goto free_screen;
 
-   dri_init_options(screen);
-
if (pipe_loader_sw_probe_kms(>dev, fd))
+  dri_init_options(screen);
   pscreen = pipe_loader_create_screen(screen->dev);
 
if (!pscreen)
-- 
2.11.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev