Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-16 Thread Leo Liu



On 01/16/2018 04:48 AM, Christian König wrote:

Am 16.01.2018 um 10:40 schrieb Gurkirpal Singh:



On Mon, Jan 15, 2018 at 9:24 PM, Leo Liu > wrote:


Hi lists,


If there is no more questions, and no objection, I would like to
commit this new OMX st. to upstream.

@Gurkipal, If you can send me or lists your rebased patches set
for committing, that would be appreciated.

I wanted to know if it's required to test the patches before sending 
them.
I've since then switched to a laptop with NVIDIA card and have 
limited access to the desktop with the AMD card (that i used to work 
on during the project).
So I'm unable to test the encoder on this machine right now. It could 
take a few  weeks until I could do so.


Leo is just asking for the final cleanup before pushing the code, no 
need for an extra test here.
Yeah. rebase your patches and add "RB/AB", and make sure the meson build 
is added.

After that send patch set to the lists or to me, I will push them.

Regards,
Leo




Christian.



Leo


On 12/04/2017 08:58 AM, Leo Liu wrote:




On 12/03/2017 10:04 AM, Gurkirpal Singh wrote:

I sent the modified patches in another thread a while ago.
Please review in case got missed.

Please be patient for a few days to see if any other comments.
After then please rebase, add rb/ab to your patches, and send
them to me,
I will commit them for you.

Leo




On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu > wrote:



On 11/30/2017 06:22 AM, Julien Isorce wrote:

Hi Gurkirpal,

> Before refactoring process both the state trackers were in independent
directories.
> During earlier refactoring effort we decided to keep that directory
structure so it made
> sense to move them to auxiliary code. After that I moved them both 
under st/omx.
> Since there could be a chance of it being useful out of st/omx, I 
left the
decision to
> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you
said, i.e. there will now 2
sub directories, st/omx/bellagio and st/omx/tizonia and
common code in st/omx.

Yes. Please move them back to st/omx.

With that fixed, the series are:

Acked-by: Leo Liu  

Thanks for the work!

Leo





Another reason is that the env var "OMX_RENDER_NODE"
mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh
>
wrote:

---
 src/gallium/auxiliary/Makefile.sources             | 
 2 +
 src/gallium/auxiliary/vl/vl_screen.c               |
107 +
 src/gallium/auxiliary/vl/vl_screen.h               | 
33 +++
 .../state_trackers/omx_bellagio/entrypoint.c       | 
83 
 .../state_trackers/omx_bellagio/entrypoint.h       | 
 3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c  | 
 5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c  | 
 5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
vl/vl_mpeg12_decoder.c \
vl/vl_mpeg12_decoder.h \
        vl/vl_rbsp.h \
+       vl/vl_screen.c \
+       vl/vl_screen.h \
        vl/vl_types.h \
vl/vl_vertex_buffers.c \
vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@

