Skip to content

Commit

Permalink
Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/airlied/drm-2.6

* 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (21 commits)
  Fix http://bugzilla.kernel.org/show_bug.cgi?id=7606
  drm: add flag for mapping PCI DMA buffers read-only.
  drm: fix up irqflags in drm_lock.c
  drm: i915 updates
  drm: i915: fix up irqflags arg
  drm: i915: Only return EBUSY after we've established we need to schedule a new swap.
  drm: i915: Fix 'sequence has passed' condition in i915_vblank_swap().
  drm: i915: Add SAREA fileds for determining which pipe to sync window buffer swaps to.
  drm: Make handling of dev_priv->vblank_pipe more robust.
  drm: DRM_I915_VBLANK_SWAP ioctl: Take drm_vblank_seq_type_t instead
  drm: i915: Add ioctl for scheduling buffer swaps at vertical blanks.
  drm: Core vsync: Don't clobber target sequence number when scheduling signal.
  drm: Core vsync: Add flag DRM_VBLANK_NEXTONMISS.
  drm: Make locked tasklet handling more robust.
  drm: drm_rmdraw: Declare id and idx as signed so testing for < 0 works as intended.
  drm: Change first valid DRM drawable ID to be 1 instead of 0.
  drm: drawable locking + memory management fixes + copyright
  drm: Add support for interrupt triggered driver callback with lock held to DRM core.
  drm: Add support for tracking drawable information to core
  drm: add support for secondary vertical blank interrupt to i915
  ...
  • Loading branch information
Linus Torvalds committed Dec 9, 2006
2 parents 4594bf1 + d942625 commit 9b3a89f
Show file tree
Hide file tree
Showing 15 changed files with 821 additions and 57 deletions.
33 changes: 31 additions & 2 deletions drivers/char/drm/drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ typedef struct drm_clip_rect {
unsigned short y2;
} drm_clip_rect_t;

/**
* Drawable information.
*/
typedef struct drm_drawable_info {
unsigned int num_rects;
drm_clip_rect_t *rects;
} drm_drawable_info_t;

/**
* Texture region,
*/
Expand Down Expand Up @@ -348,7 +356,8 @@ typedef struct drm_buf_desc {
_DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
_DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
_DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
_DRM_FB_BUFFER = 0x08 /**< Buffer is in frame buffer */
_DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
_DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
} flags;
unsigned long agp_start; /**<
* Start address of where the AGP buffers are
Expand Down Expand Up @@ -443,6 +452,20 @@ typedef struct drm_draw {
drm_drawable_t handle;
} drm_draw_t;

/**
* DRM_IOCTL_UPDATE_DRAW ioctl argument type.
*/
typedef enum {
DRM_DRAWABLE_CLIPRECTS,
} drm_drawable_info_type_t;

typedef struct drm_update_draw {
drm_drawable_t handle;
unsigned int type;
unsigned int num;
unsigned long long data;
} drm_update_draw_t;

/**
* DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
*/
Expand All @@ -465,10 +488,14 @@ typedef struct drm_irq_busid {
typedef enum {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
_DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
_DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
_DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */
} drm_vblank_seq_type_t;

#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \
_DRM_VBLANK_NEXTONMISS)

