<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/gpu/drm/vmwgfx, branch v6.9</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>drm/vmwgfx: Fix invalid reads in fence signaled events</title>
<updated>2024-04-30T16:54:07+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2024-04-25T19:27:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a37ef7613c00f2d72c8fc08bd83fb6cc76926c8c'/>
<id>a37ef7613c00f2d72c8fc08bd83fb6cc76926c8c</id>
<content type='text'>
Correctly set the length of the drm_event to the size of the structure
that's actually used.

The length of the drm_event was set to the parent structure instead of
to the drm_vmw_event_fence which is supposed to be read. drm_read
uses the length parameter to copy the event to the user space thus
resuling in oob reads.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 8b7de6aa8468 ("vmwgfx: Rework fence event action")
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-23566
Cc: David Airlie &lt;airlied@gmail.com&gt;
CC: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: &lt;stable@vger.kernel.org&gt; # v3.4+
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240425192748.1761522-1-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Correctly set the length of the drm_event to the size of the structure
that's actually used.

The length of the drm_event was set to the parent structure instead of
to the drm_vmw_event_fence which is supposed to be read. drm_read
uses the length parameter to copy the event to the user space thus
resuling in oob reads.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 8b7de6aa8468 ("vmwgfx: Rework fence event action")
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-23566
Cc: David Airlie &lt;airlied@gmail.com&gt;
CC: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: &lt;stable@vger.kernel.org&gt; # v3.4+
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240425192748.1761522-1-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix Legacy Display Unit</title>
<updated>2024-04-26T00:28:30+00:00</updated>
<author>
<name>Ian Forbes</name>
<email>ian.forbes@broadcom.com</email>
</author>
<published>2024-04-25T20:07:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=782e5e7925880f737963444f141a0320a12104a5'/>
<id>782e5e7925880f737963444f141a0320a12104a5</id>
<content type='text'>
Legacy DU was broken by the referenced fixes commit because the placement
and the busy_placement no longer pointed to the same object. This was later
fixed indirectly by commit a78a8da51b36c7a0c0c16233f91d60aac03a5a49
("drm/ttm: replace busy placement with flags v6") in v6.9.

Fixes: 39985eea5a6d ("drm/vmwgfx: Abstract placement selection")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.4+
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240425200700.24403-1-ian.forbes@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Legacy DU was broken by the referenced fixes commit because the placement
and the busy_placement no longer pointed to the same object. This was later
fixed indirectly by commit a78a8da51b36c7a0c0c16233f91d60aac03a5a49
("drm/ttm: replace busy placement with flags v6") in v6.9.

Fixes: 39985eea5a6d ("drm/vmwgfx: Abstract placement selection")
Signed-off-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.4+
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240425200700.24403-1-ian.forbes@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Sort primary plane formats by order of preference</title>
<updated>2024-04-15T15:48:57+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2024-04-12T02:55:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d4c972bff3129a9dd4c22a3999fd8eba1a81531a'/>
<id>d4c972bff3129a9dd4c22a3999fd8eba1a81531a</id>
<content type='text'>
The table of primary plane formats wasn't sorted at all, leading to
applications picking our least desirable formats by defaults.

Sort the primary plane formats according to our order of preference.

Nice side-effect of this change is that it makes IGT's kms_atomic
plane-invalid-params pass because the test picks the first format
which for vmwgfx was DRM_FORMAT_XRGB1555 and uses fb's with odd sizes
which make Pixman, which IGT depends on assert due to the fact that our
16bpp formats aren't 32 bit aligned like Pixman requires all formats
to be.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 36cc79bc9077 ("drm/vmwgfx: Add universal plane support")
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v4.12+
Acked-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-6-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The table of primary plane formats wasn't sorted at all, leading to
applications picking our least desirable formats by defaults.

Sort the primary plane formats according to our order of preference.

Nice side-effect of this change is that it makes IGT's kms_atomic
plane-invalid-params pass because the test picks the first format
which for vmwgfx was DRM_FORMAT_XRGB1555 and uses fb's with odd sizes
which make Pixman, which IGT depends on assert due to the fact that our
16bpp formats aren't 32 bit aligned like Pixman requires all formats
to be.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 36cc79bc9077 ("drm/vmwgfx: Add universal plane support")
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v4.12+
Acked-by: Pekka Paalanen &lt;pekka.paalanen@collabora.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-6-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix crtc's atomic check conditional</title>
<updated>2024-04-15T15:48:48+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2024-04-12T02:55:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a60ccade88f926e871a57176e86a34bbf0db0098'/>
<id>a60ccade88f926e871a57176e86a34bbf0db0098</id>
<content type='text'>
The conditional was supposed to prevent enabling of a crtc state
without a set primary plane. Accidently it also prevented disabling
crtc state with a set primary plane. Neither is correct.

