mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-07 21:38:05 +02:00
vertex dispatch improvements
This commit is contained in:
parent
fcb9e630da
commit
4a1d30de1e
3 changed files with 47 additions and 16 deletions
|
|
@ -633,31 +633,38 @@ static void mga_dma_dispatch_vertex(drm_device_t *dev, drm_buf_t *buf)
|
|||
unsigned long address = (unsigned long)real_buf->bus_address;
|
||||
int length = buf->used; /* this is correct */
|
||||
int use_agp = PDEA_pagpxfer_enable;
|
||||
int i, count;
|
||||
int i = 0;
|
||||
PRIMLOCALS;
|
||||
|
||||
PRIMRESET(dev_priv);
|
||||
|
||||
count = buf_priv->nbox;
|
||||
|
||||
if (count)
|
||||
mgaEmitState( dev_priv, buf_priv );
|
||||
|
||||
if (MGA_VERBOSE)
|
||||
printk("dispatch vertex addr 0x%lx, length 0x%x nbox %d\n",
|
||||
address, length, buf_priv->nbox);
|
||||
|
||||
for (i = 0 ; i < count ; i++) {
|
||||
mgaEmitClipRect( dev_priv, &buf_priv->boxes[i] );
|
||||
if (!buf_priv->vertex_discard) {
|
||||
|
||||
PRIMGETPTR(dev_priv);
|
||||
PRIMOUTREG( MGAREG_DMAPAD, 0);
|
||||
PRIMOUTREG( MGAREG_DMAPAD, 0);
|
||||
PRIMOUTREG( MGAREG_SECADDRESS, ((__u32)address) | TT_VERTEX);
|
||||
PRIMOUTREG( MGAREG_SECEND, (((__u32)(address + length)) |
|
||||
use_agp));
|
||||
PRIMADVANCE( dev_priv );
|
||||
mgaEmitState( dev_priv, buf_priv );
|
||||
|
||||
do {
|
||||
if (i < buf_priv->nbox)
|
||||
mgaEmitClipRect( dev_priv,
|
||||
&buf_priv->boxes[i] );
|
||||
|
||||
|
||||
PRIMGETPTR(dev_priv);
|
||||
PRIMOUTREG( MGAREG_DMAPAD, 0);
|
||||
PRIMOUTREG( MGAREG_DMAPAD, 0);
|
||||
PRIMOUTREG( MGAREG_SECADDRESS,
|
||||
((__u32)address) | TT_VERTEX);
|
||||
PRIMOUTREG( MGAREG_SECEND,
|
||||
(((__u32)(address + length)) |
|
||||
use_agp));
|
||||
PRIMADVANCE( dev_priv );
|
||||
} while (++i < buf_priv->nbox);
|
||||
}
|
||||
|
||||
|
||||
dev_priv->last_sync_tag = mga_create_sync_tag(dev_priv);
|
||||
|
||||
|
|
@ -1043,6 +1050,7 @@ static int mga_do_dma(drm_device_t *dev, int locked)
|
|||
drm_device_dma_t *dma = dev->dma;
|
||||
drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
|
||||
drm_mga_buf_priv_t *buf_priv;
|
||||
drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
|
||||
|
||||
if (MGA_VERBOSE) printk("mga_do_dma\n");
|
||||
if (test_and_set_bit(0, &dev->dma_flag)) {
|
||||
|
|
@ -1114,7 +1122,13 @@ static int mga_do_dma(drm_device_t *dev, int locked)
|
|||
buf->list = DRM_LIST_PEND;
|
||||
|
||||
buf_priv = buf->dev_private;
|
||||
if (MGA_VERBOSE) printk("mga_do_dma - type %d\n", buf_priv->dma_type);
|
||||
sarea_priv->last_dispatch = buf_priv->age;
|
||||
|
||||
if (MGA_VERBOSE)
|
||||
printk("mga_do_dma - type %d age %d\n",
|
||||
buf_priv->dma_type,
|
||||
buf_priv->age);
|
||||
|
||||
|
||||
switch (buf_priv->dma_type) {
|
||||
case MGA_DMA_GENERAL:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@ typedef struct {
|
|||
unsigned short clear_zval;
|
||||
unsigned int clear_flags;
|
||||
|
||||
unsigned int vertex_real_idx;
|
||||
unsigned int vertex_real_idx;
|
||||
unsigned int vertex_discard;
|
||||
|
||||
unsigned int age;
|
||||
|
||||
unsigned int nbox;
|
||||
xf86drmClipRectRec boxes[MGA_NR_SAREA_CLIPRECTS];
|
||||
|
|
|
|||
|
|
@ -190,11 +190,20 @@ typedef struct
|
|||
unsigned int nbox;
|
||||
xf86drmClipRectRec boxes[MGA_NR_SAREA_CLIPRECTS];
|
||||
|
||||
|
||||
int last_enqueue; /* last time a buffer was enqueued */
|
||||
int last_dispatch; /* age of the most recently dispatched buffer */
|
||||
int last_quiescent; /* */
|
||||
|
||||
|
||||
/* kernel doesn't touch from here down */
|
||||
int ctxOwner;
|
||||
mgaTexRegion texList[MGA_NR_TEX_REGIONS+1];
|
||||
int texAge;
|
||||
|
||||
|
||||
|
||||
|
||||
} drm_mga_sarea_t;
|
||||
|
||||
|
||||
|
|
@ -205,11 +214,13 @@ typedef struct {
|
|||
int clear_color;
|
||||
int clear_depth;
|
||||
int flags;
|
||||
int age;
|
||||
} drm_mga_clear_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int idx;
|
||||
int age;
|
||||
} drm_mga_swap_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -218,6 +229,7 @@ typedef struct {
|
|||
unsigned int pitch;
|
||||
xf86drmClipRectRec texture;
|
||||
int idx;
|
||||
int age;
|
||||
} drm_mga_iload_t;
|
||||
|
||||
|
||||
|
|
@ -233,6 +245,8 @@ typedef struct {
|
|||
int idx; /* buffer to queue and free on completion */
|
||||
int real_idx; /* buffer to execute */
|
||||
int real_used; /* buf->used in for real buffer */
|
||||
int age;
|
||||
int discard;
|
||||
} drm_mga_vertex_t;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue