public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Whitwell <keith@tungstengraphics.com>
To: Jon Smirl <jonsmirl@gmail.com>,
	Discuss issues related to the xorg tree  <xorg@freedesktop.org>
Cc: dri-devel <dri-devel@lists.sourceforge.net>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: New DRM driver model - gets rid of DRM() macros!
Date: Wed, 29 Sep 2004 15:25:06 +0100	[thread overview]
Message-ID: <415AC5C2.9030707@tungstengraphics.com> (raw)
In-Reply-To: <9e4733910409280854651581e2@mail.gmail.com>

Jon Smirl wrote:
>
> Drivers provide these callbacks......
> 
> struct drm_driver_fn {
>        u32 driver_features;
>        int dev_priv_size;
>        int permanent_maps;
>        drm_ioctl_desc_t *ioctls;
>        int num_ioctls;

>        int (*preinit)(struct drm_device *, unsigned long flags);
>        void (*prerelease)(struct drm_device *, struct file *filp);
>        void (*pretakedown)(struct drm_device *);
>        int (*postcleanup)(struct drm_device *);
>        int (*presetup)(struct drm_device *);
>        int (*postsetup)(struct drm_device *);
>        int (*dma_ioctl)( DRM_IOCTL_ARGS );
>        /* these are opposites at the moment */
>        int (*open_helper)(struct drm_device *, drm_file_t *);
>        void (*free_filp_priv)(struct drm_device *, drm_file_t *);

>        void (*release)(struct drm_device *, struct file *filp);
>        void (*dma_ready)(struct drm_device *);

Is this used by any driver?

>        int (*dma_quiescent)(struct drm_device *);

>        int (*context_ctor)(struct drm_device *dev, int context);
>        int (*context_dtor)(struct drm_device *dev, int context);
>        int (*kernel_context_switch)(struct drm_device *dev, int old, int new);
>        int (*kernel_context_switch_unlock)(struct drm_device *dev);

The whole context thing in the kernel is pretty much cruft.  The gamma module 
used to rely on it, maybe the ffb module if that still exists?  It would be 
good to see this disappear.

Though the drivers don't rely on it, I don't know if the server-side code 
persists in setting it up regardless, which might make it hard to get rid of.


>        int (*vblank_wait)(struct drm_device *dev, unsigned int *sequence);
> /* these have to be filled in */
>        int (*postinit)(struct drm_device *, unsigned long flags);

Maybe move this up with the other init/cleanup functions so that they are 
visibly grouped?  Can the large number of init/cleanup functions be 
rationalized in some way?

>        irqreturn_t (*irq_handler)( DRM_IRQ_ARGS );
>        void (*irq_preinstall)(struct drm_device *dev);
>        void (*irq_postinstall)(struct drm_device *dev);
>        void (*irq_uninstall)(struct drm_device *dev);

>        void (*reclaim_buffers)(struct file *filp);

Maybe rename this to dma_reclaim_buffers() to make clear what code it is 
associated with?

>        unsigned long (*get_map_ofs)(drm_map_t *map);
>        unsigned long (*get_reg_ofs)(struct drm_device *dev);
>        void (*set_version)(struct drm_device *dev, drm_set_version_t *sv);
>        int (*version)(drm_version_t *version);
> };
> 


  parent reply	other threads:[~2004-09-29 14:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-28 15:54 New DRM driver model - gets rid of DRM() macros! Jon Smirl
2004-09-28 16:56 ` Ian Romanick
2004-09-28 17:28   ` Jon Smirl
2004-09-28 19:35   ` Helge Hafting
2004-09-28 23:10 ` Dave Airlie
2004-09-29  1:27   ` Jon Smirl
2004-09-29  2:11     ` Dave Airlie
2004-09-29  5:25       ` Jon Smirl
2004-09-29 12:37 ` Christoph Hellwig
2004-09-29 11:59   ` Alan Cox
2004-09-29 13:16     ` Dave Airlie
2004-09-29 13:29   ` Keith Whitwell
2004-09-29 13:31     ` Christoph Hellwig
2004-09-29 13:35       ` Keith Whitwell
2004-09-29 14:12         ` Keith Whitwell
2004-09-29 14:16           ` Christoph Hellwig
2004-09-29 14:27             ` Keith Whitwell
2004-09-29 14:39               ` Keith Whitwell
2004-09-29 19:16                 ` Keith Packard
2004-09-30 18:10         ` Jon Smirl
2004-09-29 13:41   ` Dave Airlie
2004-10-01  5:15   ` Jon Smirl
2004-09-29 14:25 ` Keith Whitwell [this message]
2004-09-30  0:00   ` Eric Anholt
2004-09-29 21:52 ` Felix Kühling
2004-09-29 21:02   ` Alan Cox
2004-09-29 23:25   ` Jon Smirl
     [not found]     ` <20041006133714.GA26860@localdomain>
     [not found]       ` <9e47339104100609307307f8ea@mail.gmail.com>
     [not found]         ` <20041006211922.GA5167@localdomain>
2004-10-06 21:46           ` Code status (Was: New DRM driver model - gets rid of DRM() macros!) Ian Romanick

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=415AC5C2.9030707@tungstengraphics.com \
    --to=keith@tungstengraphics.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jonsmirl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xorg@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