Fix the conditional and just driver-warn when a crtc state has been
enabled without a primary plane which will help debug broken userspace.

Fixes IGT's kms_atomic_interruptible and kms_atomic_transition tests.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 06ec41909e31 ("drm/vmwgfx: Add and connect CRTC helper functions")
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v4.12+
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-5-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The conditional was supposed to prevent enabling of a crtc state
without a set primary plane. Accidently it also prevented disabling
crtc state with a set primary plane. Neither is correct.

Fix the conditional and just driver-warn when a crtc state has been
enabled without a primary plane which will help debug broken userspace.

Fixes IGT's kms_atomic_interruptible and kms_atomic_transition tests.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 06ec41909e31 ("drm/vmwgfx: Add and connect CRTC helper functions")
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v4.12+
Reviewed-by: Ian Forbes &lt;ian.forbes@broadcom.com&gt;
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-5-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix prime import/export</title>
<updated>2024-04-15T15:48:36+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2024-04-12T02:55:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b32233accefff1338806f064fb9b62cf5bc0609f'/>
<id>b32233accefff1338806f064fb9b62cf5bc0609f</id>
<content type='text'>
vmwgfx never supported prime import of external buffers. Furthermore the
driver exposes two different objects to userspace: vmw_surface's and
gem buffers but prime import/export only worked with vmw_surfaces.

Because gem buffers are used through the dumb_buffer interface this meant
that the driver created buffers couldn't have been prime exported or
imported.

Fix prime import/export. Makes IGT's kms_prime pass.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Cc: &lt;stable@vger.kernel.org&gt; # v6.6+
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-4-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vmwgfx never supported prime import of external buffers. Furthermore the
driver exposes two different objects to userspace: vmw_surface's and
gem buffers but prime import/export only worked with vmw_surfaces.

Because gem buffers are used through the dumb_buffer interface this meant
that the driver created buffers couldn't have been prime exported or
imported.

Fix prime import/export. Makes IGT's kms_prime pass.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM")
Cc: &lt;stable@vger.kernel.org&gt; # v6.6+
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-4-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Enable DMA mappings with SEV</title>
<updated>2024-04-09T17:36:05+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2024-04-08T02:28:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4c08f01934ab67d1d283d5cbaa52b923abcfe4cd'/>
<id>4c08f01934ab67d1d283d5cbaa52b923abcfe4cd</id>
<content type='text'>
Enable DMA mappings in vmwgfx after TTM has been fixed in commit
3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem")

This enables full guest-backed memory support and in particular allows
usage of screen targets as the presentation mechanism.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reported-by: Ye Li &lt;ye.li@broadcom.com&gt;
Tested-by: Ye Li &lt;ye.li@broadcom.com&gt;
Fixes: 3b0d6458c705 ("drm/vmwgfx: Refuse DMA operation when SEV encryption is active")
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v6.6+
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240408022802.358641-1-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enable DMA mappings in vmwgfx after TTM has been fixed in commit
3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem")

This enables full guest-backed memory support and in particular allows
usage of screen targets as the presentation mechanism.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reported-by: Ye Li &lt;ye.li@broadcom.com&gt;
Tested-by: Ye Li &lt;ye.li@broadcom.com&gt;
Fixes: 3b0d6458c705 ("drm/vmwgfx: Refuse DMA operation when SEV encryption is active")
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v6.6+
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240408022802.358641-1-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed</title>
<updated>2024-03-27T18:31:59+00:00</updated>
<author>
<name>Jocelyn Falempe</name>
<email>jfalempe@redhat.com</email>
</author>
<published>2024-03-12T09:35:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4be9075fec0a639384ed19975634b662bfab938f'/>
<id>4be9075fec0a639384ed19975634b662bfab938f</id>
<content type='text'>
The driver creates /sys/kernel/debug/dri/0/mob_ttm even when the
corresponding ttm_resource_manager is not allocated.
This leads to a crash when trying to read from this file.

Add a check to create mob_ttm, system_mob_ttm, and gmr_ttm debug file
only when the corresponding ttm_resource_manager is allocated.