+/**
+ *
+ * Permission is hereby granted, free of charge, to
any person obtaining a
+ * copy of this software and associated documentation
files (the
+ * "Software"), to deal in the Software without
restriction, including
+ * without limitation the rights to use, copy,

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-16 Thread Christian König

Am 16.01.2018 um 10:40 schrieb Gurkirpal Singh:



On Mon, Jan 15, 2018 at 9:24 PM, Leo Liu > wrote:


Hi lists,


If there is no more questions, and no objection, I would like to
commit this new OMX st. to upstream.

@Gurkipal, If you can send me or lists your rebased patches set
for committing, that would be appreciated.

I wanted to know if it's required to test the patches before sending them.
I've since then switched to a laptop with NVIDIA card and have limited 
access to the desktop with the AMD card (that i used to work on during 
the project).
So I'm unable to test the encoder on this machine right now. It could 
take a few  weeks until I could do so.


Leo is just asking for the final cleanup before pushing the code, no 
need for an extra test here.


Christian.



Leo


On 12/04/2017 08:58 AM, Leo Liu wrote:




On 12/03/2017 10:04 AM, Gurkirpal Singh wrote:

I sent the modified patches in another thread a while ago.
Please review in case got missed.

Please be patient for a few days to see if any other comments.
After then please rebase, add rb/ab to your patches, and send
them to me,
I will commit them for you.

Leo




On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu > wrote:



On 11/30/2017 06:22 AM, Julien Isorce wrote:

Hi Gurkirpal,

> Before refactoring process both the state trackers were in independent
directories.
> During earlier refactoring effort we decided to keep that directory
structure so it made
> sense to move them to auxiliary code. After that I moved them both 
under st/omx.
> Since there could be a chance of it being useful out of st/omx, I 
left the
decision to
> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you said,
i.e. there will now 2
sub directories, st/omx/bellagio and st/omx/tizonia and
common code in st/omx.

Yes. Please move them back to st/omx.

With that fixed, the series are:

Acked-by: Leo Liu  

Thanks for the work!

Leo





Another reason is that the env var "OMX_RENDER_NODE"
mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh
> wrote:

---
 src/gallium/auxiliary/Makefile.sources             |   2 +
 src/gallium/auxiliary/vl/vl_screen.c               |
107 +
 src/gallium/auxiliary/vl/vl_screen.h               | 
33 +++
 .../state_trackers/omx_bellagio/entrypoint.c       | 
83 
 .../state_trackers/omx_bellagio/entrypoint.h       |   3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c  | 
 5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c  | 
 5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
vl/vl_mpeg12_decoder.c \
vl/vl_mpeg12_decoder.h \
        vl/vl_rbsp.h \
+       vl/vl_screen.c \
+       vl/vl_screen.h \
        vl/vl_types.h \
vl/vl_vertex_buffers.c \
vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@

+/**
+ *
+ * Permission is hereby granted, free of charge, to
any person obtaining a
+ * copy of this software and associated documentation
files (the
+ * "Software"), to deal in the Software without
restriction, including
+ * without limitation the rights to use, copy, modify,
merge, publish,
+ * distribute, sub license, and/or sell copies of the
Software, and to
+ * permit persons to whom the Software is furnished to
do so, subject to
+ * the following 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-16 Thread Gurkirpal Singh
On Mon, Jan 15, 2018 at 9:24 PM, Leo Liu  wrote:

> Hi lists,
>
>
> If there is no more questions, and no objection, I would like to commit
> this new OMX st. to upstream.
>
> @Gurkipal, If you can send me or lists your rebased patches set for
> committing, that would be appreciated.
>
I wanted to know if it's required to test the patches before sending them.
I've since then switched to a laptop with NVIDIA card and have limited
access to the desktop with the AMD card (that i used to work on during the
project).
So I'm unable to test the encoder on this machine right now. It could take
a few  weeks until I could do so.

>
> Leo
>
> On 12/04/2017 08:58 AM, Leo Liu wrote:
>
>
>
> On 12/03/2017 10:04 AM, Gurkirpal Singh wrote:
>
> I sent the modified patches in another thread a while ago.
> Please review in case got missed.
>
> Please be patient for a few days to see if any other comments.
> After then please rebase, add rb/ab to your patches, and send them to me,
> I will commit them for you.
>
> Leo
>
>
>
> On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu  wrote:
>
>>
>>
>> On 11/30/2017 06:22 AM, Julien Isorce wrote:
>>
>> Hi Gurkirpal,
>>
>> > Before refactoring process both the state trackers were in independent
>> directories.
>> > During earlier refactoring effort we decided to keep that directory
>> structure so it made
>> > sense to move them to auxiliary code. After that I moved them both
>> under st/omx.
>> > Since there could be a chance of it being useful out of st/omx, I left
>> the decision to
>> > keep it or move it back to st/omx to the mailing list.
>>
>> Yes please move it back to st/omx for the reasons you said, i.e. there
>> will now 2
>> sub directories, st/omx/bellagio and st/omx/tizonia and common code in
>> st/omx.
>>
>> Yes. Please move them back to st/omx.
>>
>> With that fixed, the series are:
>>
>> Acked-by: Leo Liu  
>>
>> Thanks for the work!
>>
>> Leo
>>
>>
>>
>>
>> Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.
>>
>> Thx!
>> Julien
>>
>>
>> On 29 November 2017 at 04:02, Gurkirpal Singh 
>> wrote:
>>
>>> ---
>>>  src/gallium/auxiliary/Makefile.sources |   2 +
>>>  src/gallium/auxiliary/vl/vl_screen.c   | 107
>>> +
>>>  src/gallium/auxiliary/vl/vl_screen.h   |  33 +++
>>>  .../state_trackers/omx_bellagio/entrypoint.c   |  83
>>> 
>>>  .../state_trackers/omx_bellagio/entrypoint.h   |   3 -
>>>  src/gallium/state_trackers/omx_bellagio/vid_dec.c  |   5 +-
>>>  src/gallium/state_trackers/omx_bellagio/vid_enc.c  |   5 +-
>>>  7 files changed, 148 insertions(+), 90 deletions(-)
>>>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
>>>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.h
>>>
>>> diff --git a/src/gallium/auxiliary/Makefile.sources
>>> b/src/gallium/auxiliary/Makefile.sources
>>> index f40c472..35e89f9 100644
>>> --- a/src/gallium/auxiliary/Makefile.sources
>>> +++ b/src/gallium/auxiliary/Makefile.sources
>>> @@ -343,6 +343,8 @@ VL_SOURCES := \
>>> vl/vl_mpeg12_decoder.c \
>>> vl/vl_mpeg12_decoder.h \
>>> vl/vl_rbsp.h \
>>> +   vl/vl_screen.c \
>>> +   vl/vl_screen.h \
>>> vl/vl_types.h \
>>> vl/vl_vertex_buffers.c \
>>> vl/vl_vertex_buffers.h \
>>> diff --git a/src/gallium/auxiliary/vl/vl_screen.c
>>> b/src/gallium/auxiliary/vl/vl_screen.c
>>> new file mode 100644
>>> index 000..7192802
>>> --- /dev/null
>>> +++ b/src/gallium/auxiliary/vl/vl_screen.c
>>> @@ -0,0 +1,107 @@
>>> +/**
>>> 
>>> + *
>>> + * Permission is hereby granted, free of charge, to any person
>>> obtaining a
>>> + * copy of this software and associated documentation files (the
>>> + * "Software"), to deal in the Software without restriction, including
>>> + * without limitation the rights to use, copy, modify, merge, publish,
>>> + * distribute, sub license, and/or sell copies of the Software, and to
>>> + * permit persons to whom the Software is furnished to do so, subject to
>>> + * the following conditions:
>>> + *
>>> + * The above copyright notice and this permission notice (including the
>>> + * next paragraph) shall be included in all copies or substantial
>>> portions
>>> + * of the Software.
>>> + *
>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>>> EXPRESS
>>> + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>>> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>>> NON-INFRINGEMENT.
>>> + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
>>> + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
>>> CONTRACT,
>>> + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
>>> + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>>> + *
>>> + 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-15 Thread Leo Liu

Hi lists,


If there is no more questions, and no objection, I would like to commit 
this new OMX st. to upstream.


@Gurkipal, If you can send me or lists your rebased patches set for 
committing, that would be appreciated.



Leo


On 12/04/2017 08:58 AM, Leo Liu wrote:




On 12/03/2017 10:04 AM, Gurkirpal Singh wrote:

I sent the modified patches in another thread a while ago.
Please review in case got missed.

Please be patient for a few days to see if any other comments.
After then please rebase, add rb/ab to your patches, and send them to me,
I will commit them for you.

Leo




On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu > wrote:




On 11/30/2017 06:22 AM, Julien Isorce wrote:

Hi Gurkirpal,

> Before refactoring process both the state trackers were in independent 
directories.
> During earlier refactoring effort we decided to keep that directory 
structure so it made
> sense to move them to auxiliary code. After that I moved them both under 
st/omx.
> Since there could be a chance of it being useful out of st/omx, I left 
the decision to
> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you said, i.e.
there will now 2
sub directories, st/omx/bellagio and st/omx/tizonia and common
code in st/omx.

Yes. Please move them back to st/omx.

With that fixed, the series are:

Acked-by: Leo Liu  

Thanks for the work!

Leo





Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh
> wrote:

---
 src/gallium/auxiliary/Makefile.sources            |   2 +
 src/gallium/auxiliary/vl/vl_screen.c              | 107
+
 src/gallium/auxiliary/vl/vl_screen.h              |  33 +++
 .../state_trackers/omx_bellagio/entrypoint.c      |  83

 .../state_trackers/omx_bellagio/entrypoint.h      |   3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c |   5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c |   5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
        vl/vl_mpeg12_decoder.c \
        vl/vl_mpeg12_decoder.h \
        vl/vl_rbsp.h \
+       vl/vl_screen.c \
+       vl/vl_screen.h \
        vl/vl_types.h \
        vl/vl_vertex_buffers.c \
        vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@

+/**
+ *
+ * Permission is hereby granted, free of charge, to any
person obtaining a
+ * copy of this software and associated documentation files
(the
+ * "Software"), to deal in the Software without
restriction, including
+ * without limitation the rights to use, copy, modify,
merge, publish,
+ * distribute, sub license, and/or sell copies of the
Software, and to
+ * permit persons to whom the Software is furnished to do
so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice
(including the
+ * next paragraph) shall be included in all copies or
substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+

**/
+
+#include 
+#include 
+#include 
 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-11 Thread Dylan Baker
