[6/6] gallium\auxiliary\vl: Add video compute shader render

Submitted by Zhu, James on Feb. 1, 2019, 4:28 p.m.

Details

Message ID 1549038496-10500-7-git-send-email-James.Zhu@amd.com
State New
Headers show
Series "Add compute shader support on video compositor render" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhu, James Feb. 1, 2019, 4:28 p.m.
Add video compute shader render. export CS_COMPOSITOR_RENDER=true
to enable video compute shader render.

Signed-off-by: James Zhu <James.Zhu@amd.com>
---
 src/gallium/auxiliary/vl/vl_compositor.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 7ee8402..66a8fc9 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -1376,8 +1376,8 @@  vl_compositor_convert_rgb_to_yuv(struct vl_compositor_state *s,
    s->pipe->flush(s->pipe, NULL, 0);
 }
 
-void
-vl_compositor_render(struct vl_compositor_state *s,
+static void
+vl_compositor_gfx_render(struct vl_compositor_state *s,
                      struct vl_compositor       *c,
                      struct pipe_surface        *dst_surface,
                      struct u_rect              *dirty_area,
@@ -1419,6 +1419,21 @@  vl_compositor_render(struct vl_compositor_state *s,
    draw_layers(c, s, dirty_area);
 }
 
+void
+vl_compositor_render(struct vl_compositor_state *s,
+                     struct vl_compositor       *c,
+                     struct pipe_surface        *dst_surface,
+                     struct u_rect              *dirty_area,
+                     bool                        clear_dirty)
+{
+   assert(s);
+
+   if (cs_compositor_render_enable && s->layers->cs)
+      vl_compositor_cs_render(s, c, dst_surface, dirty_area, clear_dirty);
+   else
+      vl_compositor_gfx_render(s, c, dst_surface, dirty_area, clear_dirty);
+}
+
 bool
 vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)
 {

Comments

Am 01.02.19 um 17:28 schrieb Zhu, James:
> Add video compute shader render. export CS_COMPOSITOR_RENDER=true
> to enable video compute shader render.

Ok that actually makes more sense, but I would either put everything 
into one file or cleanly separate between gfx and compute implementation.

Christian.

>
> Signed-off-by: James Zhu <James.Zhu@amd.com>
> ---
>   src/gallium/auxiliary/vl/vl_compositor.c | 19 +++++++++++++++++--
>   1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
> index 7ee8402..66a8fc9 100644
> --- a/src/gallium/auxiliary/vl/vl_compositor.c
> +++ b/src/gallium/auxiliary/vl/vl_compositor.c
> @@ -1376,8 +1376,8 @@ vl_compositor_convert_rgb_to_yuv(struct vl_compositor_state *s,
>      s->pipe->flush(s->pipe, NULL, 0);
>   }
>   
> -void
> -vl_compositor_render(struct vl_compositor_state *s,
> +static void
> +vl_compositor_gfx_render(struct vl_compositor_state *s,
>                        struct vl_compositor       *c,
>                        struct pipe_surface        *dst_surface,
>                        struct u_rect              *dirty_area,
> @@ -1419,6 +1419,21 @@ vl_compositor_render(struct vl_compositor_state *s,
>      draw_layers(c, s, dirty_area);
>   }
>   
> +void
> +vl_compositor_render(struct vl_compositor_state *s,
> +                     struct vl_compositor       *c,
> +                     struct pipe_surface        *dst_surface,
> +                     struct u_rect              *dirty_area,
> +                     bool                        clear_dirty)
> +{
> +   assert(s);
> +
> +   if (cs_compositor_render_enable && s->layers->cs)
> +      vl_compositor_cs_render(s, c, dst_surface, dirty_area, clear_dirty);
> +   else
> +      vl_compositor_gfx_render(s, c, dst_surface, dirty_area, clear_dirty);
> +}
> +
>   bool
>   vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)
>   {
On 2019-02-01 11:38 a.m., Christian König wrote:
> Am 01.02.19 um 17:28 schrieb Zhu, James:

>> Add video compute shader render. export CS_COMPOSITOR_RENDER=true

>> to enable video compute shader render.

>

> Ok that actually makes more sense, but I would either put everything 

> into one file or cleanly separate between gfx and compute implementation.


Don't want to jump too far at first. Plan to do in the future.

James

>

> Christian.

>

>>

>> Signed-off-by: James Zhu <James.Zhu@amd.com>

>> ---

>>   src/gallium/auxiliary/vl/vl_compositor.c | 19 +++++++++++++++++--

>>   1 file changed, 17 insertions(+), 2 deletions(-)

>>

>> diff --git a/src/gallium/auxiliary/vl/vl_compositor.c 

>> b/src/gallium/auxiliary/vl/vl_compositor.c

>> index 7ee8402..66a8fc9 100644

>> --- a/src/gallium/auxiliary/vl/vl_compositor.c

>> +++ b/src/gallium/auxiliary/vl/vl_compositor.c

>> @@ -1376,8 +1376,8 @@ vl_compositor_convert_rgb_to_yuv(struct 

>> vl_compositor_state *s,

>>      s->pipe->flush(s->pipe, NULL, 0);

>>   }

>>   -void

>> -vl_compositor_render(struct vl_compositor_state *s,

>> +static void

>> +vl_compositor_gfx_render(struct vl_compositor_state *s,

>>                        struct vl_compositor       *c,

>>                        struct pipe_surface        *dst_surface,

>>                        struct u_rect              *dirty_area,

>> @@ -1419,6 +1419,21 @@ vl_compositor_render(struct 

>> vl_compositor_state *s,

>>      draw_layers(c, s, dirty_area);

>>   }

>>   +void

>> +vl_compositor_render(struct vl_compositor_state *s,

>> +                     struct vl_compositor       *c,

>> +                     struct pipe_surface        *dst_surface,

>> +                     struct u_rect              *dirty_area,

>> +                     bool                        clear_dirty)

>> +{

>> +   assert(s);

>> +

>> +   if (cs_compositor_render_enable && s->layers->cs)

>> +      vl_compositor_cs_render(s, c, dst_surface, dirty_area, 

>> clear_dirty);

>> +   else

>> +      vl_compositor_gfx_render(s, c, dst_surface, dirty_area, 

>> clear_dirty);

>> +}

>> +

>>   bool

>>   vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)

>>   {

>
On 2/1/19 11:38 AM, Christian König wrote:
> Am 01.02.19 um 17:28 schrieb Zhu, James:

>> Add video compute shader render. export CS_COMPOSITOR_RENDER=true

>> to enable video compute shader render.

>

> Ok that actually makes more sense, but I would either put everything 

> into one file or cleanly separate between gfx and compute implementation.


Agreed.

Leo


>

> Christian.

>

>>

>> Signed-off-by: James Zhu <James.Zhu@amd.com>

>> ---

>>   src/gallium/auxiliary/vl/vl_compositor.c | 19 +++++++++++++++++--

>>   1 file changed, 17 insertions(+), 2 deletions(-)

>>

>> diff --git a/src/gallium/auxiliary/vl/vl_compositor.c 

>> b/src/gallium/auxiliary/vl/vl_compositor.c

>> index 7ee8402..66a8fc9 100644

>> --- a/src/gallium/auxiliary/vl/vl_compositor.c

>> +++ b/src/gallium/auxiliary/vl/vl_compositor.c

>> @@ -1376,8 +1376,8 @@ vl_compositor_convert_rgb_to_yuv(struct 

>> vl_compositor_state *s,

>>      s->pipe->flush(s->pipe, NULL, 0);

>>   }

>>   -void

>> -vl_compositor_render(struct vl_compositor_state *s,

>> +static void

>> +vl_compositor_gfx_render(struct vl_compositor_state *s,

>>                        struct vl_compositor       *c,

>>                        struct pipe_surface        *dst_surface,

>>                        struct u_rect              *dirty_area,

>> @@ -1419,6 +1419,21 @@ vl_compositor_render(struct 

>> vl_compositor_state *s,

>>      draw_layers(c, s, dirty_area);

>>   }

>>   +void

>> +vl_compositor_render(struct vl_compositor_state *s,

>> +                     struct vl_compositor       *c,

>> +                     struct pipe_surface        *dst_surface,

>> +                     struct u_rect              *dirty_area,

>> +                     bool                        clear_dirty)

>> +{

>> +   assert(s);

>> +

>> +   if (cs_compositor_render_enable && s->layers->cs)

>> +      vl_compositor_cs_render(s, c, dst_surface, dirty_area, 

>> clear_dirty);

>> +   else

>> +      vl_compositor_gfx_render(s, c, dst_surface, dirty_area, 

>> clear_dirty);

>> +}

>> +

>>   bool

>>   vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)

>>   {

>

> _______________________________________________

> mesa-dev mailing list

> mesa-dev@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/mesa-dev