struct drm_wait_vblank_request {
drm_vblank_seq_type_t type;
Expand Down Expand Up @@ -623,6 +650,8 @@ typedef struct drm_set_version {

#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t)

#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, drm_update_draw_t)

/**
* Device specific ioctls should only be in their respective headers
* The device specific ioctl range is from 0x40 to 0x79.
Expand Down
23 changes: 22 additions & 1 deletion drivers/char/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#define DRIVER_IRQ_VBL 0x100
#define DRIVER_DMA_QUEUE 0x200
#define DRIVER_FB_DMA 0x400
#define DRIVER_IRQ_VBL2 0x800

/***********************************************************************/
/** \name Begin the DRM... */
Expand Down Expand Up @@ -430,7 +431,8 @@ typedef struct drm_device_dma {
enum {
_DRM_DMA_USE_AGP = 0x01,
_DRM_DMA_USE_SG = 0x02,
_DRM_DMA_USE_FB = 0x04
_DRM_DMA_USE_FB = 0x04,
_DRM_DMA_USE_PCI_RO = 0x08
} flags;

} drm_device_dma_t;
Expand Down Expand Up @@ -562,6 +564,7 @@ struct drm_driver {
void (*kernel_context_switch_unlock) (struct drm_device * dev,
drm_lock_t *lock);
int (*vblank_wait) (struct drm_device * dev, unsigned int *sequence);
int (*vblank_wait2) (struct drm_device * dev, unsigned int *sequence);
int (*dri_library_name) (struct drm_device *dev, char *buf);

/**
Expand Down Expand Up @@ -708,9 +711,13 @@ typedef struct drm_device {

wait_queue_head_t vbl_queue; /**< VBLANK wait queue */
atomic_t vbl_received;
atomic_t vbl_received2; /**< number of secondary VBLANK interrupts */
spinlock_t vbl_lock;
drm_vbl_sig_t vbl_sigs; /**< signal list to send on VBLANK */
drm_vbl_sig_t vbl_sigs2; /**< signals to send on secondary VBLANK */
unsigned int vbl_pending;
spinlock_t tasklet_lock; /**< For drm_locked_tasklet */
void (*locked_tasklet_func)(struct drm_device *dev);

/*@} */
cycles_t ctx_start;
Expand Down Expand Up @@ -738,6 +745,15 @@ typedef struct drm_device {
drm_local_map_t *agp_buffer_map;
unsigned int agp_buffer_token;
drm_head_t primary; /**< primary screen head */

/** \name Drawable information */
/*@{ */
spinlock_t drw_lock;
unsigned int drw_bitfield_length;
u32 *drw_bitfield;
unsigned int drw_info_length;
drm_drawable_info_t **drw_info;
/*@} */
} drm_device_t;

static __inline__ int drm_core_check_feature(struct drm_device *dev,
Expand Down Expand Up @@ -885,6 +901,10 @@ extern int drm_adddraw(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int drm_rmdraw(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int drm_update_drawable_info(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern drm_drawable_info_t *drm_get_drawable_info(drm_device_t *dev,
drm_drawable_t id);

/* Authentication IOCTL support (drm_auth.h) */
extern int drm_getmagic(struct inode *inode, struct file *filp,
Expand Down Expand Up @@ -949,6 +969,7 @@ extern int drm_wait_vblank(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int drm_vblank_wait(drm_device_t * dev, unsigned int *vbl_seq);
extern void drm_vbl_send_signals(drm_device_t * dev);
extern void drm_locked_tasklet(drm_device_t *dev, void(*func)(drm_device_t*));

/* AGP/GART support (drm_agpsupport.h) */
extern drm_agp_head_t *drm_agp_init(drm_device_t * dev);
Expand Down
10 changes: 7 additions & 3 deletions drivers/char/drm/drm_bufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,9 @@ int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request)
request->count = entry->buf_count;
request->size = size;

if (request->flags & _DRM_PCI_BUFFER_RO)
dma->flags = _DRM_DMA_USE_PCI_RO;

atomic_dec(&dev->buf_alloc);
return 0;

Expand Down Expand Up @@ -1471,9 +1474,10 @@ int drm_freebufs(struct inode *inode, struct file *filp,
* \param arg pointer to a drm_buf_map structure.
* \return zero on success or a negative number on failure.
*
* Maps the AGP or SG buffer region with do_mmap(), and copies information
* about each buffer into user space. The PCI buffers are already mapped on the
* addbufs_pci() call.
* Maps the AGP, SG or PCI buffer region with do_mmap(), and copies information
* about each buffer into user space. For PCI buffers, it calls do_mmap() with
* offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls
* drm_mmap_dma().
*/
int drm_mapbufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/drm/drm_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

#define CORE_NAME "drm"
#define CORE_DESC "DRM shared core routines"
#define CORE_DATE "20051102"
#define CORE_DATE "20060810"

#define DRM_IF_MAJOR 1
#define DRM_IF_MINOR 2
#define DRM_IF_MINOR 3

#define CORE_MAJOR 1
#define CORE_MINOR 0
#define CORE_PATCHLEVEL 1
#define CORE_MINOR 1
#define CORE_PATCHLEVEL 0
Loading

0 comments on commit 9b3a89f

Please sign in to comment.