Please make sure the new .c file is added in the meson build as well before
pushing.

Dylan

Quoting Christian König (2018-01-10 05:03:44)
> My last status was that Leo wanted to commit this.
> 
> Leo are you still waiting for something?
> 
> Christian.
> 
> Am 10.01.2018 um 10:29 schrieb Julien Isorce:
> 
> Hi Christian,
> 
> >> Otherwise I'm going to give it a few more days on the list and push it
> if nobody objects.
> 
> Gentle ping ? So far the series are:
> 
> Acked-by: Leo Liu 
> Reviewed-by: Julien Isorce 
> 
> Thx
> Julien
> 
> On 30 November 2017 at 14:05, Leo Liu  wrote:
> 
>
> 
> 
> On 11/30/2017 06:22 AM, Julien Isorce wrote:
> 
> Hi Gurkirpal,
> 
> > Before refactoring process both the state trackers were in
> independent directories.
> > During earlier refactoring effort we decided to keep that
> directory structure so it made
> > sense to move them to auxiliary code. After that I moved them
> both under st/omx.
> > Since there could be a chance of it being useful out of st/omx, 
> I
> left the decision to
> > keep it or move it back to st/omx to the mailing list.
> 
> Yes please move it back to st/omx for the reasons you said, i.e.
> there will now 2
> sub directories, st/omx/bellagio and st/omx/tizonia and common 
> code
> in st/omx.
> 
> Yes. Please move them back to st/omx.
> 
> With that fixed, the series are:
> 
> Acked-by: Leo Liu 
> 
> Thanks for the work!
> 
> Leo
> 
> 
> 
> 
> 
> Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.
> 
> Thx!
> Julien
> 
> 
> On 29 November 2017 at 04:02, Gurkirpal Singh <
> gurkirpal...@gmail.com> wrote:
> 
> ---
>  src/gallium/auxiliary/Makefile.sources             |   2 +
>  src/gallium/auxiliary/vl/vl_screen.c               | 107
> +
>  src/gallium/auxiliary/vl/vl_screen.h               |  33
> +++
>  .../state_trackers/omx_bellagio/entrypoint.c       |  83
> 
>  .../state_trackers/omx_bellagio/entrypoint.h       |   3 -
>  src/gallium/state_trackers/omx_bellagio/vid_dec.c  |   5 +-
>  src/gallium/state_trackers/omx_bellagio/vid_enc.c  |   5 +-
>  7 files changed, 148 insertions(+), 90 deletions(-)
>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.h
> 
> diff --git a/src/gallium/auxiliary/Makefile.sources b/src/
> gallium/auxiliary/Makefile.sources
> index f40c472..35e89f9 100644
> --- a/src/gallium/auxiliary/Makefile.sources
> +++ b/src/gallium/auxiliary/Makefile.sources
> @@ -343,6 +343,8 @@ VL_SOURCES := \
>         vl/vl_mpeg12_decoder.c \
>         vl/vl_mpeg12_decoder.h \
>         vl/vl_rbsp.h \
> +       vl/vl_screen.c \
> +       vl/vl_screen.h \
>         vl/vl_types.h \
>         vl/vl_vertex_buffers.c \
>         vl/vl_vertex_buffers.h \
> diff --git a/src/gallium/auxiliary/vl/vl_screen.c 
> b/src/gallium
> /auxiliary/vl/vl_screen.c
> new file mode 100644
> index 000..7192802
> --- /dev/null
> +++ b/src/gallium/auxiliary/vl/vl_screen.c
> @@ -0,0 +1,107 @@
> +/**
> 
> + *
> + * Permission is hereby granted, free of charge, to any 
> person
> obtaining a
> + * copy of this software and associated documentation files
> (the
> + * "Software"), to deal in the Software without restriction,
> including
> + * without limitation the rights to use, copy, modify, merge,
> publish,
> + * distribute, sub license, and/or sell copies of the
> Software, and to
> + * permit persons to whom the Software is furnished to do so,
> subject to
> + * the following conditions:
> + *
> + * The above copyright notice and this permission notice
> (including the
> + * next paragraph) shall be included in all copies or

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-10 Thread Christian König

My last status was that Leo wanted to commit this.

Leo are you still waiting for something?

Christian.

Am 10.01.2018 um 10:29 schrieb Julien Isorce:

Hi Christian,

>> Otherwise I'm going to give it a few more days on the list and push 
it if nobody objects.


Gentle ping ? So far the series are:

Acked-by: Leo Liu  
Reviewed-by: Julien Isorce >


Thx
Julien

On 30 November 2017 at 14:05, Leo Liu > wrote:




On 11/30/2017 06:22 AM, Julien Isorce wrote:

Hi Gurkirpal,

> Before refactoring process both the state trackers were in independent 
directories.
> During earlier refactoring effort we decided to keep that directory 
structure so it made
> sense to move them to auxiliary code. After that I moved them both under 
st/omx.
> Since there could be a chance of it being useful out of st/omx, I left 
the decision to
> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you said, i.e.
there will now 2
sub directories, st/omx/bellagio and st/omx/tizonia and common
code in st/omx.

Yes. Please move them back to st/omx.

With that fixed, the series are:

Acked-by: Leo Liu  

Thanks for the work!

Leo





Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh
> wrote:

---
 src/gallium/auxiliary/Makefile.sources            |   2 +
 src/gallium/auxiliary/vl/vl_screen.c              | 107
+
 src/gallium/auxiliary/vl/vl_screen.h              |  33 +++
 .../state_trackers/omx_bellagio/entrypoint.c      |  83

 .../state_trackers/omx_bellagio/entrypoint.h      |   3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c |   5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c |   5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
        vl/vl_mpeg12_decoder.c \
        vl/vl_mpeg12_decoder.h \
        vl/vl_rbsp.h \
+       vl/vl_screen.c \
+       vl/vl_screen.h \
        vl/vl_types.h \
        vl/vl_vertex_buffers.c \
        vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@

+/**
+ *
+ * Permission is hereby granted, free of charge, to any
person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction,
including
+ * without limitation the rights to use, copy, modify,
merge, publish,
+ * distribute, sub license, and/or sell copies of the
Software, and to
+ * permit persons to whom the Software is furnished to do
so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice
(including the
+ * next paragraph) shall be included in all copies or
substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+

**/
+
+#include 
+#include 
+#include 
+
+#include "os/os_thread.h"
+#include "util/u_memory.h"
+#include "loader/loader.h"
+#include 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2018-01-10 Thread Julien Isorce
Hi Christian,