crash&gt; bt
PID: 3133409  TASK: ffff8fe4834a5000  CPU: 3    COMMAND: "grep"
 #0 [ffffb954506b3b20] machine_kexec at ffffffffb2a6bec3
 #1 [ffffb954506b3b78] __crash_kexec at ffffffffb2bb598a
 #2 [ffffb954506b3c38] crash_kexec at ffffffffb2bb68c1
 #3 [ffffb954506b3c50] oops_end at ffffffffb2a2a9b1
 #4 [ffffb954506b3c70] no_context at ffffffffb2a7e913
 #5 [ffffb954506b3cc8] __bad_area_nosemaphore at ffffffffb2a7ec8c
 #6 [ffffb954506b3d10] do_page_fault at ffffffffb2a7f887
 #7 [ffffb954506b3d40] page_fault at ffffffffb360116e
    [exception RIP: ttm_resource_manager_debug+0x11]
    RIP: ffffffffc04afd11  RSP: ffffb954506b3df0  RFLAGS: 00010246
    RAX: ffff8fe41a6d1200  RBX: 0000000000000000  RCX: 0000000000000940
    RDX: 0000000000000000  RSI: ffffffffc04b4338  RDI: 0000000000000000
    RBP: ffffb954506b3e08   R8: ffff8fee3ffad000   R9: 0000000000000000
    R10: ffff8fe41a76a000  R11: 0000000000000001  R12: 00000000ffffffff
    R13: 0000000000000001  R14: ffff8fe5bb6f3900  R15: ffff8fe41a6d1200
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 #8 [ffffb954506b3e00] ttm_resource_manager_show at ffffffffc04afde7 [ttm]
 #9 [ffffb954506b3e30] seq_read at ffffffffb2d8f9f3
    RIP: 00007f4c4eda8985  RSP: 00007ffdbba9e9f8  RFLAGS: 00000246
    RAX: ffffffffffffffda  RBX: 000000000037e000  RCX: 00007f4c4eda8985
    RDX: 000000000037e000  RSI: 00007f4c41573000  RDI: 0000000000000003
    RBP: 000000000037e000   R8: 0000000000000000   R9: 000000000037fe30
    R10: 0000000000000000  R11: 0000000000000246  R12: 00007f4c41573000
    R13: 0000000000000003  R14: 00007f4c41572010  R15: 0000000000000003
    ORIG_RAX: 0000000000000000  CS: 0033  SS: 002b

Signed-off-by: Jocelyn Falempe &lt;jfalempe@redhat.com&gt;
Fixes: af4a25bbe5e7 ("drm/vmwgfx: Add debugfs entries for various ttm resource managers")
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240312093551.196609-1-jfalempe@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The driver creates /sys/kernel/debug/dri/0/mob_ttm even when the
corresponding ttm_resource_manager is not allocated.
This leads to a crash when trying to read from this file.

Add a check to create mob_ttm, system_mob_ttm, and gmr_ttm debug file
only when the corresponding ttm_resource_manager is allocated.

crash&gt; bt
PID: 3133409  TASK: ffff8fe4834a5000  CPU: 3    COMMAND: "grep"
 #0 [ffffb954506b3b20] machine_kexec at ffffffffb2a6bec3
 #1 [ffffb954506b3b78] __crash_kexec at ffffffffb2bb598a
 #2 [ffffb954506b3c38] crash_kexec at ffffffffb2bb68c1
 #3 [ffffb954506b3c50] oops_end at ffffffffb2a2a9b1
 #4 [ffffb954506b3c70] no_context at ffffffffb2a7e913
 #5 [ffffb954506b3cc8] __bad_area_nosemaphore at ffffffffb2a7ec8c
 #6 [ffffb954506b3d10] do_page_fault at ffffffffb2a7f887
 #7 [ffffb954506b3d40] page_fault at ffffffffb360116e
    [exception RIP: ttm_resource_manager_debug+0x11]
    RIP: ffffffffc04afd11  RSP: ffffb954506b3df0  RFLAGS: 00010246
    RAX: ffff8fe41a6d1200  RBX: 0000000000000000  RCX: 0000000000000940
    RDX: 0000000000000000  RSI: ffffffffc04b4338  RDI: 0000000000000000
    RBP: ffffb954506b3e08   R8: ffff8fee3ffad000   R9: 0000000000000000
    R10: ffff8fe41a76a000  R11: 0000000000000001  R12: 00000000ffffffff
    R13: 0000000000000001  R14: ffff8fe5bb6f3900  R15: ffff8fe41a6d1200
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 #8 [ffffb954506b3e00] ttm_resource_manager_show at ffffffffc04afde7 [ttm]
 #9 [ffffb954506b3e30] seq_read at ffffffffb2d8f9f3
    RIP: 00007f4c4eda8985  RSP: 00007ffdbba9e9f8  RFLAGS: 00000246
    RAX: ffffffffffffffda  RBX: 000000000037e000  RCX: 00007f4c4eda8985
    RDX: 000000000037e000  RSI: 00007f4c41573000  RDI: 0000000000000003
    RBP: 000000000037e000   R8: 0000000000000000   R9: 000000000037fe30
    R10: 0000000000000000  R11: 0000000000000246  R12: 00007f4c41573000
    R13: 0000000000000003  R14: 00007f4c41572010  R15: 0000000000000003
    ORIG_RAX: 0000000000000000  CS: 0033  SS: 002b

