From: "Kristian Høgsberg" <hoegsberg@gmail.com>
To: Eric Anholt <eric@anholt.net>
Cc: mesa-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 0/8] Add DRIimage-based DRI3/Present loader
Date: Tue, 5 Nov 2013 14:09:11 -0800 [thread overview]
Message-ID: <20131105220911.GA4800@tokamak.local> (raw)
In-Reply-To: <871u2uhay7.fsf@eliezer.anholt.net>
On Tue, Nov 05, 2013 at 12:04:32PM -0800, Eric Anholt wrote:
> Keith Packard <keithp@keithp.com> writes:
>
> > Keith Packard <keithp@keithp.com> writes:
> >
> >> This sequence first adds a a couple of new DRIimage extensions to the
> >> dri/common, dri/i915 and dri/i965 directories which define a
> >> loader-independent API for managing window system operations.
> >>
> >> The last patch adds a new DRI3000 loader using those new interfaces.
> >
> > I've figured out that I can also re-use dri2CreateNewScreen2 for the
> > image driver bits, as long as I change that function to also look up the
> > image loader. That means there are *no* new dri_util functions needed.
> >
> > To recap, the changes needed to support using the DRIimageExtension
> > interfaces for allocating buffers from the driver in the loader are:
> >
> > DRIimageDriverExtension
> >
> > A proper subset of DRIdri2DriverExtension, which uses
> > the same five functions involved in creating new objects:
> >
> > /* Common DRI functions, shared with DRI2 */
> > __DRIcreateNewScreen2 createNewScreen2;
> > __DRIcreateNewDrawable createNewDrawable;
> > __DRIcreateNewContext createNewContext;
> > __DRIcreateContextAttribs createContextAttribs;
> > __DRIgetAPIMask getAPIMask;
>
> It seems like we could just stick these things in __DRI_CORE as opposed
> to having another new extension to look up. The downside I see there is
> bugs in the server, which have patches at xserver-driinterface-versions
> of my tree. (Unfortunately, I'm having a hard time building the server
> currently, so no testing yet). Having a new extension whose name has
> nothing to do with the functions in it seems really weird.
It may make more sense to just extend the existing interfaces, but
when we discussed DRIimageDriverExtension, the idea was that we could
phase out DRIdri2Extension. I think that still makes sense but
introducing more extensions doesn't make this interface better.
The way this was done originally was that we have DRIcoreExtension
which provided DRI1 support. The DRIdri2Extension extension replaces
some of the core functions (it has a createNewScreen that doesn't take
a sarea handle, for example...) and allows a loader to implement DRI2,
but you have to use both extensions. DRIswrastExtension works in a
similar for swrast.
The idea was to share the core functionality, but it's obviously messy
to have to mix two extensions to get things working. If we're
introducing a new extension, I'd suggest we move the functions from
DRIcoreExtension that we still use into this new extension and make it
completely replace DRIcoreExtension and DRIdri2Extension. The
functions from the core extension we still use are:
void (*destroyScreen)(__DRIscreen *screen);
const __DRIextension **(*getExtensions)(__DRIscreen *screen);
int (*getConfigAttrib)(const __DRIconfig *config,
unsigned int attrib,
unsigned int *value);
int (*indexConfigAttrib)(const __DRIconfig *config, int index,
unsigned int *attrib, unsigned int *value);
void (*destroyDrawable)(__DRIdrawable *drawable);
int (*copyContext)(__DRIcontext *dest,
__DRIcontext *src,
unsigned long mask);
void (*destroyContext)(__DRIcontext *context);
int (*bindContext)(__DRIcontext *ctx,
__DRIdrawable *pdraw,
__DRIdrawable *pread);
int (*unbindContext)(__DRIcontext *ctx);
and if we add those to DRIimageDriverExtension the loader only needs
to look for that and the DRIimage extension. Of course, the
implementation is already in dri_util.c, we just need to set the
function pointers to the DRIcoreExtension functions we share.
Kristian
next prev parent reply other threads:[~2013-11-05 22:09 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 2:23 [PATCH 0/8] Add DRIimage-based DRI3/Present loader Keith Packard
2013-11-05 2:23 ` [PATCH 1/8] drivers/dri/common: A few dri2 functions are not actually DRI2 specific Keith Packard
2013-11-05 2:23 ` [PATCH 2/8] dri/intel: Split out DRI2 buffer update code to separate function Keith Packard
2013-11-05 2:23 ` [PATCH 3/8] dri/intel: Add explicit size parameter to intel_region_alloc_for_fd Keith Packard
2013-11-05 22:23 ` Kristian Høgsberg
2013-11-06 0:52 ` Keith Packard
2013-11-07 5:17 ` Christopher James Halse Rogers
2013-11-07 5:42 ` Keith Packard
2013-11-05 2:23 ` [PATCH 4/8] Define __DRI_IMAGE_FORMAT_SARGB8 Keith Packard
2013-11-05 2:23 ` [PATCH 5/8] dri/common: Add functions mapping MESA_FORMAT_* <-> __DRI_IMAGE_FORMAT_* Keith Packard
2013-11-05 3:01 ` Jordan Justen
2013-11-05 4:11 ` Keith Packard
2013-11-05 22:53 ` Jordan Justen
2013-11-05 22:35 ` Kristian Høgsberg
2013-11-06 0:54 ` Keith Packard
2013-11-05 2:23 ` [PATCH 6/8] dri/i915, dri/i965: Use driGLFormatToImageFormat and driImageFormatToGLFormat Keith Packard
2013-11-05 22:37 ` [PATCH 6/8] dri/i915,dri/i965: " Kristian Høgsberg
2013-11-05 2:23 ` [PATCH 7/8] dri: add __DRIimageLoaderExtension and __DRIimageDriverExtension Keith Packard
2013-11-05 20:05 ` Eric Anholt
2013-11-05 23:47 ` Keith Packard
2013-11-05 22:59 ` Kristian Høgsberg
2013-11-06 0:59 ` Keith Packard
2013-11-06 2:48 ` Kristian Høgsberg
2013-11-06 6:25 ` Kristian Høgsberg
2013-11-06 14:55 ` Keith Packard
2013-11-06 16:17 ` Kristian Høgsberg
2013-11-06 18:09 ` Keith Packard
2013-11-06 19:06 ` Kristian Høgsberg
2013-11-06 19:29 ` Keith Packard
2013-11-05 2:23 ` [PATCH 8/8] Add DRI3+Present loader Keith Packard
2013-11-05 23:10 ` Eric Anholt
2013-11-06 2:32 ` Keith Packard
2013-11-05 16:40 ` [PATCH 0/8] Add DRIimage-based DRI3/Present loader Keith Packard
2013-11-05 20:04 ` Eric Anholt
2013-11-05 22:09 ` Kristian Høgsberg [this message]
2013-11-05 23:54 ` Keith Packard
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=20131105220911.GA4800@tokamak.local \
--to=hoegsberg@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=mesa-dev@lists.freedesktop.org \
/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