dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Brace <kevinbrace@gmx.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 26/32] drm/via: Add via_drm.h
Date: Tue, 2 Aug 2022 05:45:46 +0200	[thread overview]
Message-ID: <trinity-8c70d1f1-fd67-46a1-a84b-7cc771cca62d-1659411946174@3c-app-mailcom-bs03> (raw)
In-Reply-To: <43fd433c-f108-d75a-b141-f4ff985455b9@suse.de>

Hi Thomas,

I hope I am comprehending this right.
Yes, I am adding 3 new uAPI calls, not 6 of them.
Correspondingly, there are 3 new structs added.
While I may drop one (unmap uAPI), I personally do not wish to drop the other two at this point.
Instead, I may need to add setparam and / or getparam uAPI to pass PCI Device ID back to the userspace.
This is mainly needed by Mesa, although there is no code for Mesa at this point.
I fear dropping the remaining two will require substantial redesign, and I will like to avoid this since the code is already working.
It is my plan to proceed to adding acceleration after the code is added to the mainline kernel tree, so I will like to do it the way it is set up now.

Regards,

Kevin Brace
Brace Computer Laboratory blog
https://bracecomputerlab.com


> Sent: Monday, August 01, 2022 at 11:49 AM
> From: "Thomas Zimmermann" <tzimmermann@suse.de>
> To: "Kevin Brace" <kevinbrace@gmx.com>
> Cc: dri-devel@lists.freedesktop.org
> Subject: Re: [PATCH v3 26/32] drm/via: Add via_drm.h
>
> Hi Kevin
> 
> Am 31.07.22 um 00:48 schrieb Kevin Brace:
> > Hi Thomas,
> > 
> > I cannot drop the older DRI1 based uAPI calls.
> > This is because include/uapi/drm/via_drm.h needs to retain backward compatibility with the existing OpenChrome DDX's XvMC library (it gets compiled when OpenChrome DDX is built) and likely with the existing DDX Xv code as well.
> > If I remove the DRI1 based uAPI calls, the XvMC library will not get compiled (compile error will occur since the XvMC library assumes the presence of DRI1 based uAPI), and I assume the same for the DDX Xv code (I cannot even reach here since the XvMC library is compiled first).
> > Although the v3 patch does not contain it, v4 patch will utilize drm_invalid_op() for the discontinued (not deprecated since OpenChrome DRM does not support the older DRI1 based uAPI at all) DRI1 based uAPI.
> > 
> > https://cgit.freedesktop.org/openchrome/drm-openchrome/commit/?h=drm-next-5.20&id=16b3d68f95c9ccd15b7a3310e5d752fabbc76518
> > 
> > drm_invalid_op() is related to drm_ioctl.c, and is meant for legacy DRMs like Radeon, i915, etc.
> > Since OpenChrome DRM is not a clean sheet design (related to VIA DRM to some extent), I will use this function for properly handling discontinued legacy uAPI calls.
> > I hope this explanation / reasoning is okay with you.
> 
> I'm not sure I understand your reply ormaybe I'm just missing something 
> here.
> 
> I'm not asking you to remove the existing DRI1 uapi. I'm just asking to 
> not add the 6 new _GEM_ defines and 3 new _gem_ structures now.  You 
> mentioned that the driver does not yet support acceleration of any kind. 
> So there should be no need to extend to uapi now.  You can still do this 
> when you add acceleration to the driver.
> 
> Until then, the Xorg modesetting driver or any Compositor can use the 
> generic dumb-buffer ioctls that create buffers with no acceleration.
> 
> Best regards
> Thomas
> 
> > 
> > Regards,
> > 
> > Kevin Brace
> > Brace Computer Laboratory blog
> > https://bracecomputerlab.com
> > 
> >> Sent: Tuesday, July 26, 2022 at 11:24 AM
> >> From: "Thomas Zimmermann" <tzimmermann@suse.de>
> >> To: "Kevin Brace" <kevinbrace@gmx.com>, dri-devel@lists.freedesktop.org
> >> Cc: "Kevin Brace" <kevinbrace@bracecomputerlab.com>
> >> Subject: Re: [PATCH v3 26/32] drm/via: Add via_drm.h
> >>
> >> Hi
> >>
> >> Am 26.07.22 um 01:53 schrieb Kevin Brace:
> >>> From: Kevin Brace <kevinbrace@bracecomputerlab.com>
> >>>
> >>> Changed the uAPI.
> >>>
> >>> Signed-off-by: Kevin Brace <kevinbrace@bracecomputerlab.com>
> >>> ---
> >>>    include/uapi/drm/via_drm.h | 35 +++++++++++++++++++++++++++++++----
> >>>    1 file changed, 31 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
> >>> index a1e125d42208..e9da45ce130a 100644
> >>> --- a/include/uapi/drm/via_drm.h
> >>> +++ b/include/uapi/drm/via_drm.h
> >>> @@ -1,4 +1,5 @@
> >>>    /*
> >>> + * Copyright © 2020 Kevin Brace
> >>>     * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
> >>>     * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
> >>>     *
> >>> @@ -16,10 +17,10 @@
> >>>     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> >>>     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> >>>     * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
> >>> - * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> >>> - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> >>> - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> >>> - * DEALINGS IN THE SOFTWARE.
> >>> + * THE AUTHORS, COPYRIGHT HOLDERS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
> >>> + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
> >>> + * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
> >>> + * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> >>>     */
> >>>    #ifndef _VIA_DRM_H_
> >>>    #define _VIA_DRM_H_
> >>> @@ -81,6 +82,11 @@ extern "C" {
> >>>    #define DRM_VIA_DMA_BLIT        0x0e
> >>>    #define DRM_VIA_BLIT_SYNC       0x0f
> >>>
> >>> +#define	DRM_VIA_GEM_CREATE	0x10
> >>> +#define	DRM_VIA_GEM_MAP		0x11
> >>> +#define	DRM_VIA_GEM_UNMAP	0x12
> >>
> >> This looks a lot like ioctl ops for using accelerated HW buffers. But
> >> the patch is near the end of the series and you said in the series'
> >> cover letter that there's no acceleration. I suspect that these
> >> constants are currently unused?  If so, please drop the patch from the
> >> series. If can be merged later when something really depends on it.
> >>
> >> Best regards
> >> Thomas
> >>
> >>> +
> >>> +
> >>>    #define DRM_IOCTL_VIA_ALLOCMEM	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
> >>>    #define DRM_IOCTL_VIA_FREEMEM	  DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
> >>>    #define DRM_IOCTL_VIA_AGP_INIT	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
> >>> @@ -97,6 +103,10 @@ extern "C" {
> >>>    #define DRM_IOCTL_VIA_DMA_BLIT    DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
> >>>    #define DRM_IOCTL_VIA_BLIT_SYNC   DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
> >>>
> >>> +#define	DRM_IOCTL_VIA_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_CREATE, struct drm_via_gem_create)
> >>> +#define	DRM_IOCTL_VIA_GEM_MAP		DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_MAP, struct drm_via_gem_map)
> >>> +#define	DRM_IOCTL_VIA_GEM_UNMAP		DRM_IOR(DRM_COMMAND_BASE + DRM_VIA_GEM_UNMAP, struct drm_via_gem_unmap)
> >>> +
> >>>    /* Indices into buf.Setup where various bits of state are mirrored per
> >>>     * context and per buffer.  These can be fired at the card as a unit,
> >>>     * or in a piecewise fashion as required.
> >>> @@ -275,6 +285,23 @@ typedef struct drm_via_dmablit {
> >>>    	drm_via_blitsync_t sync;
> >>>    } drm_via_dmablit_t;
> >>>
> >>> +struct drm_via_gem_create {
> >>> +	uint64_t size;
> >>> +	uint32_t alignment;
> >>> +	uint32_t domain;
> >>> +	uint32_t handle;
> >>> +	uint64_t offset;
> >>> +};
> >>> +
> >>> +struct drm_via_gem_map {
> >>> +	uint32_t handle;
> >>> +	uint64_t map_offset;
> >>> +};
> >>> +
> >>> +struct drm_via_gem_unmap {
> >>> +	uint32_t handle;
> >>> +};
> >>> +
> >>>    #if defined(__cplusplus)
> >>>    }
> >>>    #endif
> >>> --
> >>> 2.35.1
> >>>
> >>
> >> -- 
> >> Thomas Zimmermann
> >> Graphics Driver Developer
> >> SUSE Software Solutions Germany GmbH
> >> Maxfeldstr. 5, 90409 Nürnberg, Germany
> >> (HRB 36809, AG Nürnberg)
> >> Geschäftsführer: Ivo Totev
> >>
> 
> -- 
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Ivo Totev
>

  reply	other threads:[~2022-08-02  3:46 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 23:53 [PATCH v3 20/32] drm/via: Add via_pll.c Kevin Brace
2022-07-25 23:53 ` [PATCH v3 21/32] drm/via: Add via_pm.c Kevin Brace
2022-07-25 23:53 ` [PATCH v3 22/32] drm/via: Add via_sii164.c Kevin Brace
2022-07-25 23:53 ` [PATCH v3 23/32] drm/via: Add via_tmds.c Kevin Brace
2022-07-25 23:53 ` [PATCH v3 24/32] drm/via: Add via_ttm.c Kevin Brace
2022-07-25 23:53 ` [PATCH v3 25/32] drm/via: Add via_vt1632.c Kevin Brace
2022-07-25 23:53 ` [PATCH v3 26/32] drm/via: Add via_drm.h Kevin Brace
2022-07-26 17:41   ` Sam Ravnborg
2022-07-26 18:18     ` Thomas Zimmermann
2022-07-26 20:20       ` Dave Airlie
2022-07-27  7:36         ` Thomas Zimmermann
2022-07-29  1:06         ` Kevin Brace
2022-07-31  2:14     ` Kevin Brace
2022-07-26 18:24   ` Thomas Zimmermann
2022-07-30 22:48     ` Kevin Brace
2022-08-01 14:40       ` Sam Ravnborg
2022-08-02  0:10         ` Kevin Brace
2022-08-02 11:09           ` Sam Ravnborg
2022-08-02 18:12             ` Kevin Brace
2022-08-01 18:49       ` Thomas Zimmermann
2022-08-02  3:45         ` Kevin Brace [this message]
2022-08-02 11:38           ` Thomas Zimmermann
2022-08-03  1:49             ` Kevin Brace
2022-08-04 12:20               ` Thomas Zimmermann
2022-08-04 15:09                 ` Sam Ravnborg
2022-07-25 23:53 ` [PATCH v3 27/32] drm/via: Add new VIA Technologies Chrome supporting PCI IDs to DRM Kevin Brace
2022-07-25 23:53 ` [PATCH v3 28/32] drm/via: Zero out chip type field Kevin Brace
2022-07-25 23:53 ` [PATCH v3 29/32] drm/via: Add new VIA Technologies PCI device IDs related to graphics Kevin Brace
2022-07-25 23:53 ` [PATCH v3 30/32] drm/via: Add Kconfig Kevin Brace
2022-07-26  7:28   ` Thomas Zimmermann
2022-07-31  1:49     ` Kevin Brace
2022-08-01 10:36       ` Thomas Zimmermann
2022-07-25 23:53 ` [PATCH v3 31/32] drm/via: Add Makefile Kevin Brace
2022-07-26  7:29   ` Thomas Zimmermann
2022-07-31  1:55     ` Kevin Brace
2022-07-25 23:53 ` [PATCH v3 32/32] drm/via: Modify DRM core to be able to build OpenChrome DRM Kevin Brace

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=trinity-8c70d1f1-fd67-46a1-a84b-7cc771cca62d-1659411946174@3c-app-mailcom-bs03 \
    --to=kevinbrace@gmx.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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;
as well as URLs for NNTP newsgroup(s).