>> Otherwise I'm going to give it a few more days on the list and push it
if nobody objects.

Gentle ping ? So far the series are:

Acked-by: Leo Liu  
Reviewed-by: Julien Isorce 

Thx
Julien

On 30 November 2017 at 14:05, Leo Liu  wrote:

>
>
> On 11/30/2017 06:22 AM, Julien Isorce wrote:
>
> Hi Gurkirpal,
>
> > Before refactoring process both the state trackers were in independent
> directories.
> > During earlier refactoring effort we decided to keep that directory
> structure so it made
> > sense to move them to auxiliary code. After that I moved them both under
> st/omx.
> > Since there could be a chance of it being useful out of st/omx, I left
> the decision to
> > keep it or move it back to st/omx to the mailing list.
>
> Yes please move it back to st/omx for the reasons you said, i.e. there
> will now 2
> sub directories, st/omx/bellagio and st/omx/tizonia and common code in
> st/omx.
>
> Yes. Please move them back to st/omx.
>
> With that fixed, the series are:
>
> Acked-by: Leo Liu  
>
> Thanks for the work!
>
> Leo
>
>
>
>
> Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.
>
> Thx!
> Julien
>
>
> On 29 November 2017 at 04:02, Gurkirpal Singh 
> wrote:
>
>> ---
>>  src/gallium/auxiliary/Makefile.sources |   2 +
>>  src/gallium/auxiliary/vl/vl_screen.c   | 107
>> +
>>  src/gallium/auxiliary/vl/vl_screen.h   |  33 +++
>>  .../state_trackers/omx_bellagio/entrypoint.c   |  83
>> 
>>  .../state_trackers/omx_bellagio/entrypoint.h   |   3 -
>>  src/gallium/state_trackers/omx_bellagio/vid_dec.c  |   5 +-
>>  src/gallium/state_trackers/omx_bellagio/vid_enc.c  |   5 +-
>>  7 files changed, 148 insertions(+), 90 deletions(-)
>>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
>>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.h
>>
>> diff --git a/src/gallium/auxiliary/Makefile.sources
>> b/src/gallium/auxiliary/Makefile.sources
>> index f40c472..35e89f9 100644
>> --- a/src/gallium/auxiliary/Makefile.sources
>> +++ b/src/gallium/auxiliary/Makefile.sources
>> @@ -343,6 +343,8 @@ VL_SOURCES := \
>> vl/vl_mpeg12_decoder.c \
>> vl/vl_mpeg12_decoder.h \
>> vl/vl_rbsp.h \
>> +   vl/vl_screen.c \
>> +   vl/vl_screen.h \
>> vl/vl_types.h \
>> vl/vl_vertex_buffers.c \
>> vl/vl_vertex_buffers.h \
>> diff --git a/src/gallium/auxiliary/vl/vl_screen.c
>> b/src/gallium/auxiliary/vl/vl_screen.c
>> new file mode 100644
>> index 000..7192802
>> --- /dev/null
>> +++ b/src/gallium/auxiliary/vl/vl_screen.c
>> @@ -0,0 +1,107 @@
>> +/**
>> 
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining
>> a
>> + * copy of this software and associated documentation files (the
>> + * "Software"), to deal in the Software without restriction, including
>> + * without limitation the rights to use, copy, modify, merge, publish,
>> + * distribute, sub license, and/or sell copies of the Software, and to
>> + * permit persons to whom the Software is furnished to do so, subject to
>> + * the following conditions:
>> + *
>> + * The above copyright notice and this permission notice (including the
>> + * next paragraph) shall be included in all copies or substantial
>> portions
>> + * of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> EXPRESS
>> + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> NON-INFRINGEMENT.
>> + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
>> + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
>> CONTRACT,
>> + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
>> + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>> + *
>> + 
>> **/
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "os/os_thread.h"
>> +#include "util/u_memory.h"
>> +#include "loader/loader.h"
>> +#include "vl_screen.h"
>> +
>> +#if defined(HAVE_X11_PLATFORM)
>> +#include 
>> +#else
>> +#define XOpenDisplay(x) NULL
>> +#define XCloseDisplay(x)
>> +#define Display void
>> +#endif
>> +
>> +static mtx_t st_lock = _MTX_INITIALIZER_NP;
>> +static Display *st_display = NULL;
>> +static struct vl_screen *st_screen = NULL;
>> +static unsigned st_usecount = 0;
>> +static const char *st_render_node = NULL;
>> +static int drm_fd;
>> +
>> +struct vl_screen *vl_get_screen(const char* render_node)
>> +{
>> +   static bool first_time = true;
>> +   mtx_lock(_lock);
>> +
>> +   if (!st_screen) {
>> +  if (first_time) {
>> + st_render_node = debug_get_option(render_node, NULL);
>> +   

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2017-12-04 Thread Leo Liu



On 12/03/2017 10:04 AM, Gurkirpal Singh wrote:

I sent the modified patches in another thread a while ago.
Please review in case got missed.

Please be patient for a few days to see if any other comments.
After then please rebase, add rb/ab to your patches, and send them to me,
I will commit them for you.

Leo




On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu > wrote:




On 11/30/2017 06:22 AM, Julien Isorce wrote:

Hi Gurkirpal,

> Before refactoring process both the state trackers were in independent 
directories.
> During earlier refactoring effort we decided to keep that directory 
structure so it made
> sense to move them to auxiliary code. After that I moved them both under 
st/omx.
> Since there could be a chance of it being useful out of st/omx, I left 
the decision to
> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you said, i.e.
there will now 2
sub directories, st/omx/bellagio and st/omx/tizonia and common
code in st/omx.

Yes. Please move them back to st/omx.

With that fixed, the series are:

Acked-by: Leo Liu  

Thanks for the work!

Leo





Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh
> wrote:

---
 src/gallium/auxiliary/Makefile.sources            |   2 +
 src/gallium/auxiliary/vl/vl_screen.c            | 107
+
 src/gallium/auxiliary/vl/vl_screen.h            |  33 +++
 .../state_trackers/omx_bellagio/entrypoint.c      |  83

 .../state_trackers/omx_bellagio/entrypoint.h      |   3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c |   5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c |   5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
        vl/vl_mpeg12_decoder.c \
        vl/vl_mpeg12_decoder.h \
        vl/vl_rbsp.h \
+       vl/vl_screen.c \
+       vl/vl_screen.h \
        vl/vl_types.h \
        vl/vl_vertex_buffers.c \
        vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@

+/**
+ *
+ * Permission is hereby granted, free of charge, to any
person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction,
including
+ * without limitation the rights to use, copy, modify,
merge, publish,
+ * distribute, sub license, and/or sell copies of the
Software, and to
+ * permit persons to whom the Software is furnished to do
so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice
(including the
+ * next paragraph) shall be included in all copies or
substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+

**/
+
+#include 
+#include 
+#include 
+
+#include "os/os_thread.h"
+#include "util/u_memory.h"
+#include "loader/loader.h"
+#include "vl_screen.h"
+
+#if defined(HAVE_X11_PLATFORM)
+#include 
+#else
+#define XOpenDisplay(x) NULL
+#define 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2017-12-03 Thread Gurkirpal Singh
I sent the modified patches in another thread a while ago.
Please review in case got missed.

On Thu, Nov 30, 2017 at 7:35 PM, Leo Liu  wrote:

>
>
> On 11/30/2017 06:22 AM, Julien Isorce wrote:
>
> Hi Gurkirpal,
>
> > Before refactoring process both the state trackers were in independent
> directories.
> > During earlier refactoring effort we decided to keep that directory
> structure so it made
> > sense to move them to auxiliary code. After that I moved them both under
> st/omx.
> > Since there could be a chance of it being useful out of st/omx, I left
> the decision to
> > keep it or move it back to st/omx to the mailing list.
>
> Yes please move it back to st/omx for the reasons you said, i.e. there
> will now 2
> sub directories, st/omx/bellagio and st/omx/tizonia and common code in
> st/omx.
>
> Yes. Please move them back to st/omx.
>
> With that fixed, the series are:
>
> Acked-by: Leo Liu  
>
> Thanks for the work!
>
> Leo
>
>
>
>
> Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.
>
> Thx!
> Julien
>
>
> On 29 November 2017 at 04:02, Gurkirpal Singh 
> wrote:
>
>> ---
>>  src/gallium/auxiliary/Makefile.sources |   2 +
>>  src/gallium/auxiliary/vl/vl_screen.c   | 107
>> +
>>  src/gallium/auxiliary/vl/vl_screen.h   |  33 +++
>>  .../state_trackers/omx_bellagio/entrypoint.c   |  83
>> 
>>  .../state_trackers/omx_bellagio/entrypoint.h   |   3 -
>>  src/gallium/state_trackers/omx_bellagio/vid_dec.c  |   5 +-
>>  src/gallium/state_trackers/omx_bellagio/vid_enc.c  |   5 +-
>>  7 files changed, 148 insertions(+), 90 deletions(-)
>>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
>>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.h
>>
>> diff --git a/src/gallium/auxiliary/Makefile.sources
>> b/src/gallium/auxiliary/Makefile.sources
>> index f40c472..35e89f9 100644
>> --- a/src/gallium/auxiliary/Makefile.sources
>> +++ b/src/gallium/auxiliary/Makefile.sources
>> @@ -343,6 +343,8 @@ VL_SOURCES := \
>> vl/vl_mpeg12_decoder.c \
>> vl/vl_mpeg12_decoder.h \
>> vl/vl_rbsp.h \
>> +   vl/vl_screen.c \
>> +   vl/vl_screen.h \
>> vl/vl_types.h \
>> vl/vl_vertex_buffers.c \
>> vl/vl_vertex_buffers.h \
>> diff --git a/src/gallium/auxiliary/vl/vl_screen.c
>> b/src/gallium/auxiliary/vl/vl_screen.c
>> new file mode 100644
>> index 000..7192802
>> --- /dev/null
>> +++ b/src/gallium/auxiliary/vl/vl_screen.c
>> @@ -0,0 +1,107 @@
>> +/**
>> 
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining
>> a
>> + * copy of this software and associated documentation files (the
>> + * "Software"), to deal in the Software without restriction, including
>> + * without limitation the rights to use, copy, modify, merge, publish,
>> + * distribute, sub license, and/or sell copies of the Software, and to
>> + * permit persons to whom the Software is furnished to do so, subject to
>> + * the following conditions:
>> + *
>> + * The above copyright notice and this permission notice (including the
>> + * next paragraph) shall be included in all copies or substantial
>> portions
>> + * of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> EXPRESS
>> + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> NON-INFRINGEMENT.
>> + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
>> + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
>> CONTRACT,
>> + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
>> + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
>> + *
>> + 
>> **/
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "os/os_thread.h"
>> +#include "util/u_memory.h"
>> +#include "loader/loader.h"
>> +#include "vl_screen.h"
>> +
>> +#if defined(HAVE_X11_PLATFORM)
>> +#include 
>> +#else
>> +#define XOpenDisplay(x) NULL
>> +#define XCloseDisplay(x)
>> +#define Display void
>> +#endif
>> +
>> +static mtx_t st_lock = _MTX_INITIALIZER_NP;
>> +static Display *st_display = NULL;
>> +static struct vl_screen *st_screen = NULL;
>> +static unsigned st_usecount = 0;
>> +static const char *st_render_node = NULL;
>> +static int drm_fd;
>> +
>> +struct vl_screen *vl_get_screen(const char* render_node)
>> +{
>> +   static bool first_time = true;
>> +   mtx_lock(_lock);
>> +
>> +   if (!st_screen) {
>> +  if (first_time) {
>> + st_render_node = debug_get_option(render_node, NULL);
>> + first_time = false;
>> +  }
>> +  if (st_render_node) {
>> + drm_fd = loader_open_device(st_render_node);
>> + if (drm_fd < 0)
>> + 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2017-11-30 Thread Leo Liu



On 11/30/2017 06:22 AM, Julien Isorce wrote:

Hi Gurkirpal,

> Before refactoring process both the state trackers were in 
independent directories.
> During earlier refactoring effort we decided to keep that directory 
structure so it made
> sense to move them to auxiliary code. After that I moved them both 
under st/omx.
> Since there could be a chance of it being useful out of st/omx, I 
left the decision to

> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you said, i.e. there 
will now 2
sub directories, st/omx/bellagio and st/omx/tizonia and common code in 
st/omx.

Yes. Please move them back to st/omx.

With that fixed, the series are:

Acked-by: Leo Liu 

Thanks for the work!

Leo




Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh > wrote:


---
 src/gallium/auxiliary/Makefile.sources             |  2 +
 src/gallium/auxiliary/vl/vl_screen.c               | 107
+
 src/gallium/auxiliary/vl/vl_screen.h               | 33 +++
 .../state_trackers/omx_bellagio/entrypoint.c       | 83

 .../state_trackers/omx_bellagio/entrypoint.h       |  3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c  |  5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c  |  5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
        vl/vl_mpeg12_decoder.c \
        vl/vl_mpeg12_decoder.h \
        vl/vl_rbsp.h \
+       vl/vl_screen.c \
+       vl/vl_screen.h \
        vl/vl_types.h \
        vl/vl_vertex_buffers.c \
        vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@
+/**
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction,
including
+ * without limitation the rights to use, copy, modify, merge,
publish,
+ * distribute, sub license, and/or sell copies of the Software,
and to
+ * permit persons to whom the Software is furnished to do so,
subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice
(including the
+ * next paragraph) shall be included in all copies or substantial
portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+
**/
+
+#include 
+#include 
+#include 
+
+#include "os/os_thread.h"
+#include "util/u_memory.h"
+#include "loader/loader.h"
+#include "vl_screen.h"
+
+#if defined(HAVE_X11_PLATFORM)
+#include 
+#else
+#define XOpenDisplay(x) NULL
+#define XCloseDisplay(x)
+#define Display void
+#endif
+
+static mtx_t st_lock = _MTX_INITIALIZER_NP;
+static Display *st_display = NULL;
+static struct vl_screen *st_screen = NULL;
+static unsigned st_usecount = 0;
+static const char *st_render_node = NULL;
+static int drm_fd;
+
+struct vl_screen *vl_get_screen(const char* render_node)
+{
+   static bool first_time = true;
+   mtx_lock(_lock);
+
+   if (!st_screen) {
+      if (first_time) {
+         st_render_node = debug_get_option(render_node, NULL);
+         first_time = false;
+      }
+      if (st_render_node) {
+         drm_fd = loader_open_device(st_render_node);
+         if (drm_fd < 0)
+            goto error;
+
+         st_screen = vl_drm_screen_create(drm_fd);
+         if 

Re: [Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2017-11-30 Thread Julien Isorce
Hi Gurkirpal,

> Before refactoring process both the state trackers were in independent
directories.
> During earlier refactoring effort we decided to keep that directory
structure so it made
> sense to move them to auxiliary code. After that I moved them both under
st/omx.
> Since there could be a chance of it being useful out of st/omx, I left
the decision to
> keep it or move it back to st/omx to the mailing list.

Yes please move it back to st/omx for the reasons you said, i.e. there will
now 2
sub directories, st/omx/bellagio and st/omx/tizonia and common code in
st/omx.

Another reason is that the env var "OMX_RENDER_NODE" mentions OMX.

Thx!
Julien


On 29 November 2017 at 04:02, Gurkirpal Singh 
wrote:

> ---
>  src/gallium/auxiliary/Makefile.sources |   2 +
>  src/gallium/auxiliary/vl/vl_screen.c   | 107
> +
>  src/gallium/auxiliary/vl/vl_screen.h   |  33 +++
>  .../state_trackers/omx_bellagio/entrypoint.c   |  83 
>  .../state_trackers/omx_bellagio/entrypoint.h   |   3 -
>  src/gallium/state_trackers/omx_bellagio/vid_dec.c  |   5 +-
>  src/gallium/state_trackers/omx_bellagio/vid_enc.c  |   5 +-
>  7 files changed, 148 insertions(+), 90 deletions(-)
>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
>  create mode 100644 src/gallium/auxiliary/vl/vl_screen.h
>
> diff --git a/src/gallium/auxiliary/Makefile.sources
> b/src/gallium/auxiliary/Makefile.sources
> index f40c472..35e89f9 100644
> --- a/src/gallium/auxiliary/Makefile.sources
> +++ b/src/gallium/auxiliary/Makefile.sources
> @@ -343,6 +343,8 @@ VL_SOURCES := \
> vl/vl_mpeg12_decoder.c \
> vl/vl_mpeg12_decoder.h \
> vl/vl_rbsp.h \
> +   vl/vl_screen.c \
> +   vl/vl_screen.h \
> vl/vl_types.h \
> vl/vl_vertex_buffers.c \
> vl/vl_vertex_buffers.h \
> diff --git a/src/gallium/auxiliary/vl/vl_screen.c
> b/src/gallium/auxiliary/vl/vl_screen.c
> new file mode 100644
> index 000..7192802
> --- /dev/null
> +++ b/src/gallium/auxiliary/vl/vl_screen.c
> @@ -0,0 +1,107 @@
> +/**
> 
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> + * "Software"), to deal in the Software without restriction, including
> + * without limitation the rights to use, copy, modify, merge, publish,
> + * distribute, sub license, and/or sell copies of the Software, and to
> + * permit persons to whom the Software is furnished to do so, subject to
> + * the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> + * next paragraph) shall be included in all copies or substantial portions
> + * of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
> + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
> + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
> + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
> CONTRACT,
> + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
> + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> + *
> + 
> **/
> +
> +#include 
> +#include 
> +#include 
> +
> +#include "os/os_thread.h"
> +#include "util/u_memory.h"
> +#include "loader/loader.h"
> +#include "vl_screen.h"
> +
> +#if defined(HAVE_X11_PLATFORM)
> +#include 
> +#else
> +#define XOpenDisplay(x) NULL
> +#define XCloseDisplay(x)
> +#define Display void
> +#endif
> +
> +static mtx_t st_lock = _MTX_INITIALIZER_NP;
> +static Display *st_display = NULL;
> +static struct vl_screen *st_screen = NULL;
> +static unsigned st_usecount = 0;
> +static const char *st_render_node = NULL;
> +static int drm_fd;
> +
> +struct vl_screen *vl_get_screen(const char* render_node)
> +{
> +   static bool first_time = true;
> +   mtx_lock(_lock);
> +
> +   if (!st_screen) {
> +  if (first_time) {
> + st_render_node = debug_get_option(render_node, NULL);
> + first_time = false;
> +  }
> +  if (st_render_node) {
> + drm_fd = loader_open_device(st_render_node);
> + if (drm_fd < 0)
> +goto error;
> +
> + st_screen = vl_drm_screen_create(drm_fd);
> + if (!st_screen) {
> +close(drm_fd);
> +goto error;
> + }
> +  } else {
> + st_display = XOpenDisplay(NULL);
> + if (!st_display)
> +goto error;
> +
> + st_screen = vl_dri3_screen_create(st_display, 0);
> + if (!st_screen)
> +st_screen = vl_dri2_screen_create(st_display, 0);
> + if (!st_screen) {
> +XCloseDisplay(st_display);
> +goto 

[Mesa-dev] [PATCH 1/7] gallium: Refactor out vl_put_screen and vl_get_screen

2017-11-28 Thread Gurkirpal Singh
---
 src/gallium/auxiliary/Makefile.sources |   2 +
 src/gallium/auxiliary/vl/vl_screen.c   | 107 +
 src/gallium/auxiliary/vl/vl_screen.h   |  33 +++
 .../state_trackers/omx_bellagio/entrypoint.c   |  83 
 .../state_trackers/omx_bellagio/entrypoint.h   |   3 -
 src/gallium/state_trackers/omx_bellagio/vid_dec.c  |   5 +-
 src/gallium/state_trackers/omx_bellagio/vid_enc.c  |   5 +-
 7 files changed, 148 insertions(+), 90 deletions(-)
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.c
 create mode 100644 src/gallium/auxiliary/vl/vl_screen.h

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index f40c472..35e89f9 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -343,6 +343,8 @@ VL_SOURCES := \
vl/vl_mpeg12_decoder.c \
vl/vl_mpeg12_decoder.h \
vl/vl_rbsp.h \
+   vl/vl_screen.c \
+   vl/vl_screen.h \
vl/vl_types.h \
vl/vl_vertex_buffers.c \
vl/vl_vertex_buffers.h \
diff --git a/src/gallium/auxiliary/vl/vl_screen.c 
b/src/gallium/auxiliary/vl/vl_screen.c
new file mode 100644
index 000..7192802
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.c
@@ -0,0 +1,107 @@
+/**
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include 
+#include 
+#include 
+
+#include "os/os_thread.h"
+#include "util/u_memory.h"
+#include "loader/loader.h"
+#include "vl_screen.h"
+
+#if defined(HAVE_X11_PLATFORM)
+#include 
+#else
+#define XOpenDisplay(x) NULL
+#define XCloseDisplay(x)
+#define Display void
+#endif
+
+static mtx_t st_lock = _MTX_INITIALIZER_NP;
+static Display *st_display = NULL;
+static struct vl_screen *st_screen = NULL;
+static unsigned st_usecount = 0;
+static const char *st_render_node = NULL;
+static int drm_fd;
+
+struct vl_screen *vl_get_screen(const char* render_node)
+{
+   static bool first_time = true;
+   mtx_lock(_lock);
+
+   if (!st_screen) {
+  if (first_time) {
+ st_render_node = debug_get_option(render_node, NULL);
+ first_time = false;
+  }
+  if (st_render_node) {
+ drm_fd = loader_open_device(st_render_node);
+ if (drm_fd < 0)
+goto error;
+
+ st_screen = vl_drm_screen_create(drm_fd);
+ if (!st_screen) {
+close(drm_fd);
+goto error;
+ }
+  } else {
+ st_display = XOpenDisplay(NULL);
+ if (!st_display)
+goto error;
+
+ st_screen = vl_dri3_screen_create(st_display, 0);
+ if (!st_screen)
+st_screen = vl_dri2_screen_create(st_display, 0);
+ if (!st_screen) {
+XCloseDisplay(st_display);
+goto error;
+ }
+  }
+   }
+
+   ++st_usecount;
+
+   mtx_unlock(_lock);
+   return st_screen;
+
+error:
+   mtx_unlock(_lock);
+   return NULL;
+}
+
+void vl_put_screen(void)
+{
+   mtx_lock(_lock);
+   if ((--st_usecount) == 0) {
+  st_screen->destroy(st_screen);
+  st_screen = NULL;
+
+  if (st_render_node)
+ close(drm_fd);
+  else
+ XCloseDisplay(st_display);
+   }
+   mtx_unlock(_lock);
+}
diff --git a/src/gallium/auxiliary/vl/vl_screen.h 
b/src/gallium/auxiliary/vl/vl_screen.h
new file mode 100644
index 000..1e14775
--- /dev/null
+++ b/src/gallium/auxiliary/vl/vl_screen.h
@@ -0,0 +1,33 @@
+/**
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to