[Mesa-dev] [RFC 5/5] DEBUG

2018-07-05 Thread Robert Foss
Signed-off-by: Robert Foss 
---
 src/egl/drivers/dri2/egl_dri2.c   | 29 +++
 src/egl/drivers/dri2/platform_android.c   | 27 +
 src/egl/main/egldriver.c  |  8 -
 src/gallium/auxiliary/Android.mk  |  5 
 src/gallium/winsys/sw/kms-dri/Android.mk  |  6 
 .../winsys/sw/kms-dri/kms_dri_sw_winsys.c |  6 ++--
 6 files changed, 67 insertions(+), 14 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 45d0c7275c5..64b65042fda 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -65,6 +65,10 @@
 #include "util/u_vector.h"
 #include "mapi/glapi/glapi.h"
 
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#define LOG_TAG "egl-dri2"
+#include 
+
 /* The kernel header drm_fourcc.h defines the DRM formats below.  We duplicate
  * some of the definitions here so that building Mesa won't bleeding-edge
  * kernel headers.
@@ -511,7 +515,7 @@ dri2_open_driver(_EGLDisplay *disp)
char path[PATH_MAX], *search_paths, *next, *end;
char *get_extensions_name;
const __DRIextension **(*get_extensions)(void);
-
+   ALOGE("%s() 1 driver_name=%s", __func__, dri2_dpy->driver_name);
search_paths = NULL;
if (geteuid() == getuid()) {
   /* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
@@ -523,6 +527,7 @@ dri2_open_driver(_EGLDisplay *disp)
dri2_dpy->driver = NULL;
end = search_paths + strlen(search_paths);
for (char *p = search_paths; p < end; p = next + 1) {
+  ALOGE("%s() 1.1 driver path: %s", __func__, p);
   int len;
   next = strchr(p, ':');
   if (next == NULL)
@@ -532,14 +537,19 @@ dri2_open_driver(_EGLDisplay *disp)
 #if GLX_USE_TLS
   snprintf(path, sizeof path,
"%.*s/tls/%s_dri.so", len, p, dri2_dpy->driver_name);
+  ALOGE("%s() 2 .so path: %s", __func__, path);
+
   dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
 #endif
   if (dri2_dpy->driver == NULL) {
  snprintf(path, sizeof path,
   "%.*s/%s_dri.so", len, p, dri2_dpy->driver_name);
+ ALOGE("%s() 3 .so path: %s", __func__, path);
  dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
- if (dri2_dpy->driver == NULL)
+ if (dri2_dpy->driver == NULL){
 _eglLog(_EGL_DEBUG, "failed to open %s: %s\n", path, dlerror());
+ALOGE("%s() failed to open %s: %s\n", __func__, path, dlerror());
+ }
   }
   /* not need continue to loop all paths once the driver is found */
   if (dri2_dpy->driver != NULL)
@@ -550,6 +560,8 @@ dri2_open_driver(_EGLDisplay *disp)
   _eglLog(_EGL_WARNING,
   "DRI2: failed to open %s (search paths %s)",
   dri2_dpy->driver_name, search_paths);
+  ALOGE("%s() DRI2: failed to open %s (search paths %s)",
+  __func__, dri2_dpy->driver_name, search_paths);
   return NULL;
}
 
