All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Deepak Rawat <drawat.floss@gmail.com>,
	linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel@ffwll.ch>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Sam Ravnborg <sam@ravnborg.org>, Dexuan Cui <decui@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Hu <weh@microsoft.com>,
	Tang Shaofeng <shaofeng.tang@intel.com>,
	Michael Kelley <mikelley@microsoft.com>
Subject: Re: [PATCH 1/2] drm/hyperv: Add DRM driver for hyperv synthetic video device
Date: Tue, 5 Jan 2021 09:07:24 +0100	[thread overview]
Message-ID: <ec340e8e-6386-d582-c93b-0a35c60f9dca@suse.de> (raw)
In-Reply-To: <4f7818f99734c0912325e1f3b6b80cb2a04df3ef.camel@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4085 bytes --]

Hi

Am 05.01.21 um 03:27 schrieb Deepak Rawat:
> On Mon, 2021-01-04 at 14:03 +0100, Thomas Zimmermann wrote:
>> Hi,
>>
>> I've been looking forward to this patchset. :) The code is really
>> nice
>> already.
> 
> Thanks Thomas for the review.
> 
> 
>>>    
>>> +config DRM_HYPERV
>>> +       tristate "DRM Support for hyperv synthetic video device"
>>> +       depends on DRM && PCI && MMU && HYPERV
>>> +       select DRM_KMS_HELPER
>>> +       select DRM_GEM_SHMEM_HELPER
>>
>> SHMEM helpers might not be a good choice, because you need this blit
>> code, which has a memcpy.
>>
>> I guess it's easily possible to configure 16 MiB or more for the
>> guest's
>> VRAM? If so, I suggest to use VRAM helpers. Guests will be able to
>> render into VRAM directly with the driver's memcpy. The driver will
>> do
>> page flipping. The bochs driver would be an example.
>>
>> Hyperv doesn't need buffer sharing with other devices, I guess?
>>
> 
> It's not possible to do page flip with this virtual device. The call to
> SYNTHVID_VRAM_LOCATION is only honoured once. So unfortunately need to
> use SHMEM helpers.

I was thinking about using struct video_output_situation.vram_offset; in 
case you want to tinker with that. There's a comment in the patch that 
vram_offset should always be 0. But this comment seems incorrect for 
devices with more than one output.

In any case, SHMEM is good enough for now and this would not be a blocker.

> 
>>> +#define PCI_VENDOR_ID_MICROSOFT 0x1414
>>> +#define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
>>> +
>>> +struct hyperv_device {
>>
>> Could this name lead to conflicts with other hyperv drivers? I
>> suggest
>> to name it hyperv_drm_device.
>>
>>
> 
> Sure make sense to use hyperv_drm_device.
> 
>>>
>>> +
>>> +struct synthvid_pointer_shape {
>>
>> Do you have plans for adding cursor support?
>>
> 
> Yes I have tested with a prototype and cursor works. Will attempt this
> in future iteration.

Sounds good.

> 
>>> +
>>> +       /* Negotiate the protocol version with host */
>>> +       switch (vmbus_proto_version) {
>>> +       case VERSION_WIN10:
>>> +       case VERSION_WIN10_V5:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN10);
>>> +               if (!ret)
>>> +                       break;
>>> +               fallthrough;
>>> +       case VERSION_WIN8:
>>> +       case VERSION_WIN8_1:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN8);
>>> +               if (!ret)
>>> +                       break;
>>> +               fallthrough;
>>> +       case VERSION_WS2008:
>>> +       case VERSION_WIN7:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN7);
>>> +               break;
>>> +       default:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN10);
>>
>> I don't get the logic of this switch statement. If the host is Win10,
>> I'd expect the graphics device to use Win10's protocol, if the host
>> is
>> Win8, the graphics device uses win8 protocols. So what's the point of
>> the fallthroughs? Can there be newer versions of vmbus_proto_version
>> that only support older devices?
>>
>>
> 
> This is copied as it is from hyperv_fb driver. I suppose this is just
> to accomodate newer version.

I see. I would put the default case to the top; right before the Win10 
case. So for newer or unknown versions, it tests Win10 and then falls 
through until something works.

Best regards
Thomas

>>
> 
> Deepak
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Deepak Rawat <drawat.floss@gmail.com>,
	linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: Wei Hu <weh@microsoft.com>,
	Tang Shaofeng <shaofeng.tang@intel.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	Michael Kelley <mikelley@microsoft.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH 1/2] drm/hyperv: Add DRM driver for hyperv synthetic video device
Date: Tue, 5 Jan 2021 09:07:24 +0100	[thread overview]
Message-ID: <ec340e8e-6386-d582-c93b-0a35c60f9dca@suse.de> (raw)
In-Reply-To: <4f7818f99734c0912325e1f3b6b80cb2a04df3ef.camel@gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 4085 bytes --]

Hi

