On 08.08.2017 19:07, Rob Herring wrote:
On Tue, Aug 8, 2017 at 11:56 AM, Ilia Mirkin <imir...@alum.mit.edu> wrote:
On Tue, Aug 8, 2017 at 12:50 PM, Rob Herring <r...@kernel.org> 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 <nicolai.haeh...@amd.com>
Cc: Marek Olšák <marek.ol...@amd.com>
Signed-off-by: Rob Herring <r...@kernel.org>
---
  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(&screen->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 <nicolai.haeh...@amd.com>



Rob


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

Reply via email to