mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Cc: Lanfeng Wei <xlfylawarthur@gmail.com>,
	airlied@gmail.com, decui@microsoft.com,
	dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org, longli@microsoft.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	regressions@lists.linux.dev, simona@ffwll.ch,
	ssengar@linux.microsoft.com, stable@vger.kernel.org
Subject: Re: [PATCH] drm/hyperv: add a parameter to disable the vblank timer
Date: Tue, 20 Oct 2026 13:48:58 +0200	[thread overview]
Message-ID: <3a4c4a4d-6ab4-42b6-8ae6-7ca0730b8069@suse.de> (raw)
In-Reply-To: <atZjtSlZAocUWYBS@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>

Hi

Am 19.10.26 um 20:38 schrieb Hamza Mahfooz:
> On Mon, Oct 19, 2026 at 06:03:55PM +0200, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 19.10.26 um 17:40 schrieb Lanfeng Wei:
>>> Hi Thomas,
>>>
>>>> Yeah, what's the cause of it? Switching off features does not fix any
>>>> bugs or improve the status quo.
>>> You are right that the module parameter is only a workaround for users
>>> affected; it does not fix the underlying scheduling problem.
>>>
>>> The cause is that the synthetic vblank timer is used to pace completion
>>> of atomic updates triggered by dirtyfb, in addition to providing
>>> synthetic vblank events. In Xorg's software-cursor path, pointer motion
>>> damages the primary framebuffer and the damage is instantly submitted
>>> via DRM_IOCTL_MODE_DIRTYFB. The Hyper-V dirtyfb path performs a
>>> synchronous atomic commit, and with the vblank timer enabled that commit
>>> can wait for the next simulated vblank. Under continuous pointer motion,
>>> these commits dominate the update path and delay normal client updates,
>>> resulting in sever frame-rate drops.
>>>
>>> This particular regression results from the combination of the blocking
>>> dirtyfb path, synthetic vblank pacing, and the absence of a Linux DRM
>>> cursor plane in Hyper-V. While the Hyper-V video protocol does have a
>>> hardware-cursor command path, the upstream hyperv_drm driver currently
>>> exposes only a primary plane. Cursor plane support was deferred during
>>> the initial upstreaming [1]. Without a cursor plane, Xorg has to fall
>>> back to software cursor-rendering path and it competes with periodic
>>> graphical updates on the primary plane.
>>>
>>> So the proper long-term fix could be adding cursor plane support in the
>>> Hyper-V DRM driver, which may take some time. Providing that the stated
>>> purpose of the offending commit is to rate-limit display updates, while
>>> its current implementation regresses the existing software-cursor path,
>>> I think adding a switch or reverting the commit until the requested
>>> features in the driver is ready, is a reasonable short-term fix.
>> The problem is that module parameters are impossible to remove in practice.
>> Once in place, someone always depends on it. They also increase the number
>> of states to test.  Avoiding them is usually a good idea. Especially as
>> workarounds for bug or regressions.
>>
>>
>> I'm not familiar with the Hyper-V protocol, so I have a question. Why is it
>> hard to implement cursors? From the link at [1], I assume that cursor
>> support was left out because the simple-kms pipeline did not support cursor
>> planes. This has long been resolved: the simple-kms pipeline is gone and
>> hyperv_drm runs on the regular DRM framework.  Unless there's anything
>> special with the Hyper-V protocol, cursor-plane support should be do-able in
>> a single patch. [^1]
>>
> I actually have been working on cursor plane support for hyperv-drm.
> I'll post a patch soon.

Awesome! Even if it doesn't fix the reported bug, it is still an 
improvement for everyone.

To fix the bug, you *might* have to implement atomic_async_update. [1]  
It allows legacy cursor updates to jump ahead of the commits and change 
the cursor without vblank synchronization. It's a little-used feature 
and semi-deprecated, but maybe necessary in case.  (Make it a separate 
patch, I'd say.)  There's existing support in other drivers to see how 
it works.

[1] 
https://elixir.bootlin.com/linux/v7.3/source/include/drm/drm_modeset_helper_vtables.h#L1406

Best regards
Thomas

>
> Hamza
>
>> Best regards
>> Thomas
>>
>> [^1] See https://elixir.bootlin.com/linux/v7.2.11/source/drivers/gpu/drm/ast/ast_cursor.c
>> for an example of how this looks. Most of it is hardware-related, but hyperv
>> would likely be similar in concept.
>>
>>>> We had another fix for a problem with vblank timers:
>>>>
>>>> https://lore.kernel.org/dri-devel/20260914110004.211027-1-tzimmermann@suse.de/
>>>>
>>>> Did you validate that this fix is unrelated?
>>> Yes I tested that fix and confirmed that it is irrelevant. It solves
>>> issues with excessively long frame durations, however this problem is
>>> found in normal frame updates (in my case 60Hz / 16.7 ms per frame, way
>>> below INT_MAX).
>>>
>>> Best regards,
>>>
>>> Lanfeng Wei
>>>
>>> [1] https://lore.kernel.org/dri-devel/20200622110623.113546-1-drawat.floss@gmail.com/
>> -- 
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
>> GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
>>
>>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)



  parent reply	other threads:[~2026-10-20 11:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 15:34 Lanfeng Wei
2026-10-19  7:36 ` Thomas Zimmermann
2026-10-19 15:40   ` Lanfeng Wei
2026-10-19 16:03     ` Thomas Zimmermann
2026-10-19 18:38       ` Hamza Mahfooz
2026-10-20  5:28         ` Lanfeng Wei
2026-10-20 11:48         ` Thomas Zimmermann [this message]
2026-10-20 23:21           ` Hamza Mahfooz
2026-10-20  5:34       ` Lanfeng Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a4c4a4d-6ab4-42b6-8ae6-7ca0730b8069@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=decui@microsoft.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamzamahfooz@linux.microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=simona@ffwll.ch \
    --cc=ssengar@linux.microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=xlfylawarthur@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®