<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/gpu/drm/virtio, branch v4.20-rc3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>virtio: Support prime objects vmap/vunmap</title>
<updated>2018-09-26T06:05:07+00:00</updated>
<author>
<name>Ezequiel Garcia</name>
<email>ezequiel@collabora.com</email>
</author>
<published>2018-09-25T16:16:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a03fb71716ee60d1d763f1f27773cbbaec1359ed'/>
<id>a03fb71716ee60d1d763f1f27773cbbaec1359ed</id>
<content type='text'>
Implement vmap/vunmap so we can export dmabufs to
other drivers, such as video4linux.

Tested with a virtio-gpu / vivid (virtual capture driver)
pipeline, where the vivid driver imports the dmabufs exported
by virtio-gpu.

Note that dma_buf_vmap() does its own vmap counting, so
it's not needed to take care of it in the driver.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-4-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement vmap/vunmap so we can export dmabufs to
other drivers, such as video4linux.

Tested with a virtio-gpu / vivid (virtual capture driver)
pipeline, where the vivid driver imports the dmabufs exported
by virtio-gpu.

Note that dma_buf_vmap() does its own vmap counting, so
it's not needed to take care of it in the driver.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-4-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: Rework virtio_gpu_object_kmap()</title>
<updated>2018-09-26T06:05:06+00:00</updated>
<author>
<name>Ezequiel Garcia</name>
<email>ezequiel@collabora.com</email>
</author>
<published>2018-09-25T16:16:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a20c4173c4219d85ba7775fde584cd34305a0b3d'/>
<id>a20c4173c4219d85ba7775fde584cd34305a0b3d</id>
<content type='text'>
Currently, virtio_gpu_object_kmap() is only called by
virtio_gpufb_create(), when a DRM framebuffer is created.

Thus, instead of returning the vmap'ed address, emit a warning
if virtio_gpu_object_kmap is called on an already mapped
object. With this change, kmap/kunmap calls are now balanced.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-3-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, virtio_gpu_object_kmap() is only called by
virtio_gpufb_create(), when a DRM framebuffer is created.

Thus, instead of returning the vmap'ed address, emit a warning
if virtio_gpu_object_kmap is called on an already mapped
object. With this change, kmap/kunmap calls are now balanced.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-3-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: Add virtio_gpu_object_kunmap()</title>
<updated>2018-09-26T06:05:05+00:00</updated>
<author>
<name>Ezequiel Garcia</name>
<email>ezequiel@collabora.com</email>
</author>
<published>2018-09-25T16:16:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=02c87cabd6f1a6de151f999690393c3b8ad07b90'/>
<id>02c87cabd6f1a6de151f999690393c3b8ad07b90</id>
<content type='text'>
Implement a virtio_gpu_object_kunmap() to unmap the kernel
mapping, and use it in the TTM object destroy path.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-2-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement a virtio_gpu_object_kunmap() to unmap the kernel
mapping, and use it in the TTM object destroy path.

Signed-off-by: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-2-ezequiel@collabora.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: fix DRM_FORMAT_* handling</title>
<updated>2018-09-25T12:49:49+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-09-21T13:47:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=42fd9e6c29b39481fd4ef31715c6f0c427966f20'/>
<id>42fd9e6c29b39481fd4ef31715c6f0c427966f20</id>
<content type='text'>
Use DRM_FORMAT_HOST_XRGB8888, so we are using the correct format code
on bigendian machines.  Also set the quirk_addfb_prefer_host_byte_order
mode_config bit so drm_mode_addfb() asks for the correct format code.

Both DRM_FORMAT_* and VIRTIO_GPU_FORMAT_* are defined to be little
endian, so using a different mapping on bigendian machines is wrong.
It's there because of broken drm_mode_addfb() behavior.  So with
drm_mode_addfb() being fixed we can fix this too.

While wading through the code I've noticed we have a little issue in
virtio:  We attach a format to the bo when it is created
(DRM_IOCTL_MODE_CREATE_DUMB), not when we map it as framebuffer
(DRM_IOCTL_MODE_ADDFB).  Easy way out:  Support a single format only.
Pick DRM_FORMAT_HOST_XRGB8888, it is the only one actually used in
practice.  Drop unused mappings in virtio_gpu_translate_format().

With this patch applied both ADDFB and ADDFB2 ioctls work correctly in
the virtio-gpu.ko driver on big endian machines.  Without the patch only
ADDFB (which still seems to be used by the majority of userspace) works
correctly.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-6-kraxel@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use DRM_FORMAT_HOST_XRGB8888, so we are using the correct format code
on bigendian machines.  Also set the quirk_addfb_prefer_host_byte_order
mode_config bit so drm_mode_addfb() asks for the correct format code.

Both DRM_FORMAT_* and VIRTIO_GPU_FORMAT_* are defined to be little
endian, so using a different mapping on bigendian machines is wrong.
It's there because of broken drm_mode_addfb() behavior.  So with
drm_mode_addfb() being fixed we can fix this too.

While wading through the code I've noticed we have a little issue in
virtio:  We attach a format to the bo when it is created
(DRM_IOCTL_MODE_CREATE_DUMB), not when we map it as framebuffer
(DRM_IOCTL_MODE_ADDFB).  Easy way out:  Support a single format only.
Pick DRM_FORMAT_HOST_XRGB8888, it is the only one actually used in
practice.  Drop unused mappings in virtio_gpu_translate_format().

