Re: [Mesa-dev] [PATCH 1/3] vl/dri3: handle the case of different GPU(v4)

2016-09-16 Thread Nayan Deshmukh
Hi Michel,

Thanks for the review.

On Fri, Sep 16, 2016 at 1:47 PM, Christian König 
wrote:

> Am 16.09.2016 um 10:07 schrieb Michel Dänzer:
>
>> On 14/09/16 02:34 PM, Nayan Deshmukh wrote:
>>
>>> In case of prime when rendering is done on GPU other then the
>>> server GPU, use a seprate linear buffer for each back buffer
>>> which will be displayed using present extension.
>>>
>>> v2: Use a seprate linear buffer for each back buffer (Michel)
>>> v3: Change variable names and fix coding style (Leo and Emil)
>>> v4: Use PIPE_BIND_SAMPLER_VIEW for back buffer in case when
>>>  a seprate linear buffer is used (Michel)
>>>
>>> Signed-off-by: Nayan Deshmukh 
>>>
>> Looks mostly good to me, but Leo should probably also take a look.
>>
>> Acked-by: Michel Dänzer 
>>
>
> I was just about to ping you guys for comments on this.
>
> Leo anything more you want to add or should I commit it? I'm not so deep
> into this code either.
>
> Christian.
>
>
>
>>
>> @@ -235,16 +240,35 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
>>>  templ.height0 = scrn->height;
>>>  templ.depth0 = 1;
>>>  templ.array_size = 1;
>>> -   buffer->texture = scrn->base.pscreen->resource_c
>>> reate(scrn->base.pscreen,
>>> - );
>>> -   if (!buffer->texture)
>>> -  goto unmap_shm;
>>>   +   if (scrn->is_different_gpu) {
>>> +  buffer->texture = scrn->base.pscreen->resource_c
>>> reate(scrn->base.pscreen,
>>> +);
>>> +  if (!buffer->texture)
>>> + goto unmap_shm;
>>> +
>>> +  templ.bind |= PIPE_BIND_SCANOUT | PIPE_BIND_SHARED |
>>> +PIPE_BIND_LINEAR;
>>> +  buffer->linear_texture = scrn->base.pscreen->resource_c
>>> reate(scrn->base.pscreen,
>>> +
>>> );
>>> +  pixmap_buffer_texture = buffer->linear_texture;
>>> +
>>> +  if (!buffer->linear_texture)
>>> + goto no_linear_texture;
>>> +
>>> +   } else {
>>>
>> Bonus points for not adding the empty line at the end of the block here.
>> :)
>>
>> I have submitted another patch without empty line for the bonus points.
:)

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


Re: [Mesa-dev] [PATCH 1/3] vl/dri3: handle the case of different GPU(v4)

2016-09-16 Thread Christian König

Am 16.09.2016 um 10:07 schrieb Michel Dänzer:

On 14/09/16 02:34 PM, Nayan Deshmukh wrote:

In case of prime when rendering is done on GPU other then the
server GPU, use a seprate linear buffer for each back buffer
which will be displayed using present extension.

v2: Use a seprate linear buffer for each back buffer (Michel)
v3: Change variable names and fix coding style (Leo and Emil)
v4: Use PIPE_BIND_SAMPLER_VIEW for back buffer in case when
 a seprate linear buffer is used (Michel)

Signed-off-by: Nayan Deshmukh 

Looks mostly good to me, but Leo should probably also take a look.

Acked-by: Michel Dänzer 


I was just about to ping you guys for comments on this.

Leo anything more you want to add or should I commit it? I'm not so deep 
into this code either.


Christian.





@@ -235,16 +240,35 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
 templ.height0 = scrn->height;
 templ.depth0 = 1;
 templ.array_size = 1;
-   buffer->texture = scrn->base.pscreen->resource_create(scrn->base.pscreen,
- );
-   if (!buffer->texture)
-  goto unmap_shm;
  
+   if (scrn->is_different_gpu) {

+  buffer->texture = scrn->base.pscreen->resource_create(scrn->base.pscreen,
+);
+  if (!buffer->texture)
+ goto unmap_shm;
+
+  templ.bind |= PIPE_BIND_SCANOUT | PIPE_BIND_SHARED |
+PIPE_BIND_LINEAR;
+  buffer->linear_texture = 
scrn->base.pscreen->resource_create(scrn->base.pscreen,
+  );
+  pixmap_buffer_texture = buffer->linear_texture;
+
+  if (!buffer->linear_texture)
+ goto no_linear_texture;
+
+   } else {

Bonus points for not adding the empty line at the end of the block here. :)




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


Re: [Mesa-dev] [PATCH 1/3] vl/dri3: handle the case of different GPU(v4)

2016-09-16 Thread Michel Dänzer
On 14/09/16 02:34 PM, Nayan Deshmukh wrote:
> In case of prime when rendering is done on GPU other then the
> server GPU, use a seprate linear buffer for each back buffer
> which will be displayed using present extension.
> 
> v2: Use a seprate linear buffer for each back buffer (Michel)
> v3: Change variable names and fix coding style (Leo and Emil)
> v4: Use PIPE_BIND_SAMPLER_VIEW for back buffer in case when
> a seprate linear buffer is used (Michel)
> 
> Signed-off-by: Nayan Deshmukh 

Looks mostly good to me, but Leo should probably also take a look.

Acked-by: Michel Dänzer 


> @@ -235,16 +240,35 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
> templ.height0 = scrn->height;
> templ.depth0 = 1;
> templ.array_size = 1;
> -   buffer->texture = scrn->base.pscreen->resource_create(scrn->base.pscreen,
> - );
> -   if (!buffer->texture)
> -  goto unmap_shm;
>  
> +   if (scrn->is_different_gpu) {
> +  buffer->texture = 
> scrn->base.pscreen->resource_create(scrn->base.pscreen,
> +);
> +  if (!buffer->texture)
> + goto unmap_shm;
> +
> +  templ.bind |= PIPE_BIND_SCANOUT | PIPE_BIND_SHARED |
> +PIPE_BIND_LINEAR;
> +  buffer->linear_texture = 
> scrn->base.pscreen->resource_create(scrn->base.pscreen,
> +  );
> +  pixmap_buffer_texture = buffer->linear_texture;
> +
> +  if (!buffer->linear_texture)
> + goto no_linear_texture;
> +
> +   } else {

Bonus points for not adding the empty line at the end of the block here. :)


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer


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