Linux-HyperV List
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: Michael Kelley <mhklinux@outlook.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	"louis.chauvet@bootlin.com" <louis.chauvet@bootlin.com>,
	"drawat.floss@gmail.com" <drawat.floss@gmail.com>,
	"hamohammed.sa@gmail.com" <hamohammed.sa@gmail.com>,
	"melissa.srw@gmail.com" <melissa.srw@gmail.com>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"maarten.lankhorst@linux.intel.com"
	<maarten.lankhorst@linux.intel.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Subject: RE: [PATCH v2 4/4] drm/hypervdrm: Use vblank timer
Date: Thu, 04 Sep 2025 07:50:01 +0200	[thread overview]
Message-ID: <87ldmuzrzq.fsf@minerva.mail-host-address-is-not-set> (raw)
In-Reply-To: <SN6PR02MB4157EFAA19227FAFD21E1466D400A@SN6PR02MB4157.namprd02.prod.outlook.com>

Michael Kelley <mhklinux@outlook.com> writes:

Hello Michael,

> From: Javier Martinez Canillas <javierm@redhat.com> Sent: Tuesday, September 2, 2025 8:41 AM
>> 
>> Thomas Zimmermann <tzimmermann@suse.de> writes:
>> 
>> [...]
>> 
>> >>
>> >> I'm not familiar with hyperv to know whether is a problem or not for the
>> >> host to not be notified that the guest display is disabled. But I thought
>> >> that should raise this question for the folks familiar with it.
>> >
>> > The feedback I got at
>> > https://lore.kernel.org/dri-devel/SN6PR02MB4157F630284939E084486AFED46FA@SN6PR02MB4157.namprd02.prod.outlook.com/ 
>> > is that the vblank timer solves the problem of excessive CPU consumption
>> > on hypervdrm. Ans that's also the observation I had with other drivers.
>> > I guess, telling the host about the disabled display would still make sense.
>> >
>> 
>> Yes, I read the other thread you referenced and that's why I said that
>> your patch is correct to solve the issue.
>> 
>> I just wanted to point out, since it could be that as a follow-up the
>> driver could need its own .atomic_disable instead of using the default
>> drm_crtc_vblank_atomic_disable(). Something like the following maybe:
>> 
>> +static void hyperv_crtc_helper_atomic_disable(struct drm_crtc *crtc,
>> +                                             struct drm_atomic_state *state)
>> +{
>> +       struct hyperv_drm_device *hv = to_hv(crtc->dev);
>> +       struct drm_plane *plane = &hv->plane;
>> +       struct drm_plane_state *plane_state = plane->state;
>> +       struct drm_crtc_state *crtc_state = crtc->state;
>> +
>> +       hyperv_hide_hw_ptr(hv->hdev);
>> +       /* Notify the host that the guest display is disabled */
>> +       hyperv_update_situation(hv->hdev, 0,  hv->screen_depth,
>> +                               crtc_state->mode.hdisplay,
>> +                               crtc_state->mode.vdisplay,
>> +                               plane_state->fb->pitches[0]);
>> +
>> +       drm_crtc_vblank_off(crtc);
>> +}
>> +
>>  static const struct drm_crtc_helper_funcs hyperv_crtc_helper_funcs = {
>>         .atomic_check = drm_crtc_helper_atomic_check,
>>         .atomic_flush = drm_crtc_vblank_atomic_flush,
>>         .atomic_enable = hyperv_crtc_helper_atomic_enable,
>> -       .atomic_disable = drm_crtc_vblank_atomic_disable,
>> +       .atomic_disable = hyperv_crtc_helper_atomic_disable,
>>  };
>
> I have some historical expertise in the Hyper-V fbdev driver from
> back when I was a Microsoft employee (I'm now retired). The fbdev
> driver is similar to the DRM driver in that it tells the Hyper-V host
> that the device is "active" during initial setup, but there's never a
> time when the driver tells Hyper-V that the device is "not active".
>
> I agree that symmetry suggests having disable function that sets
> "active" to 0, but I don't know what the effect would be. I don't know
> if Hyper-V anticipates any circumstances when the driver should tell
> Hyper-V the device is not active. My chances are not good in finding
> someone on the Hyper-V team who could give a definitive answer,
> as it's probably an area that is not under active development. The
> Hyper-V VMBus frame buffer device functionality is what it is, and
> isn't likely to be getting enhancements.
>
> I suggest that we assume it's not necessary to add a "disable"
> function, and proceed with Thomas' proposed changes to the Hyper-V
> DRM driver. Adding "disable" now risks breaking something due
> to effects we're unaware of. If in the future the need arises to mark
> the device not active, the "disable" function can be added after
> a clarifying conversation with the Hyper-V team.
>
> If anyone at Microsoft wants to chime in, please do so. :-)
>

Thanks a lot for the insight. I agree that probably is not worth the risk
to notify of a display disable, since is unclear what the effect would be.

> Michael
>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


      reply	other threads:[~2025-09-04  5:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 11:06 [PATCH v2 0/4] drm: Add vblank timers for devices without interrupts Thomas Zimmermann
2025-09-01 11:06 ` [PATCH v2 1/4] drm/vblank: Add vblank timer Thomas Zimmermann
2025-09-02  8:09   ` Javier Martinez Canillas
2025-09-02 13:27   ` Ville Syrjälä
2025-09-02 14:16     ` Thomas Zimmermann
2025-09-02 15:58       ` Lyude Paul
2025-09-04 14:21         ` Thomas Zimmermann
2025-09-01 11:06 ` [PATCH v2 2/4] drm/vblank: Add CRTC helpers for simple use cases Thomas Zimmermann
2025-09-02  8:14   ` Javier Martinez Canillas
2025-09-01 11:07 ` [PATCH v2 3/4] drm/vkms: Convert to DRM's vblank timer Thomas Zimmermann
2025-09-02  8:15   ` Javier Martinez Canillas
2025-09-01 11:07 ` [PATCH v2 4/4] drm/hypervdrm: Use " Thomas Zimmermann
2025-09-02  8:30   ` Javier Martinez Canillas
2025-09-02 12:58     ` Thomas Zimmermann
2025-09-02 15:41       ` Javier Martinez Canillas
2025-09-04  3:38         ` Michael Kelley
2025-09-04  5:50           ` Javier Martinez Canillas [this message]

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=87ldmuzrzq.fsf@minerva.mail-host-address-is-not-set \
    --to=javierm@redhat.com \
    --cc=airlied@gmail.com \
    --cc=drawat.floss@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=melissa.srw@gmail.com \
    --cc=mhklinux@outlook.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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