@@ -821,8 +833,9 @@ EGLBoolean
 dri2_create_screen(_EGLDisplay *disp)
 {
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
-
+   ALOGE("%s() 1", __func__);
if (dri2_dpy->image_driver) {
+  ALOGE("%s() 1 1 image_driver", __func__);
   dri2_dpy->dri_screen =
  dri2_dpy->image_driver->createNewScreen2(0, dri2_dpy->fd,
   dri2_dpy->loader_extensions,
@@ -830,19 +843,23 @@ dri2_create_screen(_EGLDisplay *disp)
   &dri2_dpy->driver_configs,
   disp);
} else if (dri2_dpy->dri2) {
+  ALOGE("%s() 1 2 dri2", __func__);
   if (dri2_dpy->dri2->base.version >= 4) {
+ ALOGE("%s() 1 2 1 dri2", __func__);
  dri2_dpy->dri_screen =
 dri2_dpy->dri2->createNewScreen2(0, dri2_dpy->fd,
  dri2_dpy->loader_extensions,
  dri2_dpy->driver_extensions,
  &dri2_dpy->driver_configs, disp);
   } else {
+ ALOGE("%s() 1 2 2 !dri2", __func__);
  dri2_dpy->dri_screen =
 dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd,
 dri2_dpy->loader_extensions,
 &dri2_dpy->driver_configs, disp);
   }
} else {
+  ALOGE("%s() 1 3 1 swrast", __func__);
   assert(dri2_dpy->swrast);
   if (dri2_dpy->swrast->base.version >= 4) {
  dri2_dpy->dri_screen =
@@ -850,17 +867,19 @@ dri2_create_screen(_EGLDisplay *disp)
dri2_dpy->driver_extensions,
&dri2_dpy->driver_configs, 
disp);
   } else {
+ ALOGE("%s() 1 3 2 swrast", __func__);
  dri2_dpy->dri_screen =
 dri2_dpy->swrast->createNewScreen(0, dri2_dpy->loader_extensions,
 

Re: [Mesa-dev] [RFC 5/5] DEBUG

2018-07-05 Thread Emil Velikov
Hi Rob,

On 5 July 2018 at 11:07, Robert Foss  wrote:

> @@ -511,7 +515,7 @@ dri2_open_driver(_EGLDisplay *disp)
> char path[PATH_MAX], *search_paths, *next, *end;
> char *get_extensions_name;
> const __DRIextension **(*get_extensions)(void);
> -
> +   ALOGE("%s() 1 driver_name=%s", __func__, dri2_dpy->driver_name);
Aside:
Personally, I try to use "before/after X". Otherwise I find myself
always bouncing back and forth, relate the 1, 1.1... with the actual
call chain.


> @@ -1367,10 +1379,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay 
> *disp)
> const char *err;
> int ret;
>
> -   /* Not supported yet */
> -   if (disp->Options.ForceSoftware)
> -  return EGL_FALSE;
> -
Even with the issues you mentioned in the cover letter, this could be
fleshed out or even squashed with 3/5. Up-to you really.

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


Re: [Mesa-dev] [RFC 5/5] DEBUG

2018-07-05 Thread Robert Foss

Hey Emil,

On 05/07/18 15:13, Emil Velikov wrote:

Hi Rob,

On 5 July 2018 at 11:07, Robert Foss  wrote:


@@ -511,7 +515,7 @@ dri2_open_driver(_EGLDisplay *disp)
 char path[PATH_MAX], *search_paths, *next, *end;
 char *get_extensions_name;
 const __DRIextension **(*get_extensions)(void);
-
+   ALOGE("%s() 1 driver_name=%s", __func__, dri2_dpy->driver_name);

Aside:
Personally, I try to use "before/after X". Otherwise I find myself
always bouncing back and forth, relate the 1, 1.1... with the actual
call chain.


Hmmph, yeah. Maybe that is a more pleasant way of going about it.
I'll have to feel it out :)





@@ -1367,10 +1379,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay 
*disp)
 const char *err;
 int ret;

-   /* Not supported yet */
-   if (disp->Options.ForceSoftware)
-  return EGL_FALSE;
-

Even with the issues you mentioned in the cover letter, this could be
fleshed out or even squashed with 3/5. Up-to you really.


This chunk shouldn't really be in this patch. I had some issues setting the 
Android property and while figuring out that the property wasn't propagated 
properly this chunk was removed.


The debug patch will be dropped in v1, so this will be removed.



-Emil


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


Re: [Mesa-dev] [RFC 5/5] DEBUG

2018-07-06 Thread Robert Foss



On 05/07/18 17:50, Robert Foss wrote:

Hey Emil,

On 05/07/18 15:13, Emil Velikov wrote:

Hi Rob,

On 5 July 2018 at 11:07, Robert Foss  wrote:


@@ -511,7 +515,7 @@ dri2_open_driver(_EGLDisplay *disp)
 char path[PATH_MAX], *search_paths, *next, *end;
 char *get_extensions_name;
 const __DRIextension **(*get_extensions)(void);
-
+   ALOGE("%s() 1 driver_name=%s", __func__, dri2_dpy->driver_name);

Aside:
Personally, I try to use "before/after X". Otherwise I find myself
always bouncing back and forth, relate the 1, 1.1... with the actual
call chain.


Hmmph, yeah. Maybe that is a more pleasant way of going about it.
I'll have to feel it out :)




@@ -1367,10 +1379,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay 
*disp)

 const char *err;
 int ret;

-   /* Not supported yet */
-   if (disp->Options.ForceSoftware)
-  return EGL_FALSE;
-

Even with the issues you mentioned in the cover letter, this could be
fleshed out or even squashed with 3/5. Up-to you really.


This chunk shouldn't really be in this patch. I had some issues setting the 
Android property and while figuring out that the property wasn't propagated 
properly this chunk was removed.


The debug patch will be dropped in v1, so this will be removed.



Actueally, when re-reading this comment I realize I misunderstood it.
I'll fold this into 3/5 as you're suggesting.



-Emil


___
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