With this patch applied both ADDFB and ADDFB2 ioctls work correctly in
the virtio-gpu.ko driver on big endian machines.  Without the patch only
ADDFB (which still seems to be used by the majority of userspace) works
correctly.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-6-kraxel@redhat.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: pass virtio_gpu_object to virtio_gpu_cmd_transfer_to_host_{2d, 3d}</title>
<updated>2018-09-25T12:49:49+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-09-20T06:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=af334c5d41a9d3b9df3204d50a9a8f566ef64c66'/>
<id>af334c5d41a9d3b9df3204d50a9a8f566ef64c66</id>
<content type='text'>
Pass virtio_gpu_object down to virtio_gpu_cmd_transfer_to_host_2d and
virtio_gpu_cmd_transfer_to_host_3d functions, instead of passing just
the virtio resource handle.

This is needed to lookup the scatter list of the object, for dma sync.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Jiandi An &lt;jiandi.an@amd.com&gt;
Tested-by: Jiandi An &lt;jiandi.an@amd.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180920062924.6514-1-kraxel@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass virtio_gpu_object down to virtio_gpu_cmd_transfer_to_host_2d and
virtio_gpu_cmd_transfer_to_host_3d functions, instead of passing just
the virtio resource handle.

This is needed to lookup the scatter list of the object, for dma sync.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Jiandi An &lt;jiandi.an@amd.com&gt;
Tested-by: Jiandi An &lt;jiandi.an@amd.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180920062924.6514-1-kraxel@redhat.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: add dma sync for dma mapped virtio gpu framebuffer pages</title>
<updated>2018-09-19T11:33:06+00:00</updated>
<author>
<name>Jiandi An</name>
<email>jiandi.an@amd.com</email>
</author>
<published>2018-09-19T07:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8f44ca223345a7d02e18ed4e70ff95178434e137'/>
<id>8f44ca223345a7d02e18ed4e70ff95178434e137</id>
<content type='text'>
With virtio gpu ttm-pages being dma mapped, dma sync is needed when
swiotlb is used as bounce buffers, before TRANSFER_TO_HOST_2D/3D
commands are sent.

Signed-off-by: Jiandi An &lt;jiandi.an@amd.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180919070931.91168-1-jiandi.an@amd.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With virtio gpu ttm-pages being dma mapped, dma sync is needed when
swiotlb is used as bounce buffers, before TRANSFER_TO_HOST_2D/3D
commands are sent.

Signed-off-by: Jiandi An &lt;jiandi.an@amd.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180919070931.91168-1-jiandi.an@amd.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: Remove set but not used variable 'bo'</title>
<updated>2018-09-10T05:10:36+00:00</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2018-09-07T02:03:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ea4584c2f2fe2d3a5792c397e2c5aff04db6f14c'/>
<id>ea4584c2f2fe2d3a5792c397e2c5aff04db6f14c</id>
<content type='text'>
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/virtio/virtgpu_display.c: In function 'virtio_gpu_framebuffer_init':
drivers/gpu/drm/virtio/virtgpu_display.c:78:28: warning:
 variable 'bo' set but not used [-Wunused-but-set-variable]
  struct virtio_gpu_object *bo;
                            ^

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1536285837-150460-1-git-send-email-yuehaibing@huawei.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/virtio/virtgpu_display.c: In function 'virtio_gpu_framebuffer_init':
drivers/gpu/drm/virtio/virtgpu_display.c:78:28: warning:
 variable 'bo' set but not used [-Wunused-but-set-variable]
  struct virtio_gpu_object *bo;
                            ^

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1536285837-150460-1-git-send-email-yuehaibing@huawei.com
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: add iommu support.</title>
<updated>2018-09-05T06:26:26+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-08-29T12:20:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a3b815f09bb846255c458c181b8a5b1cc66891b4'/>
<id>a3b815f09bb846255c458c181b8a5b1cc66891b4</id>
<content type='text'>
Use the dma mapping api and properly add iommu mappings for
objects, unless virtio is in iommu quirk mode.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180829122026.27012-3-kraxel@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the dma mapping api and properly add iommu mappings for
objects, unless virtio is in iommu quirk mode.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180829122026.27012-3-kraxel@redhat.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: add virtio_gpu_object_detach() function</title>
<updated>2018-09-05T06:26:25+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-08-29T12:20:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b3f13ec958a77497da76cc7a89d60b741b79ba22'/>
<id>b3f13ec958a77497da76cc7a89d60b741b79ba22</id>
<content type='text'>
The new function balances virtio_gpu_object_attach().

Also make virtio_gpu_cmd_resource_inval_backing() static and switch
call sites to the new virtio_gpu_object_attach() function.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180829122026.27012-2-kraxel@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new function balances virtio_gpu_object_attach().

Also make virtio_gpu_cmd_resource_inval_backing() static and switch
call sites to the new virtio_gpu_object_attach() function.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180829122026.27012-2-kraxel@redhat.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: track virtual output state</title>
<updated>2018-09-05T06:26:24+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-08-13T15:28:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c19787e10b1bb99abbc3d257156c22bea5ca5b1'/>
<id>6c19787e10b1bb99abbc3d257156c22bea5ca5b1</id>
<content type='text'>
Track whenever an virtual output (crtc) is enabled or disabled.

On atomic updates check for both framebuffer being present and crtc
being enabled to figure whenever the output is active or not.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180813152855.12863-1-kraxel@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Track whenever an virtual output (crtc) is enabled or disabled.

On atomic updates check for both framebuffer being present and crtc
being enabled to figure whenever the output is active or not.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20180813152855.12863-1-kraxel@redhat.com
</pre>
</div>
</content>
</entry>
</feed>
