projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
i965: Don't emit register spill offsets directly into g0.
[mesa.git]
/
src
/
mesa
/
drivers
/
dri
/
unichrome
/
via_ioctl.c
diff --git
a/src/mesa/drivers/dri/unichrome/via_ioctl.c
b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index dd2e93b286f8e3db72351d35ad1958b488d21441..116adda18ea2d74168acd2461a2199cefc3f89a7 100644
(file)
--- a/
src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/
src/mesa/drivers/dri/unichrome/via_ioctl.c
@@
-24,17
+24,16
@@
#include <stdio.h>
#include <unistd.h>
#include <stdio.h>
#include <unistd.h>
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
+#include "
main/
glheader.h"
+#include "m
ain/m
types.h"
+#include "ma
in/ma
cros.h"
+#include "
main/
dd.h"
#include "swrast/swrast.h"
#include "swrast/swrast.h"
-#include "mm.h"
+#include "m
ain/m
m.h"
#include "via_context.h"
#include "via_tris.h"
#include "via_ioctl.h"
#include "via_context.h"
#include "via_tris.h"
#include "via_ioctl.h"
-#include "via_state.h"
#include "via_fb.h"
#include "via_3d_reg.h"
#include "via_fb.h"
#include "via_3d_reg.h"
@@
-182,12
+181,12
@@
static void viaFillBuffer(struct via_context *vmesa,
GLuint i;
for (i = 0; i < nboxes ; i++) {
GLuint i;
for (i = 0; i < nboxes ; i++) {
- int x = pbox[i].x1 -
vmesa
->drawX;
- int y = pbox[i].y1 -
vmesa
->drawY;
+ int x = pbox[i].x1 -
buffer
->drawX;
+ int y = pbox[i].y1 -
buffer
->drawY;
int w = pbox[i].x2 - pbox[i].x1;
int h = pbox[i].y2 - pbox[i].y1;
int w = pbox[i].x2 - pbox[i].x1;
int h = pbox[i].y2 - pbox[i].y1;
- int offset = (buffer->o
rig
+
+ int offset = (buffer->o
ffset
+
y * buffer->pitch +
x * bytePerPixel);
y * buffer->pitch +
x * bytePerPixel);
@@
-202,10
+201,12
@@
static void viaFillBuffer(struct via_context *vmesa,
-static void viaClear(
GL
context *ctx, GLbitfield mask)
+static void viaClear(
struct gl_
context *ctx, GLbitfield mask)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
- __DRIdrawablePrivate *dPriv = vmesa->driDrawable;
+ __DRIdrawable *dPriv = vmesa->driDrawable;
+ struct via_renderbuffer *const vrb =
+ (struct via_renderbuffer *) dPriv->driverPrivate;
int flag = 0;
GLuint i = 0;
GLuint clear_depth_mask = 0xf << 28;
int flag = 0;
GLuint i = 0;
GLuint clear_depth_mask = 0xf << 28;
@@
-274,8
+275,8
@@
static void viaClear(GLcontext *ctx, GLbitfield mask)
/* flip top to bottom */
cy = dPriv->h - cy - ch;
/* flip top to bottom */
cy = dPriv->h - cy - ch;
- cx += v
mesa->drawX + vmesa->drawXoff
;
- cy += v
mesa
->drawY;
+ cx += v
rb->drawX
;
+ cy += v
rb
->drawY;
if (!all) {
drm_clip_rect_t *b = vmesa->pClipRects;
if (!all) {
drm_clip_rect_t *b = vmesa->pClipRects;
@@
-352,13
+353,13
@@
static void viaDoSwapBuffers(struct via_context *vmesa,
GLuint i;
for (i = 0; i < nbox; i++, b++) {
GLuint i;
for (i = 0; i < nbox; i++, b++) {
- GLint x = b->x1 -
vmesa
->drawX;
- GLint y = b->y1 -
vmesa
->drawY;
+ GLint x = b->x1 -
back
->drawX;
+ GLint y = b->y1 -
back
->drawY;
GLint w = b->x2 - b->x1;
GLint h = b->y2 - b->y1;
GLint w = b->x2 - b->x1;
GLint h = b->y2 - b->y1;
- GLuint src = back->o
rig
+ y * back->pitch + x * bytePerPixel;
- GLuint dest = front->o
rig
+ y * front->pitch + x * bytePerPixel;
+ GLuint src = back->o
ffset
+ y * back->pitch + x * bytePerPixel;
+ GLuint dest = front->o
ffset
+ y * front->pitch + x * bytePerPixel;
viaBlit(vmesa,
bytePerPixel << 3,
viaBlit(vmesa,
bytePerPixel << 3,
@@
-505,11
+506,12
@@
void viaWaitIdleLocked( struct via_context *vmesa, GLboolean light )
* except that WAIT_IDLE() will spin the CPU polling, while this is
* IRQ driven.
*/
* except that WAIT_IDLE() will spin the CPU polling, while this is
* IRQ driven.
*/
-static void viaWaitIdleVBlank(
const __DRIdrawablePrivat
e *dPriv,
+static void viaWaitIdleVBlank(
__DRIdrawabl
e *dPriv,
struct via_context *vmesa,
GLuint value )
{
GLboolean missed_target;
struct via_context *vmesa,
GLuint value )
{
GLboolean missed_target;
+ __DRIscreen *psp = dPriv->driScreenPriv;
VIA_FLUSH_DMA(vmesa);
VIA_FLUSH_DMA(vmesa);
@@
-521,11
+523,10
@@
static void viaWaitIdleVBlank( const __DRIdrawablePrivate *dPriv,
vmesa->thrashing)
viaSwapOutWork(vmesa);
vmesa->thrashing)
viaSwapOutWork(vmesa);
- driWaitForVBlank( dPriv, & vmesa->vbl_seq,
- vmesa->vblank_flags, & missed_target );
+ driWaitForVBlank( dPriv, & missed_target );
if ( missed_target ) {
vmesa->swap_missed_count++;
if ( missed_target ) {
vmesa->swap_missed_count++;
- (*
dri_interfac
e->getUST)( &vmesa->swap_missed_ust );
+ (*
psp->systemTim
e->getUST)( &vmesa->swap_missed_ust );
}
}
while (!viaCheckBreadcrumb(vmesa, value));
}
}
while (!viaCheckBreadcrumb(vmesa, value));
@@
-589,10
+590,11
@@
void viaResetPageFlippingLocked(struct via_context *vmesa)
/*
* Copy the back buffer to the front buffer.
*/
/*
* Copy the back buffer to the front buffer.
*/
-void viaCopyBuffer(
const __DRIdrawablePrivat
e *dPriv)
+void viaCopyBuffer(
__DRIdrawabl
e *dPriv)
{
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
{
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
+ __DRIscreen *psp = dPriv->driScreenPriv;
if (VIA_DEBUG & DEBUG_IOCTL)
fprintf(stderr,
if (VIA_DEBUG & DEBUG_IOCTL)
fprintf(stderr,
@@
-605,7
+607,7
@@
void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
VIA_FLUSH_DMA(vmesa);
VIA_FLUSH_DMA(vmesa);
- if (
vmesa->vblank_f
lags == VBLANK_FLAG_SYNC &&
+ if (
dPriv->vblF
lags == VBLANK_FLAG_SYNC &&
vmesa->lastBreadcrumbWrite > 1)
viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite-1);
else
vmesa->lastBreadcrumbWrite > 1)
viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite-1);
else
@@
-628,18
+630,19
@@
void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
- (*
dri_interfac
e->getUST)( &vmesa->swap_ust );
+ (*
psp->systemTim
e->getUST)( &vmesa->swap_ust );
}
}
-void viaPageFlip(
const __DRIdrawablePrivat
e *dPriv)
+void viaPageFlip(
__DRIdrawabl
e *dPriv)
{
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
struct via_renderbuffer buffer_tmp;
{
struct via_context *vmesa =
(struct via_context *)dPriv->driContextPriv->driverPrivate;
struct via_renderbuffer buffer_tmp;
+ __DRIscreen *psp = dPriv->driScreenPriv;
VIA_FLUSH_DMA(vmesa);
VIA_FLUSH_DMA(vmesa);
- if (
vmesa->vblank_f
lags == VBLANK_FLAG_SYNC &&
+ if (
dPriv->vblF
lags == VBLANK_FLAG_SYNC &&
vmesa->lastBreadcrumbWrite > 1)
viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite - 1);
else
vmesa->lastBreadcrumbWrite > 1)
viaWaitIdleVBlank(dPriv, vmesa, vmesa->lastBreadcrumbWrite - 1);
else
@@
-652,7
+655,7
@@
void viaPageFlip(const __DRIdrawablePrivate *dPriv)
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
- (*
dri_interfac
e->getUST)( &vmesa->swap_ust );
+ (*
psp->systemTim
e->getUST)( &vmesa->swap_ust );
/* KW: FIXME: When buffers are freed, could free frontbuffer by
/* KW: FIXME: When buffers are freed, could free frontbuffer by
@@
-745,7
+748,7
@@
static void via_emit_cliprect(struct via_context *vmesa,
: HC_HDBFM_RGB565);
GLuint pitch = buffer->pitch;
: HC_HDBFM_RGB565);
GLuint pitch = buffer->pitch;
- GLuint offset = buffer->o
rig
;
+ GLuint offset = buffer->o
ffset
;
if (0)
fprintf(stderr, "emit cliprect for box %d,%d %d,%d\n",
if (0)
fprintf(stderr, "emit cliprect for box %d,%d %d,%d\n",
@@
-754,6
+757,8
@@
static void via_emit_cliprect(struct via_context *vmesa,
vb[0] = HC_HEADER2;
vb[1] = (HC_ParaType_NotTex << 16);
vb[0] = HC_HEADER2;
vb[1] = (HC_ParaType_NotTex << 16);
+ assert(vmesa->driDrawable);
+
if (vmesa->driDrawable->w == 0 || vmesa->driDrawable->h == 0) {
vb[2] = (HC_SubA_HClipTB << 24) | 0x0;
vb[3] = (HC_SubA_HClipLR << 24) | 0x0;
if (vmesa->driDrawable->w == 0 || vmesa->driDrawable->h == 0) {
vb[2] = (HC_SubA_HClipTB << 24) | 0x0;
vb[3] = (HC_SubA_HClipLR << 24) | 0x0;
@@
-766,7
+771,7
@@
static void via_emit_cliprect(struct via_context *vmesa,
vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF);
vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24);
vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF);
vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24);
- vb[6] = (HC_SubA_HSPXYOS << 24)
| ((31-vmesa->drawXoff) << HC_HSPXOS_SHIFT)
;
+ vb[6] = (HC_SubA_HSPXYOS << 24);
vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch;
}
vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch;
}
@@
-881,22
+886,19
@@
void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags)
}
else if (vmesa->numClipRects) {
drm_clip_rect_t *pbox = vmesa->pClipRects;
}
else if (vmesa->numClipRects) {
drm_clip_rect_t *pbox = vmesa->pClipRects;
-
+
for (i = 0; i < vmesa->numClipRects; i++) {
drm_clip_rect_t b;
for (i = 0; i < vmesa->numClipRects; i++) {
drm_clip_rect_t b;
- b.x1 = pbox[i].x1
- (vmesa->drawX + vmesa->drawXoff)
;
- b.x2 = pbox[i].x2
- (vmesa->drawX + vmesa->drawXoff)
;
- b.y1 = pbox[i].y1
- vmesa->drawY
;
- b.y2 = pbox[i].y2
- vmesa->drawY
;
+ b.x1 = pbox[i].x1;
+ b.x2 = pbox[i].x2;
+ b.y1 = pbox[i].y1;
+ b.y2 = pbox[i].y2;
if (vmesa->scissor &&
!intersect_rect(&b, &b, &vmesa->scissorRect))
continue;
if (vmesa->scissor &&
!intersect_rect(&b, &b, &vmesa->scissorRect))
continue;
- b.x1 += vmesa->drawXoff;
- b.x2 += vmesa->drawXoff;
-
via_emit_cliprect(vmesa, &b);
if (fire_buffer(vmesa) != 0) {
via_emit_cliprect(vmesa, &b);
if (fire_buffer(vmesa) != 0) {
@@
-949,25
+951,25
@@
void viaFlushDma(struct via_context *vmesa)
}
}
}
}
-static void viaFlush(
GL
context *ctx)
+static void viaFlush(
struct gl_
context *ctx)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
VIA_FLUSH_DMA(vmesa);
}
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
VIA_FLUSH_DMA(vmesa);
}
-static void viaFinish(
GL
context *ctx)
+static void viaFinish(
struct gl_
context *ctx)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
VIA_FLUSH_DMA(vmesa);
viaWaitIdle(vmesa, GL_FALSE);
}
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
VIA_FLUSH_DMA(vmesa);
viaWaitIdle(vmesa, GL_FALSE);
}
-static void viaClearStencil(
GL
context *ctx, int s)
+static void viaClearStencil(
struct gl_
context *ctx, int s)
{
return;
}
{
return;
}
-void viaInitIoctlFuncs(
GL
context *ctx)
+void viaInitIoctlFuncs(
struct gl_
context *ctx)
{
ctx->Driver.Flush = viaFlush;
ctx->Driver.Clear = viaClear;
{
ctx->Driver.Flush = viaFlush;
ctx->Driver.Clear = viaClear;