Am 05.01.21 um 03:27 schrieb Deepak Rawat:
> On Mon, 2021-01-04 at 14:03 +0100, Thomas Zimmermann wrote:
>> Hi,
>>
>> I've been looking forward to this patchset. :) The code is really
>> nice
>> already.
> 
> Thanks Thomas for the review.
> 
> 
>>>    
>>> +config DRM_HYPERV
>>> +       tristate "DRM Support for hyperv synthetic video device"
>>> +       depends on DRM && PCI && MMU && HYPERV
>>> +       select DRM_KMS_HELPER
>>> +       select DRM_GEM_SHMEM_HELPER
>>
>> SHMEM helpers might not be a good choice, because you need this blit
>> code, which has a memcpy.
>>
>> I guess it's easily possible to configure 16 MiB or more for the
>> guest's
>> VRAM? If so, I suggest to use VRAM helpers. Guests will be able to
>> render into VRAM directly with the driver's memcpy. The driver will
>> do
>> page flipping. The bochs driver would be an example.
>>
>> Hyperv doesn't need buffer sharing with other devices, I guess?
>>
> 
> It's not possible to do page flip with this virtual device. The call to
> SYNTHVID_VRAM_LOCATION is only honoured once. So unfortunately need to
> use SHMEM helpers.

I was thinking about using struct video_output_situation.vram_offset; in 
case you want to tinker with that. There's a comment in the patch that 
vram_offset should always be 0. But this comment seems incorrect for 
devices with more than one output.

In any case, SHMEM is good enough for now and this would not be a blocker.

> 
>>> +#define PCI_VENDOR_ID_MICROSOFT 0x1414
>>> +#define PCI_DEVICE_ID_HYPERV_VIDEO 0x5353
>>> +
>>> +struct hyperv_device {
>>
>> Could this name lead to conflicts with other hyperv drivers? I
>> suggest
>> to name it hyperv_drm_device.
>>
>>
> 
> Sure make sense to use hyperv_drm_device.
> 
>>>
>>> +
>>> +struct synthvid_pointer_shape {
>>
>> Do you have plans for adding cursor support?
>>
> 
> Yes I have tested with a prototype and cursor works. Will attempt this
> in future iteration.

Sounds good.

> 
>>> +
>>> +       /* Negotiate the protocol version with host */
>>> +       switch (vmbus_proto_version) {
>>> +       case VERSION_WIN10:
>>> +       case VERSION_WIN10_V5:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN10);
>>> +               if (!ret)
>>> +                       break;
>>> +               fallthrough;
>>> +       case VERSION_WIN8:
>>> +       case VERSION_WIN8_1:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN8);
>>> +               if (!ret)
>>> +                       break;
>>> +               fallthrough;
>>> +       case VERSION_WS2008:
>>> +       case VERSION_WIN7:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN7);
>>> +               break;
>>> +       default:
>>> +               ret = synthvid_negotiate_ver(hdev,
>>> SYNTHVID_VERSION_WIN10);
>>
>> I don't get the logic of this switch statement. If the host is Win10,
>> I'd expect the graphics device to use Win10's protocol, if the host
>> is
>> Win8, the graphics device uses win8 protocols. So what's the point of
>> the fallthroughs? Can there be newer versions of vmbus_proto_version
>> that only support older devices?
>>
>>
> 
> This is copied as it is from hyperv_fb driver. I suppose this is just
> to accomodate newer version.

I see. I would put the default case to the top; right before the Win10 
case. So for newer or unknown versions, it tests Win10 and then falls 
through until something works.

Best regards
Thomas

>>
> 
> Deepak
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-01-05  8:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  6:03 [PATCH 1/2] drm/hyperv: Add DRM driver for hyperv synthetic video device Deepak Rawat
2021-01-02  6:03 ` Deepak Rawat
2021-01-02  6:03 ` [PATCH 2/2] MAINTAINERS: Add maintainer for hyperv " Deepak Rawat
2021-01-02  6:03   ` Deepak Rawat
2021-01-04 13:03 ` [PATCH 1/2] drm/hyperv: Add DRM driver for hyperv synthetic " Thomas Zimmermann
2021-01-04 13:03   ` Thomas Zimmermann
2021-01-05  2:27   ` Deepak Rawat
2021-01-05  2:27     ` Deepak Rawat
2021-01-05  8:07     ` Thomas Zimmermann [this message]
2021-01-05  8:07       ` Thomas Zimmermann
2021-01-05 11:04       ` Gerd Hoffmann
2021-01-05 11:04         ` Gerd Hoffmann
2021-01-05 11:30         ` Thomas Zimmermann
2021-01-05 11:30           ` Thomas Zimmermann
2021-01-06  4:01           ` Deepak Rawat
2021-01-06  4:01             ` Deepak Rawat
2023-04-04 13:20 ` Daniel Vetter
2023-04-04 13:20   ` Daniel Vetter
2023-04-04 16:07   ` Dexuan Cui
2023-04-04 16:07     ` Dexuan Cui

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=ec340e8e-6386-d582-c93b-0a35c60f9dca@suse.de \
    --to=tzimmermann@suse.de \
    --cc=daniel@ffwll.ch \
    --cc=decui@microsoft.com \
    --cc=drawat.floss@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haiyangz@microsoft.com \
    --cc=kraxel@redhat.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=sam@ravnborg.org \
    --cc=shaofeng.tang@intel.com \
    --cc=weh@microsoft.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.