[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Haixia Shi
The NULL platform is for off-screen rendering only. Render node support is required. v2: Only consider the render nodes. Do not use normal nodes as they require auth hooks. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 ++ src/egl/drivers/dri2/egl_dri2.c | 13 ++

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Emil Velikov
On 23/01/15 19:24, Haixia Shi wrote: > Hi Emil, > > On Fri, Jan 23, 2015 at 8:42 AM, Emil Velikov > wrote: >> Might be worth having a look at how platform_drm does it. But we warned >> there be dragons :) > > It seems platform_drm would cast disp->PlatformDisplay to a gbm_device > and use it if

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Haixia Shi
Hi Emil, On Fri, Jan 23, 2015 at 8:42 AM, Emil Velikov wrote: > Might be worth having a look at how platform_drm does it. But we warned > there be dragons :) It seems platform_drm would cast disp->PlatformDisplay to a gbm_device and use it if available; otherwise it always uses the first normal

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Haixia Shi
The NULL platform is for off-screen rendering only. Render node support is required. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 ++ src/egl/drivers/dri2/egl_dri2.c | 13 ++- src/egl/drivers/dri2/egl_dri2.h | 3 + src/egl/drivers/dri2/platform_null.c | 1

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Haixia Shi
The NULL platform is for off-screen rendering only. Render node support is required. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 ++ src/egl/drivers/dri2/egl_dri2.c | 13 ++- src/egl/drivers/dri2/egl_dri2.h | 3 + src/egl/drivers/dri2/platform_null.c | 1

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Emil Velikov
On 23/01/15 02:00, Haixia Shi wrote: > Hi Emil, > > On Thu, Jan 22, 2015 at 4:38 PM, Emil Velikov > wrote: >> On 22/01/15 22:23, Haixia Shi wrote: >>> Hi Emil >>> >>> On Thu, Jan 22, 2015 at 1:36 PM, Emil Velikov >>> wrote: Hi Haixia Shi, On 22/01/15 17:35, Haixia Shi wrote: >>>

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-23 Thread Frank Binns
On 23/01/15 01:11, Rob Clark wrote: > On Thu, Jan 22, 2015 at 4:36 PM, Emil Velikov > wrote: >>> +static const char* node_path_fmt_card = "/dev/dri/card%d"; >> You can reuse the DRM_DIR_NAME + DRM_DEV_NAME macros (from xf86drm.h) >> for this. >> >>> +static const char* node_path_fmt_render = "/de

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Haixia Shi
Hi Emil, On Thu, Jan 22, 2015 at 4:38 PM, Emil Velikov wrote: > On 22/01/15 22:23, Haixia Shi wrote: >> Hi Emil >> >> On Thu, Jan 22, 2015 at 1:36 PM, Emil Velikov >> wrote: >>> Hi Haixia Shi, >>> >>> On 22/01/15 17:35, Haixia Shi wrote: Try the render node first and use it if available. O

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Rob Clark
On Thu, Jan 22, 2015 at 4:36 PM, Emil Velikov wrote: >> +static const char* node_path_fmt_card = "/dev/dri/card%d"; > You can reuse the DRM_DIR_NAME + DRM_DEV_NAME macros (from xf86drm.h) > for this. > >> +static const char* node_path_fmt_render = "/dev/dri/renderD%d"; > There is no macro for the

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Emil Velikov
On 22/01/15 22:23, Haixia Shi wrote: > Hi Emil > > On Thu, Jan 22, 2015 at 1:36 PM, Emil Velikov > wrote: >> Hi Haixia Shi, >> >> On 22/01/15 17:35, Haixia Shi wrote: >>> Try the render node first and use it if available. Otherwise fall back to >>> normal nodes. >>> >> What is the use-case for s

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Haixia Shi
The NULL platform is for off-screen rendering only. Try the render node first and use it if available. Otherwise fall back to normal nodes. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 + src/egl/drivers/dri2/egl_dri2.c | 13 ++- src/egl/drivers/dri2/egl_dri2.h

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Haixia Shi
Hi Emil On Thu, Jan 22, 2015 at 1:36 PM, Emil Velikov wrote: > Hi Haixia Shi, > > On 22/01/15 17:35, Haixia Shi wrote: >> Try the render node first and use it if available. Otherwise fall back to >> normal nodes. >> > What is the use-case for such a platform - I assume it's worth > mentioning in

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Emil Velikov
Hi Haixia Shi, On 22/01/15 17:35, Haixia Shi wrote: > Try the render node first and use it if available. Otherwise fall back to > normal nodes. > What is the use-case for such a platform - I assume it's worth mentioning in the commit message ? No other platform picks the device at random as seen

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Haixia Shi
Try the render node first and use it if available. Otherwise fall back to normal nodes. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 + src/egl/drivers/dri2/egl_dri2.c | 13 ++- src/egl/drivers/dri2/egl_dri2.h | 3 + src/egl/drivers/dri2/platform_null.c |

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Eric Anholt
Haixia Shi writes: > Try the render node first and use it if available. Otherwise fall back to > normal nodes. > > Signed-off-by: Haixia Shi > +/* > + * Mesa 3-D graphics library > + * > + * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. > + * > + * Based on platform_x11, which

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-22 Thread Haixia Shi
Try the render node first and use it if available. Otherwise fall back to normal nodes. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 + src/egl/drivers/dri2/egl_dri2.c | 13 ++- src/egl/drivers/dri2/egl_dri2.h | 3 + src/egl/drivers/dri2/platform_null.c |

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-20 Thread Haixia Shi
Try the render node first and use it if available. Otherwise fall back to normal nodes. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 + src/egl/drivers/dri2/egl_dri2.c | 11 ++- src/egl/drivers/dri2/egl_dri2.h | 3 + src/egl/drivers/dri2/platform_null.c |

Re: [Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-20 Thread Matt Turner
On Tue, Jan 20, 2015 at 2:25 PM, Haixia Shi wrote: > diff --git a/src/egl/drivers/dri2/platform_null.c > b/src/egl/drivers/dri2/platform_null.c > new file mode 100644 > index 000..9c59809 > --- /dev/null > +++ b/src/egl/drivers/dri2/platform_null.c > @@ -0,0 +1,156 @@ > +/* > + * Copyright (c

[Mesa-dev] [PATCH] egl/dri2: implement platform_null.

2015-01-20 Thread Haixia Shi
Try the render node first and use it if available. Otherwise fall back to normal nodes. Signed-off-by: Haixia Shi --- src/egl/drivers/dri2/Makefile.am | 5 ++ src/egl/drivers/dri2/egl_dri2.c | 11 ++- src/egl/drivers/dri2/egl_dri2.h | 3 + src/egl/drivers/dri2/platform_null.c