Signed-off-by: Jocelyn Falempe &lt;jfalempe@redhat.com&gt;
Fixes: af4a25bbe5e7 ("drm/vmwgfx: Add debugfs entries for various ttm resource managers")
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240312093551.196609-1-jfalempe@redhat.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix the lifetime of the bo cursor memory</title>
<updated>2024-01-30T19:18:21+00:00</updated>
<author>
<name>Zack Rusin</name>
<email>zack.rusin@broadcom.com</email>
</author>
<published>2024-01-26T20:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9a9e8a7159ca09af9b1a300a6c8e8b6ff7501c76'/>
<id>9a9e8a7159ca09af9b1a300a6c8e8b6ff7501c76</id>
<content type='text'>
The cleanup can be dispatched while the atomic update is still active,
which means that the memory acquired in the atomic update needs to
not be invalidated by the cleanup. The buffer objects in vmw_plane_state
instead of using the builtin map_and_cache were trying to handle
the lifetime of the mapped memory themselves, leading to crashes.

Use the map_and_cache instead of trying to manage the lifetime of the
buffer objects held by the vmw_plane_state.

Fixes kernel oops'es in IGT's kms_cursor_legacy forked-bo.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: bb6780aa5a1d ("drm/vmwgfx: Diff cursors when using cmds")
Cc: &lt;stable@vger.kernel.org&gt; # v6.2+
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-6-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The cleanup can be dispatched while the atomic update is still active,
which means that the memory acquired in the atomic update needs to
not be invalidated by the cleanup. The buffer objects in vmw_plane_state
instead of using the builtin map_and_cache were trying to handle
the lifetime of the mapped memory themselves, leading to crashes.

Use the map_and_cache instead of trying to manage the lifetime of the
buffer objects held by the vmw_plane_state.

Fixes kernel oops'es in IGT's kms_cursor_legacy forked-bo.

Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Fixes: bb6780aa5a1d ("drm/vmwgfx: Diff cursors when using cmds")
Cc: &lt;stable@vger.kernel.org&gt; # v6.2+
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-6-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix vmw_du_get_cursor_mob fencing of newly-created MOBs</title>
<updated>2024-01-30T19:18:20+00:00</updated>
<author>
<name>Martin Krastev</name>
<email>martin.krastev@broadcom.com</email>
</author>
<published>2024-01-26T20:08:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ed96cf7ad590989b009d6da5cd26387d995dac13'/>
<id>ed96cf7ad590989b009d6da5cd26387d995dac13</id>
<content type='text'>
The fencing of MOB creation used in vmw_du_get_cursor_mob was incompatible
with register-based device communication employed by this routine. As a
result cursor MOB creation was racy, leading to potentially broken/missing
mouse cursor on desktops using CursorMob device feature.

Fixes: 53bc3f6fb6b3 ("drm/vmwgfx: Clean up cursor mobs")
Signed-off-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-5-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fencing of MOB creation used in vmw_du_get_cursor_mob was incompatible
with register-based device communication employed by this routine. As a
result cursor MOB creation was racy, leading to potentially broken/missing
mouse cursor on desktops using CursorMob device feature.

Fixes: 53bc3f6fb6b3 ("drm/vmwgfx: Clean up cursor mobs")
Signed-off-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Reviewed-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-5-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Make all surfaces shareable</title>
<updated>2024-01-30T19:18:18+00:00</updated>
<author>
<name>Maaz Mombasawala</name>
<email>maaz.mombasawala@broadcom.com</email>
</author>
<published>2024-01-26T20:08:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9840d28f25143da23e0e7ecb1a3b8109987406ee'/>
<id>9840d28f25143da23e0e7ecb1a3b8109987406ee</id>
<content type='text'>
There is no real need to have a separate pool for shareable and
non-shareable surfaces. Make all surfaces shareable, regardless of whether
the drm_vmw_surface_flag_shareable has been specified.

Signed-off-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-3-zack.rusin@broadcom.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no real need to have a separate pool for shareable and
non-shareable surfaces. Make all surfaces shareable, regardless of whether
the drm_vmw_surface_flag_shareable has been specified.

Signed-off-by: Maaz Mombasawala &lt;maaz.mombasawala@broadcom.com&gt;
Reviewed-by: Martin Krastev &lt;martin.krastev@broadcom.com&gt;
Signed-off-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240126200804.732454-3-zack.rusin@broadcom.com
</pre>
</div>
</content>
</entry>
</feed>
