summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bltsville/Android.mk17
-rw-r--r--bltsville/README5
-rwxr-xr-xbltsville/bltsville/README1
-rw-r--r--bltsville/bltsville/blend-854x480-bad.jpgbin77198 -> 0 bytes
-rw-r--r--bltsville/bltsville/blend-854x480-bad2.jpgbin69838 -> 0 bytes
-rw-r--r--bltsville/bltsville/blend-854x480-roundingerror.jpgbin69458 -> 0 bytes
-rw-r--r--bltsville/bltsville/blend-854x480-threeblts.jpgbin76246 -> 0 bytes
-rw-r--r--bltsville/bltsville/blend-854x480.jpgbin69281 -> 0 bytes
-rw-r--r--bltsville/bltsville/bvlogo.pngbin98635 -> 0 bytes
-rw-r--r--bltsville/bltsville/clock-720x480_4x3-fauxtrans.jpgbin70563 -> 0 bytes
-rw-r--r--bltsville/bltsville/clock-720x480_4x3.pngbin560594 -> 0 bytes
-rw-r--r--bltsville/bltsville/concrete-64x36.pngbin4783 -> 0 bytes
-rw-r--r--bltsville/bltsville/include/bltsville.h602
-rw-r--r--bltsville/bltsville/include/bvblend.h508
-rw-r--r--bltsville/bltsville/include/bvbuffdesc.h61
-rw-r--r--bltsville/bltsville/include/bvcache.h45
-rw-r--r--bltsville/bltsville/include/bventry.h32
-rw-r--r--bltsville/bltsville/include/bverror.h307
-rw-r--r--bltsville/bltsville/include/bvfilter.h51
-rw-r--r--bltsville/bltsville/include/bvinternal.h47
-rw-r--r--bltsville/bltsville/include/bvsurfgeom.h41
-rw-r--r--bltsville/bltsville/index.html4362
-rw-r--r--bltsville/bltsville/ocdtab.pngbin11854 -> 0 bytes
-rw-r--r--bltsville/gcbv/Android.mk86
-rw-r--r--bltsville/gcbv/gcmain.c531
-rw-r--r--bltsville/gcbv/gcmain.h143
-rw-r--r--bltsville/gcbv/mirror/gcblit.c771
-rw-r--r--bltsville/gcbv/mirror/gcbuffer.c383
-rw-r--r--bltsville/gcbv/mirror/gcbv.c2008
-rw-r--r--bltsville/gcbv/mirror/gcbv.h590
-rw-r--r--bltsville/gcbv/mirror/gcdbglog.c1684
-rw-r--r--bltsville/gcbv/mirror/gcfill.c258
-rw-r--r--bltsville/gcbv/mirror/gcfilter.c1788
-rw-r--r--bltsville/gcbv/mirror/gcmap.c342
-rw-r--r--bltsville/gcbv/mirror/gcparser.c2090
-rw-r--r--bltsville/gcbv/mirror/include/cache-2dmanager.h75
-rw-r--r--bltsville/gcbv/mirror/include/gcdbglog.h384
-rw-r--r--bltsville/gcbv/mirror/include/gcerror.h226
-rw-r--r--bltsville/gcbv/mirror/include/gcioctl.h293
-rw-r--r--bltsville/gcbv/mirror/include/gclist.h594
-rw-r--r--bltsville/gcbv/mirror/include/gcreg.h10269
-rw-r--r--bltsville/gcbv/mirror/include/gcx.h87
-rw-r--r--bltsville/gcbv/version.h33
-rw-r--r--bltsville/ocd/README1
-rwxr-xr-xbltsville/ocd/include/ocd.h801
-rwxr-xr-xbltsville/ocd/index.html617
-rwxr-xr-xbltsville/ocd/ocdlogo.jpgbin45982 -> 0 bytes
47 files changed, 0 insertions, 30133 deletions
diff --git a/bltsville/Android.mk b/bltsville/Android.mk
deleted file mode 100644
index 56a3fa8..0000000
--- a/bltsville/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include $(call all-subdir-makefiles)
diff --git a/bltsville/README b/bltsville/README
deleted file mode 100644
index ddc3f93..0000000
--- a/bltsville/README
+++ /dev/null
@@ -1,5 +0,0 @@
-Welcome to the bltsville & friends repositoty. Please add 2D
-acceleration libs, src, and supporting headers in whatver manner you
-see fit.
-
-Thanks! \ No newline at end of file
diff --git a/bltsville/bltsville/README b/bltsville/bltsville/README
deleted file mode 100755
index bf5751b..0000000
--- a/bltsville/bltsville/README
+++ /dev/null
@@ -1 +0,0 @@
-git://github.com/graphics/bltsville.git
diff --git a/bltsville/bltsville/blend-854x480-bad.jpg b/bltsville/bltsville/blend-854x480-bad.jpg
deleted file mode 100644
index adc2d6d..0000000
--- a/bltsville/bltsville/blend-854x480-bad.jpg
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/blend-854x480-bad2.jpg b/bltsville/bltsville/blend-854x480-bad2.jpg
deleted file mode 100644
index 67a01f3..0000000
--- a/bltsville/bltsville/blend-854x480-bad2.jpg
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/blend-854x480-roundingerror.jpg b/bltsville/bltsville/blend-854x480-roundingerror.jpg
deleted file mode 100644
index 9a12713..0000000
--- a/bltsville/bltsville/blend-854x480-roundingerror.jpg
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/blend-854x480-threeblts.jpg b/bltsville/bltsville/blend-854x480-threeblts.jpg
deleted file mode 100644
index 3790a29..0000000
--- a/bltsville/bltsville/blend-854x480-threeblts.jpg
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/blend-854x480.jpg b/bltsville/bltsville/blend-854x480.jpg
deleted file mode 100644
index c76a433..0000000
--- a/bltsville/bltsville/blend-854x480.jpg
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/bvlogo.png b/bltsville/bltsville/bvlogo.png
deleted file mode 100644
index 7f9944e..0000000
--- a/bltsville/bltsville/bvlogo.png
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/clock-720x480_4x3-fauxtrans.jpg b/bltsville/bltsville/clock-720x480_4x3-fauxtrans.jpg
deleted file mode 100644
index fa3aa68..0000000
--- a/bltsville/bltsville/clock-720x480_4x3-fauxtrans.jpg
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/clock-720x480_4x3.png b/bltsville/bltsville/clock-720x480_4x3.png
deleted file mode 100644
index 3a7f566..0000000
--- a/bltsville/bltsville/clock-720x480_4x3.png
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/concrete-64x36.png b/bltsville/bltsville/concrete-64x36.png
deleted file mode 100644
index cf21f0f..0000000
--- a/bltsville/bltsville/concrete-64x36.png
+++ /dev/null
Binary files differ
diff --git a/bltsville/bltsville/include/bltsville.h b/bltsville/bltsville/include/bltsville.h
deleted file mode 100644
index 632628e..0000000
--- a/bltsville/bltsville/include/bltsville.h
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
- * bltsville.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef BLTSVILLE_H
-#define BLTSVILLE_H
-
-#include "ocd.h"
-#include "bverror.h"
-#include "bvblend.h"
-#include "bvfilter.h"
-#include "bvbuffdesc.h"
-#include "bvcache.h"
-#include "bventry.h"
-#include "bvsurfgeom.h"
-
-/*
- * bvrect - This structure is used to specify rectangles in BLTsville.
- */
-struct bvrect {
- int left;
- int top;
- unsigned int width;
- unsigned int height;
-};
-
-
-/*
- * BVFLAG_* - These define the type of BLT to be performed and are placed in
- * the bvparams.flags element.
- */
-#define BVFLAG_OP_SHIFT 0
-#define BVFLAG_OP_MASK (0xF << BVFLAG_OP_SHIFT)
-
-/* 0 reserved */
-#define BVFLAG_ROP (0x1 << BVFLAG_OP_SHIFT) /* ROP4 spec'd in rop */
-#define BVFLAG_BLEND (0x2 << BVFLAG_OP_SHIFT) /* blend spec'd in blend */
-/* 3 reserved */
-#define BVFLAG_FILTER (0x4 << BVFLAG_OP_SHIFT) /* filter spec'd in filter */
-/* 5-F reserved */
-
-#define BVFLAG_KEY_SRC 0x00000010 /* source color key - value spec'd
- by pcolorkey; Mutually exclusive
- with BVFLAG_KEY_DST */
-#define BVFLAG_KEY_DST 0x00000020 /* dest color key - value spec'd
- by pcolorkey; Mutually exclusive
- with BVFLAG_KEY_SRC */
-#define BVFLAG_CLIP 0x00000040 /* clipping rectangle spec'd by
- cliprect */
-#define BVFLAG_SRCMASK 0x00000080 /* when scaling a masked copy, mask
- at the source instead of the
- (default) destination */
-
-#define BVFLAG_ASYNC 0x00000100 /* call should return once queued */
-
-#define BVFLAG_TILE_SRC1 0x00000200 /* source 1 is tiled */
-#define BVFLAG_TILE_SRC2 0x00000400 /* source 2 is tiled */
-#define BVFLAG_TILE_MASK 0x00000800 /* mask is tiled */
-
-
-#define BVFLAG_BATCH_SHIFT 12
-#define BVFLAG_BATCH_MASK (3 << BVFLAG_BATCH_SHIFT)
-
-#define BVFLAG_BATCH_NONE (0 << BVFLAG_BATCH_SHIFT) /* not batched */
-#define BVFLAG_BATCH_BEGIN (1 << BVFLAG_BATCH_SHIFT) /* begin batch */
-#define BVFLAG_BATCH_CONTINUE (2 << BVFLAG_BATCH_SHIFT) /* continue batch */
-#define BVFLAG_BATCH_END (3 << BVFLAG_BATCH_SHIFT) /* end batch */
-
-
-#define BVFLAG_HORZ_FLIP_SRC1 0x00004000 /* flip src1 horizontally */
-#define BVFLAG_VERT_FLIP_SRC1 0x00008000 /* flip src1 vertically */
-#define BVFLAG_HORZ_FLIP_SRC2 0x00010000 /* flip src2 horizontally */
-#define BVFLAG_VERT_FLIP_SRC2 0x00020000 /* flip src2 vertically */
-#define BVFLAG_HORZ_FLIP_MASK 0x00040000 /* flip mask horizontally */
-#define BVFLAG_VERT_FLIP_MASK 0x00080000 /* flip mask vertically */
-
-
-#define BVFLAG_SCALE_RETURN 0x00100000 /* return scale type used */
-#define BVFLAG_DITHER_RETURN 0x00200000 /* return dither type used */
-
-
-#define BVFLAG_SRC2_AUXDSTRECT 0x00400000 /* src2auxdstrect used */
-#define BVFLAG_MASK_AUXDSTRECT 0x00800000 /* maskauxdstrect used */
-
-#define BVFLAG_TESTPARAMS_NOP 0x01000000 /* test params only - no BLT */
-/**** Bits 25-31 reserved ****/
-
-/*
- * BVIMPL_* - BLTsville implementations may be combined under managers to
- * allow clients to take advantage of multiple implementations without doing
- * so explicitly. The BVIMPL_* definition are placed into the
- * bvparams.implementation member by the client to override the manager's
- * choice of implementation.
- */
-#define BVIMPL_ANY 0
-#define BVIMPL_FIRST_HW (1 << 31) /* Continues to the right */
-#define BVIMPL_FIRST_CPU (1 << 0) /* Continues to the left */
-
-
-/*
- * bvscalemode - This specifies the type of scaling to perform.
- */
-#define BVSCALEDEF_VENDOR_SHIFT 24
-#define BVSCALEDEF_VENDOR_MASK (0xFF << BVSCALEDEF_VENDOR_SHIFT)
-
-#define BVSCALEDEF_VENDOR_ALL (0 << BVSCALEDEF_VENDOR_SHIFT)
-#define BVSCALEDEF_VENDOR_TI (1 << BVSCALEDEF_VENDOR_SHIFT)
-/* 0xF0-0xFE reserved */
-#define BVSCALEDEF_VENDOR_GENERIC (0xFF << BVSCALEDEF_VENDOR_SHIFT)
-
-/***** VENDOR_GENERIC definitions *****/
-/**** Bits 23-22 indicate classification ****/
-#define BVSCALEDEF_CLASS_SHIFT 22
-#define BVSCALEDEF_IMPLICIT (0 << BVSCALEDEF_CLASS_SHIFT)
-#define BVSCALEDEF_EXPLICIT (1 << BVSCALEDEF_CLASS_SHIFT)
-/* 2-3 reserved */
-#define BVSCALEDEF_CLASS_MASK (3 << BVSCALEDEF_CLASS_SHIFT)
-
-/**** IMPLICIT definitions ****/
-/*** Bits 21-16 indicate the quality (speed) desired ***/
-#define BVSCALEDEF_QUALITY_SHIFT 16
-#define BVSCALEDEF_FASTEST (0x00 << BVSCALEDEF_QUALITY_SHIFT)
-#define BVSCALEDEF_GOOD (0x15 << BVSCALEDEF_QUALITY_SHIFT)
-#define BVSCALEDEF_BETTER (0x2A << BVSCALEDEF_QUALITY_SHIFT)
-#define BVSCALEDEF_BEST (0x3F << BVSCALEDEF_QUALITY_SHIFT)
-#define BVSCALEDEF_QUALITY_MASK (0x3F << BVSCALEDEF_QUALITY_SHIFT)
-/* Bits 12-15 are reserved */
-/*** Bits 11-8 indicate the desired technique ***/
-#define BVSCALEDEF_TECHNIQUE_SHIFT 8
-#define BVSCALEDEF_DONT_CARE (0x0 << BVSCALEDEF_TECHNIQUE_SHIFT)
-#define BVSCALEDEF_NOT_NEAREST_NEIGHBOR (0x1 << BVSCALEDEF_TECHNIQUE_SHIFT)
-#define BVSCALEDEF_POINT_SAMPLE (0x2 << BVSCALEDEF_TECHNIQUE_SHIFT)
-#define BVSCALEDEF_INTERPOLATED (0x3 << BVSCALEDEF_TECHNIQUE_SHIFT)
-#define BVSCALEDEF_TECHNIQUE_MASK (0xF << BVSCALEDEF_TECHNIQUE_SHIFT)
-/* Bits 2-7 reserved */
-/*** Bits 1-0 indicate the type of image ***/
-#define BVSCALEDEF_TYPE_SHIFT 0
-/* 0 don't know */
-#define BVSCALEDEF_PHOTO (1 << BVSCALEDEF_TYPE_SHIFT)
-#define BVSCALEDEF_DRAWING (2 << BVSCALEDEF_TYPE_SHIFT)
-/* 3 reserved */
-#define BVSCALEDEF_TYPE_MASK (3 << BVSCALEDEF_TYPE_SHIFT)
-
-/**** EXPLICIT definitions ****/
-/* Bits 16-21 reserved */
-#define BVSCALEDEF_HORZ_SHIFT 8
-#define BVSCALEDEF_HORZ_MASK (0xFF << BVSCALEDEF_HORZ_SHIFT)
-
-#define BVSCALEDEF_VERT_SHIFT 0
-#define BVSCALEDEF_VERT_MASK (0xFF << BVSCALEDEF_VERT_SHIFT)
-
-#define BVSCALEDEF_NEAREST_NEIGHBOR 0x00
-#define BVSCALEDEF_LINEAR 0x01
-#define BVSCALEDEF_CUBIC 0x02
-#define BVSCALEDEF_3_TAP 0x03
-/* 0x04 reserved */
-#define BVSCALEDEF_5_TAP 0x05
-/* 0x06 reserved */
-#define BVSCALEDEF_7_TAP 0x07
-/* 0x08 reserved */
-#define BVSCALEDEF_9_TAP 0x09
-/* 0x0A-0xFF reserved */
-
-enum bvscalemode {
- BVSCALE_FASTEST = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_FASTEST |
- BVSCALEDEF_DONT_CARE,
- BVSCALE_FASTEST_NOT_NEAREST_NEIGHBOR = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_FASTEST |
- BVSCALEDEF_NOT_NEAREST_NEIGHBOR,
- BVSCALE_FASTEST_POINT_SAMPLE = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_FASTEST |
- BVSCALEDEF_POINT_SAMPLE,
- BVSCALE_FASTEST_INTERPOLATED = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_FASTEST |
- BVSCALEDEF_INTERPOLATED,
- BVSCALE_FASTEST_PHOTO = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_FASTEST |
- BVSCALEDEF_PHOTO,
- BVSCALE_FASTEST_DRAWING = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_FASTEST |
- BVSCALEDEF_DRAWING,
- BVSCALE_GOOD = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_GOOD |
- BVSCALEDEF_DONT_CARE,
- BVSCALE_GOOD_POINT_SAMPLE = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_GOOD |
- BVSCALEDEF_POINT_SAMPLE,
- BVSCALE_GOOD_INTERPOLATED = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_GOOD |
- BVSCALEDEF_INTERPOLATED,
- BVSCALE_GOOD_PHOTO = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_GOOD |
- BVSCALEDEF_PHOTO,
- BVSCALE_GOOD_DRAWING = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_GOOD |
- BVSCALEDEF_DRAWING,
- BVSCALE_BETTER = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BETTER |
- BVSCALEDEF_DONT_CARE,
- BVSCALE_BETTER_POINT_SAMPLE = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BETTER |
- BVSCALEDEF_POINT_SAMPLE,
- BVSCALE_BETTER_INTERPOLATED = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BETTER |
- BVSCALEDEF_INTERPOLATED,
- BVSCALE_BETTER_PHOTO = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BETTER |
- BVSCALEDEF_PHOTO,
- BVSCALE_BETTER_DRAWING = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BETTER |
- BVSCALEDEF_DRAWING,
- BVSCALE_BEST = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BEST |
- BVSCALEDEF_DONT_CARE,
- BVSCALE_BEST_POINT_SAMPLE = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BEST |
- BVSCALEDEF_POINT_SAMPLE,
- BVSCALE_BEST_INTERPOLATED = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BEST |
- BVSCALEDEF_INTERPOLATED,
- BVSCALE_BEST_PHOTO = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BEST |
- BVSCALEDEF_PHOTO,
- BVSCALE_BEST_DRAWING = BVSCALEDEF_VENDOR_ALL |
- BVSCALEDEF_IMPLICIT |
- BVSCALEDEF_BEST |
- BVSCALEDEF_DRAWING,
-
- BVSCALE_NEAREST_NEIGHBOR = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_NEAREST_NEIGHBOR << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_NEAREST_NEIGHBOR << BVSCALEDEF_VERT_SHIFT),
- BVSCALE_BILINEAR = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_LINEAR << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_LINEAR << BVSCALEDEF_VERT_SHIFT),
- BVSCALE_BICUBIC = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_CUBIC << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_CUBIC << BVSCALEDEF_VERT_SHIFT),
- BVSCALE_3x3_TAP = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_3_TAP << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_3_TAP << BVSCALEDEF_VERT_SHIFT),
- BVSCALE_5x5_TAP = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_5_TAP << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_5_TAP << BVSCALEDEF_VERT_SHIFT),
- BVSCALE_7x7_TAP = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_7_TAP << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_7_TAP << BVSCALEDEF_VERT_SHIFT),
- BVSCALE_9x9_TAP = BVSCALEDEF_VENDOR_GENERIC |
- BVSCALEDEF_EXPLICIT |
- (BVSCALEDEF_9_TAP << BVSCALEDEF_HORZ_SHIFT) |
- (BVSCALEDEF_9_TAP << BVSCALEDEF_VERT_SHIFT),
-
-#ifdef BVSCALE_EXTERNAL_INCLUDE
-#include BVSCALE_EXTERNAL_INCLUDE
-#endif
-};
-
-
-/*
- * bvdithermode - This defines the type of dithering to use.
- */
-#define BVDITHERDEF_VENDOR_SHIFT 24
-#define BVDITHERDEF_VENDOR_MASK (0xFF << BVDITHERDEF_VENDOR_SHIFT)
-
-#define BVDITHERDEF_VENDOR_ALL (0 << BVDITHERDEF_VENDOR_SHIFT)
-#define BVDITHERDEF_VENDOR_TI (1 << BVDITHERDEF_VENDOR_SHIFT)
-/* 0xF0-0xFE reserved */
-#define BVDITHERDEF_VENDOR_GENERIC (0xFF << BVDITHERDEF_VENDOR_SHIFT)
-
-/***** VENDOR_GENERIC definitions *****/
-/* Bits 18-23 reserved */
-/**** Bits 17-16 indicate the type of image - 0 = don't know ****/
-#define BVDITHERDEF_TYPE_SHIFT 16
-#define BVDITHERDEF_PHOTO (0x01 << BVDITHERDEF_TYPE_SHIFT)
-#define BVDITHERDEF_DRAWING (0x02 << BVDITHERDEF_TYPE_SHIFT)
-/**** Bits 15-8 indicate the desired technique ****/
-#define BVDITHERDEF_TECHNIQUE_SHIFT 8
-#define BVDITHERDEF_DONT_CARE (0x00 << BVDITHERDEF_TECHNIQUE_SHIFT)
-#define BVDITHERDEF_RANDOM (0x01 << BVDITHERDEF_TECHNIQUE_SHIFT)
-#define BVDITHERDEF_ORDERED (0x02 << BVDITHERDEF_TECHNIQUE_SHIFT)
-#define BVDITHERDEF_DIFFUSED (0x04 << BVDITHERDEF_TECHNIQUE_SHIFT)
-#define BVDITHERDEF_ON (0xFF << BVDITHERDEF_TECHNIQUE_SHIFT)
-/**** Bits 7-0 indicate the quality (speed) desired ****/
-#define BVDITHERDEF_QUALITY_SHIFT 0
-#define BVDITHERDEF_FASTEST (0x00 << BVDITHERDEF_QUALITY_SHIFT)
-#define BVDITHERDEF_GOOD (0x55 << BVDITHERDEF_QUALITY_SHIFT)
-#define BVDITHERDEF_BETTER (0xAA << BVDITHERDEF_QUALITY_SHIFT)
-#define BVDITHERDEF_BEST (0xFF << BVDITHERDEF_QUALITY_SHIFT)
-
-enum bvdithermode {
- BVDITHER_FASTEST = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_DONT_CARE,
- BVDITHER_FASTEST_ON = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_ON,
- BVDITHER_FASTEST_RANDOM = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_RANDOM,
- BVDITHER_FASTEST_ORDERED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_ORDERED,
- BVDITHER_FASTEST_DIFFUSED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_DIFFUSED,
- BVDITHER_FASTEST_PHOTO = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_PHOTO,
- BVDITHER_FASTEST_DRAWING = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_FASTEST |
- BVDITHERDEF_DRAWING,
- BVDITHER_GOOD = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_DONT_CARE,
- BVDITHER_GOOD_ON = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_ON,
- BVDITHER_GOOD_RANDOM = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_RANDOM,
- BVDITHER_GOOD_ORDERED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_ORDERED,
- BVDITHER_GOOD_DIFFUSED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_DIFFUSED,
- BVDITHER_GOOD_PHOTO = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_PHOTO,
- BVDITHER_GOOD_DRAWING = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_GOOD |
- BVDITHERDEF_DRAWING,
- BVDITHER_BETTER = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_DONT_CARE,
- BVDITHER_BETTER_ON = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_ON,
- BVDITHER_BETTER_RANDOM = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_RANDOM,
- BVDITHER_BETTER_ORDERED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_ORDERED,
- BVDITHER_BETTER_DIFFUSED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_DIFFUSED,
- BVDITHER_BETTER_PHOTO = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_PHOTO,
- BVDITHER_BETTER_DRAWING = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BETTER |
- BVDITHERDEF_DRAWING,
- BVDITHER_BEST = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_DONT_CARE,
- BVDITHER_BEST_ON = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_ON,
- BVDITHER_BEST_RANDOM = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_RANDOM,
- BVDITHER_BEST_ORDERED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_ORDERED,
- BVDITHER_BEST_DIFFUSED = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_DIFFUSED,
- BVDITHER_BEST_PHOTO = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_PHOTO,
- BVDITHER_BEST_DRAWING = BVDITHERDEF_VENDOR_ALL |
- BVDITHERDEF_BEST |
- BVDITHERDEF_DRAWING,
-
- BVDITHER_NONE = BVDITHERDEF_VENDOR_GENERIC + 0,
- BVDITHER_ORDERED_2x2 = BVDITHERDEF_VENDOR_GENERIC + 4,
- BVDITHER_ORDERED_4x4 = BVDITHERDEF_VENDOR_GENERIC + 16,
- BVDITHER_ORDERED_2x2_4x4 = BVDITHERDEF_VENDOR_GENERIC + 4 + 16,
- /* 2x2 for 6->8, 4x4 for 5->8 */
-
-#ifdef BVDITHER_EXTERNAL_INCLUDE
-#include BVDITHER_EXTERNAL_INCLUDE
-#endif
-};
-
-
-/*
- * BVTILE_* flags - These specify parameters used when tiling.
- */
-#define BVTILE_LEFT_SHIFT 0
-#define BVTILE_TOP_SHIFT (BVTILE_LEFT_SHIFT + 2)
-#define BVTILE_RIGHT_SHIFT (BVTILE_TOP_SHIFT + 2)
-#define BVTILE_BOTTOM_SHIFT (BVTILE_RIGHT_SHIFT + 2)
-#define BVTILE_LEFT_REPEAT (0 << BVTILE_LEFT_SHIFT) /* ...012301230123 */
-#define BVTILE_TOP_REPEAT (0 << BVTILE_TOP_SHIFT) /* ...012301230123 */
-#define BVTILE_RIGHT_REPEAT (0 << BVTILE_RIGHT_SHIFT) /* 012301230123... */
-#define BVTILE_BOTTOM_REPEAT (0 << BVTILE_BOTTOM_SHIFT) /* 012301230123... */
-#define BVTILE_LEFT_MIRROR (1 << BVTILE_LEFT_SHIFT) /* ...012332100123 */
-#define BVTILE_TOP_MIRROR (1 << BVTILE_TOP_SHIFT) /* ...012332100123 */
-#define BVTILE_RIGHT_MIRROR (1 << BVTILE_RIGHT_SHIFT) /* 012332100123... */
-#define BVTILE_BOTTOM_MIRROR (1 << BVTILE_BOTTOM_SHIFT) /* 012332100123... */
-
-/*
- * bvtileparams - This structure provides additional parameters needed when
- * tiling. This structure replaces the bvbuffdesc in bvbltparams when the
- * associated BVFLAG_TILE_* flag is set in bvbltparams.flags.
- */
-struct bvtileparams {
- unsigned int structsize; /* used to ID structure version */
- unsigned long flags; /* tile flags */
- void *virtaddr; /* pointer to the brush */
- int dstleft; /* horizontal offset */
- int dsttop; /* vertical offset */
- unsigned int srcwidth; /* w/dst width to spec horz scale */
- unsigned int srcheight; /* w/dst height to spec vert scale */
-};
-
-/*
- * BVBATCH_* - These flags specify the parameters that change between
- * batched BLTs, when BVFLAG_CONTINUE or BVFLAG_END set.
- */
-#define BVBATCH_OP 0x00000001 /* type of operation changed */
-#define BVBATCH_KEY 0x00000002 /* color key changed */
-#define BVBATCH_MISCFLAGS 0x00000004 /* other flags changed */
-#define BVBATCH_ALPHA 0x00000008 /* global alpha changed */
-#define BVBATCH_DITHER 0x00000010 /* dither changed */
-#define BVBATCH_SCALE 0x00000020 /* scaling type changed */
-/* Bits 6-7 reserved */
-#define BVBATCH_DST 0x00000100 /* destination surface changed */
-#define BVBATCH_SRC1 0x00000200 /* source 1 surface changed */
-#define BVBATCH_SRC2 0x00000400 /* source 2 surface changed */
-#define BVBATCH_MASK 0x00000800 /* mask surface changed */
-#define BVBATCH_DSTRECT_ORIGIN 0x00001000 /* dest rect origin changed */
-#define BVBATCH_DSTRECT_SIZE 0x00002000 /* dest rect dimensions changed */
-#define BVBATCH_SRC1RECT_ORIGIN 0x00004000 /* src 1 rect origin changed */
-#define BVBATCH_SRC1RECT_SIZE 0x00008000 /* src 1 rect dimensions changed */
-#define BVBATCH_SRC2RECT_ORIGIN 0x00010000 /* src 2 rect origin changed */
-#define BVBATCH_SRC2RECT_SIZE 0x00020000 /* src 2 rect dimensions changed */
-#define BVBATCH_MASKRECT_ORIGIN 0x00040000 /* mask rect origin changed */
-#define BVBATCH_MASKRECT_SIZE 0x00080000 /* mask rect dimensions changed */
-#define BVBATCH_CLIPRECT_ORIGIN 0x00100000 /* Clip rect origin changed */
-#define BVBATCH_CLIPRECT_SIZE 0x00200000 /* Clip rect dimensions changed */
-#define BVBATCH_CLIPRECT (BVBATCH_CLIPRECT_ORIGIN | \
- BVBATCH_CLIPRECT_SIZE) /* clip rect... */
- /* ...changed */
-#define BVBATCH_TILE_SRC1 0x00400000 /* tile params for src 1 changed */
-#define BVBATCH_TILE_SRC2 0x00800000 /* tile params for src 2 changed */
-#define BVBATCH_TILE_MASK 0x00100000 /* tile params for mask changed */
-/* Bits 21-30 reserved */
-#define BVBATCH_ENDNOP 0x80000000 /* just end batch, don't do BLT;
- only with BVFLAG_BATCH_END */
-
-/*
- * bvcallbackerror - This structure is passed into the callback function
- * if an error occurs.
- */
-struct bvcallbackerror {
- unsigned int structsize; /* used to ID structure version */
- enum bverror error; /* error during async BLT */
- char *errdesc; /* 0-terminated ASCII string
- with extended error info (not
- for end users) */
-};
-
-/*
- * bvbatch - an implementation-specific container for batch information;
- * not used by client; forward declaration here
- */
-struct bvbatch;
-
-/*
- * bvinbuff - provides the buffer in bvbltparams
- */
-union bvinbuff {
- struct bvbuffdesc *desc; /* buffer description when
- associated BVFLAG_TILE_*
- is not set */
- struct bvtileparams *tileparams; /* tile params when associated
- BVFLAG_TILE_* flag is set */
-};
-
-/*
- * bvop - used to hold the operation in bvbltparams
- */
-union bvop {
- unsigned short rop; /* when BVFLAG_ROP set */
- enum bvblend blend; /* when BVFLAG_BLEND set */
- struct bvfilter *filter; /* when BVFLAG_FILTER set */
-};
-
-
-/*
- * bvbltparams - This structure is passed into bv_blt() to specify the
- * parameters for a BLT.
- */
-struct bvbltparams {
- unsigned int structsize; /* (i) used to ID structure version */
- char *errdesc; /* (o) 0-terminated ASCII string
- with extended error info (not
- for end users) */
-
- unsigned long implementation; /* (i) override manager choice */
-
- unsigned long flags; /* (i) see BVFLAG_* above */
-
- union bvop op; /* (i) operation; determined by
- BVFLAG_OP_MASK bits in flags */
-
- void *colorkey; /* (i) pointer to color key pixel
- matching non-SUBSAMPLE format
- of the keyed surface when
- BVFLAG_KEY_* is set */
-
- union bvalpha globalalpha; /* (i) global alpha when BVFLAG_BLEND
- set in flags and
- BVBLENDDEF_GLOBAL_* is set in
- blend; typed determined by
- BVBLENDDEF_GLOBAL_* */
-
- enum bvscalemode scalemode; /* (i/o) type of scaling */
- enum bvdithermode dithermode; /* (i/o) type of dither */
-
- struct bvbuffdesc *dstdesc; /* (i) dest after bv_map() */
- struct bvsurfgeom *dstgeom; /* (i) dest surf fmt and geometry */
- struct bvrect dstrect; /* (i) rect into which data written */
-
- union bvinbuff src1; /* (i) src1 buffer */
- struct bvsurfgeom *src1geom; /* (i) src1 surf fmt and geometry */
- struct bvrect src1rect; /* (i) rect from which data is read */
-
- union bvinbuff src2; /* (i) src2 buffer */
- struct bvsurfgeom *src2geom; /* (i) src2 surf fmt and geometry */
- struct bvrect src2rect; /* (i) rect from which data is read */
-
- union bvinbuff mask; /* (i) mask buffer */
- struct bvsurfgeom *maskgeom; /* (i) mask surf fmt and geometry */
- struct bvrect maskrect; /* (i) rect from which data is read */
-
- struct bvrect cliprect; /* (i) dest clipping rect when
- BVFLAG_CLIP flag set */
-
- unsigned long batchflags; /* (i) BVBATCH_* flags used to
- indicate params changed between
- batch BLTs */
- struct bvbatch *batch; /* (i/o) handle for associated batch;
- returned when
- BVFLAG_BATCH_BEGIN set;
- provided to subsequent BLTs
- with BVFLAG_BATCH_CONTINUE */
-
- void (*callbackfn)(struct bvcallbackerror *err,
- unsigned long callbackdata); /* (i) callback
- function when
- BVFLAG_ASYNC is set -
- err is 0 when no
- error; handle contains
- callbackdata below */
- unsigned long callbackdata; /* (i) callback data */
-
- struct bvrect src2auxdstrect;
- struct bvrect maskauxdstrect;
-};
-
-#endif /* BLTSVILLE_H */
diff --git a/bltsville/bltsville/include/bvblend.h b/bltsville/bltsville/include/bvblend.h
deleted file mode 100644
index f187d81..0000000
--- a/bltsville/bltsville/include/bvblend.h
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * bvblend.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-/*
- * This file defines the types of shared blends available.
- *
- * To extend the list of blends, create a file containing additional
- * enumerations to be added to enum bvblend below. Then #define
- * BVBLEND_EXTERNAL_INCLUDE as the name of that file before including
- * this file in your project.
- */
-
-#ifndef BVBLEND_H
-#define BVBLEND_H
-
-/*
- * bvblend - specifies the type of blending operation to perform; only valid
- * when BVFLAG_BLEND is set in the bvbltparams.flags field.
- */
-
-/*
- * The blendmode value is divided into two sections.
- *
- * [31:28] The most significant 4 bits indicate the blend format.
- *
- * [27:0] The remainder of the bits is defined by the format chosen.
- *
- * 3322222222221111111111
- * 10987654321098765432109876543210
- * [ ][ ]
- * | |
- * format defined by format
- */
-
-#define BVBLENDDEF_FORMAT_SHIFT 28
-#define BVBLENDDEF_FORMAT_MASK (0xF << BVBLENDDEF_FORMAT_SHIFT)
-
-#define BVBLENDDEF_FORMAT_CLASSIC (0x0 << BVBLENDDEF_FORMAT_SHIFT)
-#define BVBLENDDEF_FORMAT_ESSENTIAL (0x1 << BVBLENDDEF_FORMAT_SHIFT)
-
-/*
- * The BVBLENDDEF_FORMAT_CLASSIC is meant to handle the classic Porter-Duff
- * equations. It can also handle the DirectFB blending.
- * BVBLENDDEF_FORMAT_CLASSIC is based on the following equations:
- *
- * Cd = K1 x C1 + K2 x C2
- * Ad = K3 x A1 + K4 x A2
- *
- * where:
- * Cd: destination color
- * C1: source 1 color
- * C2: source 2 color
- * Ad: destination alpha
- * A1: source 1 alpha
- * A2: source 2 alpha
- * K#: one of the constants defined using the bitfields below.
- */
-
-/*
- * The 28 bits for BVBLENDDEF_FORMAT_CLASSIC are divided into 5 sections.
- *
- * The most significant 4 bits are modifiers, used to include additional
- * alpha values from global or remote sources.
- *
- * [27] The most significant bit indicates that a remote alpha is to be
- * included in the blend. The format of this is defined by
- * bvbltparams.maskgeom.format.
- *
- * [26] The next bit is reserved.
- *
- * [25:24] The next 2 bits are used to indicate that a global alpha is to be
- * included, and what its format is:
- * 00: no global included
- * 01: global included; bvbltparams.globalalpha.size8 is used (0 -> 255)
- * 10: this value is reserved
- * 11: global included; bvbltparams.flogalalpha.fp is used (0.0 -> 1.0)
- *
- * The remaining bits are divided into 4 sections, one to define each of the
- * constants:
- *
- * [23:18] - K1
- * [17:12] - K2
- * [11:6] - K3
- * [5:0] - K4
- *
- * The format is the same for all 4 constant fields:
- *
- * [5:4] The first 2 bits of each field indicates the way in which the other
- * 2 fields are interpreted:
- * 00: only As: the other two fields contain only As; there should be only
- * one valid A value between the two fields
- * 01: minimum: the value of the constant is the minimum of the two fields
- * 10: maximum: the value of the constant is the maximum of the two fields
- * 11: only Cs: the other two fields contain only Cs; there should be only
- * one valid C value between the two fields
- *
- * [3:2] The middle 2 bits of each field contain the inverse field:
- * 00: 1-C1 ("don't care" for "only As")
- * 01: 1-A1 ("don't care" for "only Cs")
- * 10: 1-C2 ("don't care" for "only As")
- * 11: 1-A2 ("don't care" for "only Cs")
- *
- * [1:0] The last 2 bits if each field contain the normal field:
- * 00: C1 ("don't care" for "only As")
- * 01: A1 ("don't care" for "only Cs")
- * 10: C2 ("don't care" for "only As")
- * 11: A2 ("don't care" for "only Cs")
- *
- * EXCEPTIONS:
- *
- * 00 00 00 - The value 00 00 00, which normally would indicate "only As"
- * with two "don't care" fields, is interpreted as a 0.
- *
- * 11 11 11 - The value 11 11 11, which normally would indicate "only Cs"
- * with two "don't care" fields, is interpreted as a 1.
- *
- * --------------------------------------------------------------------------
- *
- * Put together, these can define portions of the blend equations that can be
- * put together in a variety of ways:
- *
- * 00 00 00: undefined -> zero
- * 00 00 01: A1 (preferred)
- * 00 00 10: undefined
- * 00 00 11: A2 (preferred)
- * 00 01 00: 1-A1 (preferred)
- * 00 01 01: undefined
- * 00 01 10: 1-A1 (use 00 01 00)
- * 00 01 11: undefined
- * 00 10 00: undefined
- * 00 10 01: A1 (use 00 00 01)
- * 00 10 10: undefined
- * 00 10 11: A2 (use 00 00 11)
- * 00 11 00: 1-A2 (preferred)
- * 00 11 01: undefined
- * 00 11 10: 1-A2 (use 00 11 00)
- * 00 11 11: undefined
- *
- * 01 00 00: min(C1,1-C1)
- * 01 00 01: min(A1,1-C1)
- * 01 00 10: min(C2,1-C1)
- * 01 00 11: min(A2,1-C1)
- * 01 01 00: min(C1,1-A1)
- * 01 01 01: min(A1,1-A1)
- * 01 01 10: min(C2,1-A1)
- * 01 01 11: min(A2,1-A1)
- * 01 10 00: min(C1,1-C2)
- * 01 10 01: min(A1,1-C2)
- * 01 10 10: min(C2,1-C2)
- * 01 10 11: min(A2,1-C2)
- * 01 11 00: min(C1,1-A2)
- * 01 11 01: min(A1,1-A2)
- * 01 11 10: min(C2,1-A2)
- * 01 11 11: min(A2,1-A2)
- *
- * 10 00 00: max(C1,1-C1)
- * 10 00 01: max(A1,1-C1)
- * 10 00 10: max(C2,1-C1)
- * 10 00 11: max(A2,1-C1)
- * 10 01 00: max(C1,1-A1)
- * 10 01 01: max(A1,1-A1)
- * 10 01 10: max(C2,1-A1)
- * 10 01 11: max(A2,1-A1)
- * 10 10 00: max(C1,1-C2)
- * 10 10 01: max(A1,1-C2)
- * 10 10 10: max(C2,1-C2)
- * 10 10 11: max(A2,1-C2)
- * 10 11 00: max(C1,1-A2)
- * 10 11 01: max(A1,1-A2)
- * 10 11 10: max(C2,1-A2)
- * 10 11 11: max(A2,1-A2)
- *
- * 11 00 00: undefined
- * 11 00 01: 1-C1 (use 11 00 11)
- * 11 00 10: undefined
- * 11 00 11: 1-C1 (preferred)
- * 11 01 00: C1 (use 11 11 00)
- * 11 01 01: undefined
- * 11 01 10: C2 (use 11 11 10)
- * 11 01 11: undefined
- * 11 10 00: undefined
- * 11 10 01: 1-C2 (use 11 10 11)
- * 11 10 10: undefined
- * 11 10 11: 1-C2 (preferred)
- * 11 11 00: C1 (preferred)
- * 11 11 01: undefined
- * 11 11 10: C2 (preferred)
- * 11 11 11: undefined -> one
- *
- * ==========================================================================
- * DirectFB
- * ==========================================================================
- *
- * Putting these together into the proper constants, the blending equations
- * can be built for DirectFB as well:
- *
- * For DirectFB, the SetSrcBlendFunction() and SetDstBlendFunction() can
- * specify 121 combinations of blends (11 x 11). It's impractical to
- * specify these combinations individually. Instead, the settings indicated
- * by each call should be bitwise OR'd to make the proper single value used in
- * BLTsville.
- *
- * binary value <- SetSrcBlendFunction()
- * [--K1--] [--K2--] [--K3--] [--K4--]
- * 0000 0000 00 00 00 xx xx xx 00 00 00 xx xx xx <- DSBF_ZERO
- * 0000 0000 11 11 11 xx xx xx 11 11 11 xx xx xx <- DSBF_ONE
- * 0000 0000 11 11 00 xx xx xx 00 00 01 xx xx xx <- DSBF_SRCCOLOR
- * 0000 0000 11 00 11 xx xx xx 00 01 00 xx xx xx <- DSBF_INVSRCCOLOR
- * 0000 0000 00 00 01 xx xx xx 00 00 01 xx xx xx <- DSBF_SRCALPHA
- * 0000 0000 00 01 00 xx xx xx 00 01 00 xx xx xx <- DSBF_INVSRCALPHA
- * 0000 0000 11 11 10 xx xx xx 00 00 11 xx xx xx <- DSBF_DESTCOLOR
- * 0000 0000 11 10 11 xx xx xx 00 11 00 xx xx xx <- DSBF_INVDESTCOLOR
- * 0000 0000 00 00 11 xx xx xx 00 00 11 xx xx xx <- DSBF_DESTALPHA
- * 0000 0000 00 11 00 xx xx xx 00 11 00 xx xx xx <- DSBF_INVDESTALPHA
- * 0000 0000 01 11 01 xx xx xx 11 11 11 xx xx xx <- DSBF_SRCALPHASAT
- *
- * binary value <- SetDstBlendFunction()
- * [--K1--] [--K2--] [--K3--] [--K4--]
- * 0000 0000 xx xx xx 00 00 00 xx xx xx 00 00 00 <- DSBF_ZERO
- * 0000 0000 xx xx xx 11 11 11 xx xx xx 11 11 11 <- DSBF_ONE
- * 0000 0000 xx xx xx 11 11 00 xx xx xx 00 00 01 <- DSBF_SRCCOLOR
- * etc.
- *
- * ==========================================================================
- * Porter-Duff
- * ==========================================================================
- *
- * For Porter-Duff, the equations can be more specifically defined. For
- * convenience, these are enumerated below. These utilize the local alpha as
- * indicated. To use global or remote alpha, these enumerations need to be
- * modified. For example, to include the global alpha in the Porter-Duff
- * SRC1OVER blend, the blend could be defined like this:
- * params.op.blend = BVBLEND_SRC1OVER +
- * BVBLENDDEF_GLOBAL_UCHAR;
- *
- * To include the remote alpha, the blend could be defined like this:
- * params.op.blend = BVBLEND_SRC1OVER +
- * BVBLENDDEF_REMOTE;
- *
- * And to include both:
- * params.op.blend = BVBLEND_SRC1OVER +
- * BVBLENDDEF_GLOBAL_UCHAR +
- * BVBLENDDEF_REMOTE;
- *
- * Note that if the source color formats include local alphas, the local
- * alphas, global alpha, and remote alpha will be used together.
- *
- * Note also that the equations assume the surfaces are premultiplied. So
- * if the surface formats indicate that they are not premultiplied, the
- * alpha multiplication of each color is done prior to using the surface
- * values in the equations.
- *
- * For example, BVBLEND_SRC1OVER specifies the equations:
- * Cd = 1 x C1 + (1 - A1) x C2
- * Ad = 1 x A1 + (1 - A1) x A2
- *
- * If the format of surface 1 is non-premultiplied, the equations
- * are modified to include the multiplication explicitly:
- * Cd = 1 x A1 x C1 + (1 - A1) x C2
- * Ad = 1 x A1 + (1 - A1) x A2
- *
- * Likewise, if the format of surface 2 is non-premultiplied, the
- * equations are modified for this:
- * Cd = 1 x C1 + (1 - A1) x A2 x C2
- * Ad = 1 x A1 + (1 - A1) x A2
- *
- * When including global or remote alphas, these values are used to modify
- * the source 1 value values before being used in the blend equation:
- * C1 = Ag x C1
- * A1 = Ag x A1
- * -or-
- * C1 = Ar x C1
- * A1 = Ar x A1
- * -or-
- * C1 = Ag x Ar x C1
- * A1 = Ag x Ar x A1
- *
- */
-
-#define BVBLENDDEF_MODE_SHIFT 4
-#define BVBLENDDEF_INV_SHIFT 2
-#define BVBLENDDEF_NORM_SHIFT 0
-
-#define BVBLENDDEF_ONLY_A (0 << BVBLENDDEF_MODE_SHIFT)
-#define BVBLENDDEF_MIN (1 << BVBLENDDEF_MODE_SHIFT)
-#define BVBLENDDEF_MAX (2 << BVBLENDDEF_MODE_SHIFT)
-#define BVBLENDDEF_ONLY_C (3 << BVBLENDDEF_MODE_SHIFT)
-#define BVBLENDDEF_MODE_MASK (3 << BVBLENDDEF_MODE_SHIFT)
-
-#define BVBLENDDEF_NORM_C1 (0 << BVBLENDDEF_NORM_SHIFT)
-#define BVBLENDDEF_NORM_A1 (1 << BVBLENDDEF_NORM_SHIFT)
-#define BVBLENDDEF_NORM_C2 (2 << BVBLENDDEF_NORM_SHIFT)
-#define BVBLENDDEF_NORM_A2 (3 << BVBLENDDEF_NORM_SHIFT)
-#define BVBLENDDEF_NORM_MASK (3 << BVBLENDDEF_NORM_SHIFT)
-
-#define BVBLENDDEF_INV_C1 (0 << BVBLENDDEF_INV_SHIFT)
-#define BVBLENDDEF_INV_A1 (1 << BVBLENDDEF_INV_SHIFT)
-#define BVBLENDDEF_INV_C2 (2 << BVBLENDDEF_INV_SHIFT)
-#define BVBLENDDEF_INV_A2 (3 << BVBLENDDEF_INV_SHIFT)
-#define BVBLENDDEF_INV_MASK (3 << BVBLENDDEF_INV_SHIFT)
-
-#define BVBLENDDEF_ONLY_A_NORM_xx BVBLENDDEF_NORM_C1
-#define BVBLENDDEF_ONLY_A_INV_xx BVBLENDDEF_INV_C1
-#define BVBLENDDEF_ONLY_C_NORM_xx BVBLENDDEF_NORM_A2
-#define BVBLENDDEF_ONLY_C_INV_xx BVBLENDDEF_INV_A2
-
-#define BVBLENDDEF_ZERO \
- (BVBLENDDEF_ONLY_A | \
- BVBLENDDEF_ONLY_A_NORM_xx | \
- BVBLENDDEF_ONLY_A_INV_xx)
-#define BVBLENDDEF_C1 \
- (BVBLENDDEF_ONLY_C | \
- BVBLENDDEF_NORM_C1 | \
- BVBLENDDEF_ONLY_C_INV_xx)
-#define BVBLENDDEF_A1 \
- (BVBLENDDEF_ONLY_A | \
- BVBLENDDEF_NORM_A1 | \
- BVBLENDDEF_ONLY_A_INV_xx)
-#define BVBLENDDEF_C2 \
- (BVBLENDDEF_ONLY_C | \
- BVBLENDDEF_NORM_C2 | \
- BVBLENDDEF_ONLY_C_INV_xx)
-#define BVBLENDDEF_A2 \
- (BVBLENDDEF_ONLY_A | \
- BVBLENDDEF_NORM_A2 | \
- BVBLENDDEF_ONLY_A_INV_xx)
-#define BVBLENDDEF_ONE_MINUS_C1 \
- (BVBLENDDEF_ONLY_C | \
- BVBLENDDEF_ONLY_C_NORM_xx | \
- BVBLENDDEF_INV_C1)
-#define BVBLENDDEF_ONE_MINUS_A1 \
- (BVBLENDDEF_ONLY_A | \
- BVBLENDDEF_ONLY_A_NORM_xx | \
- BVBLENDDEF_INV_A1)
-#define BVBLENDDEF_ONE_MINUS_C2 \
- (BVBLENDDEF_ONLY_C | \
- BVBLENDDEF_ONLY_C_NORM_xx | \
- BVBLENDDEF_INV_C2)
-#define BVBLENDDEF_ONE_MINUS_A2 \
- (BVBLENDDEF_ONLY_A | \
- BVBLENDDEF_ONLY_A_NORM_xx | \
- BVBLENDDEF_INV_A2)
-#define BVBLENDDEF_ONE \
- (BVBLENDDEF_ONLY_C | \
- BVBLENDDEF_ONLY_C_NORM_xx | \
- BVBLENDDEF_ONLY_C_INV_xx)
-
-#define BVBLENDDEF_K_MASK \
- (BVBLENDDEF_MODE_MASK | \
- BVBLENDDEF_INV_MASK | \
- BVBLENDDEF_NORM_MASK)
-
-#define BVBLENDDEF_K1_SHIFT 18
-#define BVBLENDDEF_K2_SHIFT 12
-#define BVBLENDDEF_K3_SHIFT 6
-#define BVBLENDDEF_K4_SHIFT 0
-
-#define BVBLENDDEF_K1_MASK \
- (BVBLENDDEF_K_MASK << BVBLENDDEF_K1_SHIFT)
-#define BVBLENDDEF_K2_MASK \
- (BVBLENDDEF_K_MASK << BVBLENDDEF_K2_SHIFT)
-#define BVBLENDDEF_K3_MASK \
- (BVBLENDDEF_K_MASK << BVBLENDDEF_K3_SHIFT)
-#define BVBLENDDEF_K4_MASK \
- (BVBLENDDEF_K_MASK << BVBLENDDEF_K4_SHIFT)
-
-#define BVBLENDDEF_CLASSIC_EQUATION_MASK 0x00FFFFFF
-
-/*
- * The following definitions are be used to modify the enumerations.
- */
-#define BVBLENDDEF_REMOTE 0x08000000 /* mask surface provides alpha
- for source 1 */
-
-/* Bit 26 reserved */
-
-/* These enable global alpha and define the type of globalalpha */
-#define BVBLENDDEF_GLOBAL_SHIFT 24
-#define BVBLENDDEF_GLOBAL_MASK (3 << BVBLENDDEF_GLOBAL_SHIFT)
-
-#define BVBLENDDEF_GLOBAL_NONE (0 << BVBLENDDEF_GLOBAL_SHIFT)
-#define BVBLENDDEF_GLOBAL_UCHAR (1 << BVBLENDDEF_GLOBAL_SHIFT)
-/* 2 reserved */
-#define BVBLENDDEF_GLOBAL_FLOAT (3 << BVBLENDDEF_GLOBAL_SHIFT)
-
-union bvalpha {
- unsigned char size8; /* btwn 0 (0.0) and 255 (1.0) */
- float fp; /* btwn 0.0 and 1.0 */
-};
-
-
-enum bvblend {
- /* Porter-Duff blending equations */
- BVBLEND_CLEAR = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC1 = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC2 = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC1OVER = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC2OVER = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC1IN = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_A2 << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_A2 << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC2IN = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_A1 << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_A1 << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC1OUT = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC2OUT = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ZERO << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC1ATOP = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_A2 << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_A2 << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K4_SHIFT),
- BVBLEND_SRC2ATOP = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_A1 << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_A1 << BVBLENDDEF_K4_SHIFT),
- BVBLEND_XOR = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A2 << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE_MINUS_A1 << BVBLENDDEF_K4_SHIFT),
- BVBLEND_PLUS = BVBLENDDEF_FORMAT_CLASSIC |
- (BVBLENDDEF_ONE << BVBLENDDEF_K1_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K2_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K3_SHIFT) |
- (BVBLENDDEF_ONE << BVBLENDDEF_K4_SHIFT),
-
-/*
- * For FORMAT_ESSENTIAL, the variety of well-known blending functions from
- * popular image manipulation programs are specified.
- */
-
- BVBLEND_NORMAL = BVBLENDDEF_FORMAT_ESSENTIAL + 0,
- BVBLEND_LIGHTEN = BVBLENDDEF_FORMAT_ESSENTIAL + 1,
- BVBLEND_DARKEN = BVBLENDDEF_FORMAT_ESSENTIAL + 2,
- BVBLEND_MULTIPLY = BVBLENDDEF_FORMAT_ESSENTIAL + 3,
- BVBLEND_AVERAGE = BVBLENDDEF_FORMAT_ESSENTIAL + 4,
- BVBLEND_ADD = BVBLENDDEF_FORMAT_ESSENTIAL + 5,
- BVBLEND_LINEAR_DODGE = BVBLEND_ADD,
- BVBLEND_SUBTRACT = BVBLENDDEF_FORMAT_ESSENTIAL + 6,
- BVBLEND_LINEAR_BURN = BVBLEND_SUBTRACT,
- BVBLEND_DIFFERENCE = BVBLENDDEF_FORMAT_ESSENTIAL + 7,
- BVBLEND_NEGATE = BVBLENDDEF_FORMAT_ESSENTIAL + 8,
- BVBLEND_SCREEN = BVBLENDDEF_FORMAT_ESSENTIAL + 9,
- BVBLEND_EXCLUSION = BVBLENDDEF_FORMAT_ESSENTIAL + 10,
- BVBLEND_OVERLAY = BVBLENDDEF_FORMAT_ESSENTIAL + 11,
- BVBLEND_SOFT_LIGHT = BVBLENDDEF_FORMAT_ESSENTIAL + 12,
- BVBLEND_HARD_LIGHT = BVBLENDDEF_FORMAT_ESSENTIAL + 13,
- BVBLEND_COLOR_DODGE = BVBLENDDEF_FORMAT_ESSENTIAL + 14,
- BVBLEND_COLOR_BURN = BVBLENDDEF_FORMAT_ESSENTIAL + 15,
- BVBLEND_LINEAR_LIGHT = BVBLENDDEF_FORMAT_ESSENTIAL + 16,
- BVBLEND_VIVID_LIGHT = BVBLENDDEF_FORMAT_ESSENTIAL + 17,
- BVBLEND_PIN_LIGHT = BVBLENDDEF_FORMAT_ESSENTIAL + 18,
- BVBLEND_HARD_MIX = BVBLENDDEF_FORMAT_ESSENTIAL + 19,
- BVBLEND_REFLECT = BVBLENDDEF_FORMAT_ESSENTIAL + 20,
- BVBLEND_GLOW = BVBLENDDEF_FORMAT_ESSENTIAL + 21,
- BVBLEND_PHOENIX = BVBLENDDEF_FORMAT_ESSENTIAL + 22,
-
-#ifdef BVBLEND_EXTERNAL_INCLUDE
-#define BVBLEND_EXTERNAL_INCLUDE
-#endif
-};
-
-#endif /* BVBLEND_H */
diff --git a/bltsville/bltsville/include/bvbuffdesc.h b/bltsville/bltsville/include/bvbuffdesc.h
deleted file mode 100644
index 98934bc..0000000
--- a/bltsville/bltsville/include/bvbuffdesc.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * bvbuffdesc.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef BVBUFFDESC_H
-#define BVBUFFDESC_H
-
-/*
- * bvbuffmap - This is a private structure used by BLTsville
- * implementations to manage resources associated with a buffer. A pointer
- * to this is returned from bv_map() and used in subsequent bv_blt() and
- * bv_unmap() calls.
- */
-struct bvbuffmap;
-
-#define BVATDEF_VENDOR_SHIFT 24
-#define BVATDEF_VENDOR_MASK (0xFF << BVATDEF_VENDOR_SHIFT)
-
-/* Common aux type */
-#define BVATDEF_VENDOR_ALL (0x00 << BVATDEF_VENDOR_SHIFT)
-
-/* Texas Instruments, Inc. */
-#define BVATDEF_VENDOR_TI (0x01 << BVATDEF_VENDOR_SHIFT)
-
-enum bvauxtype {
- BVAT_NONE = 0, /* auxptr not used */
- BVAT_reserved1 = /* reserved */
- BVATDEF_VENDOR_ALL + 1,
- BVAT_reserved2 = /* reserved */
- BVATDEF_VENDOR_ALL + 2,
-#ifdef BVAT_EXTERNAL_INCLUDE
-#include BVAT_EXTERNAL_INCLUDE
-#endif
-};
-
-/*
- * bvbuffdesc - This structure is used to specify the buffer parameters
- * in a call to bv_map().
- */
-struct bvbuffdesc {
- unsigned int structsize; /* used to identify struct version */
- void *virtaddr; /* virtual ptr to start of buffer */
- unsigned long length; /* length of the buffer in bytes */
- struct bvbuffmap *map; /* resource(s) associated w/buffer */
- enum bvauxtype auxtype; /* type of auxptr */
- void *auxptr; /* additional buffer description data;
- type depends on auxtype */
-};
-
-#endif /* BVBUFFDESC_H */
diff --git a/bltsville/bltsville/include/bvcache.h b/bltsville/bltsville/include/bvcache.h
deleted file mode 100644
index d9a3f6d..0000000
--- a/bltsville/bltsville/include/bvcache.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * bvcache.h
- *
- * Copyright (C) 2012 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef BVCACHE_H_
-#define BVCACHE_H_
-
-/* Forward declarations */
-struct bvbuffdesc;
-struct bvsurfgeom;
-struct bvrect;
-
-/*
- * This defines which cache operation the user intends to use
- * BVCACHE_CPU_TO_DEVICE = clean
- * BVCACHE_CPU_FROM_DEVICE = invalidate
- * BVCACHE_BIDIRECTIONAL = flush
- */
-enum bvcacheop {
- BVCACHE_BIDIRECTIONAL = 0,
- BVCACHE_CPU_TO_DEVICE = 1,
- BVCACHE_CPU_FROM_DEVICE = 2,
- BVCACHE_RESERVED3 = 3,
-};
-
-struct bvcopparams {
- unsigned int structsize; /* used to identify struct version */
- struct bvbuffdesc *desc;
- struct bvsurfgeom *geom;
- struct bvrect *rect;
- enum bvcacheop cacheop;
-};
-
-#endif /* BVCACHE_H_ */
diff --git a/bltsville/bltsville/include/bventry.h b/bltsville/bltsville/include/bventry.h
deleted file mode 100644
index 0ccfc05..0000000
--- a/bltsville/bltsville/include/bventry.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * bventry.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef BVENTRY_H
-#define BVENTRY_H
-
-/* Forward declarations */
-struct bvbuffdesc;
-struct bvbltparams;
-struct bvcopparams;
-/*
- * bv_*() - These are the API calls for BLTsville. The client needs to
- * import these from the shared library.
- */
-typedef enum bverror (*BVFN_MAP)(struct bvbuffdesc *buffdesc);
-typedef enum bverror (*BVFN_BLT)(struct bvbltparams *bltparms);
-typedef enum bverror (*BVFN_UNMAP)(struct bvbuffdesc *buffdesc);
-typedef enum bverror (*BVFN_CACHE)(struct bvcopparams *copparams);
-
-#endif /* BVENTRY_H */
diff --git a/bltsville/bltsville/include/bverror.h b/bltsville/bltsville/include/bverror.h
deleted file mode 100644
index 15c3ba7..0000000
--- a/bltsville/bltsville/include/bverror.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * bverror.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef BVERROR_H
-#define BVERROR_H
-
-/*
- * bverror - These are error codes returned by BLTsville functions.
- */
-#define BVERRDEF_VENDOR_SHIFT 24
-#define BVERRDEF_VENDOR_MASK (0xFF << BVERRDEF_VENDOR_SHIFT)
-
-#define BVERRDEF_VENDOR_ALL (0x00 << BVERRDEF_VENDOR_SHIFT)
-#define BVERRDEF_VENDOR_TI (0x01 << BVERRDEF_VENDOR_SHIFT)
-/* 0xF0-0xFF reserved */
-
-enum bverror {
- BVERR_NONE = 0, /* no error */
-
- BVERR_UNK = /* unknown error */
- BVERRDEF_VENDOR_ALL + 1,
- BVERR_OOM = /* memory allocation failure */
- BVERRDEF_VENDOR_ALL + 2,
- BVERR_RSRC = /* required resource unavailable */
- BVERRDEF_VENDOR_ALL + 3,
-
- BVERR_VIRTADDR = /* virtaddr is bad */
- BVERRDEF_VENDOR_ALL + 1000,
- BVERR_VIRTPTR =
- BVERR_VIRTADDR, /* for backwards compatibility*/
-
- BVERR_BUFFERDESC = /* invalid bvbufferdesc */
- BVERRDEF_VENDOR_ALL + 10000,
- BVERR_BUFFERDESC_VERS = /* bvbufferdesc.structsize too small */
- BVERRDEF_VENDOR_ALL + 11000,
- BVERR_BUFFERDESC_VIRTADDR = /* bad bvbufferdesc.virtaddr */
- BVERRDEF_VENDOR_ALL + 12000,
- BVERR_BUFFERDESC_LEN = /* bvbufferdesc.length not supported */
- BVERRDEF_VENDOR_ALL + 13000,
- BVERR_BUFFERDESC_ALIGNMENT = /* unsupported buffer base address */
- BVERRDEF_VENDOR_ALL + 14000,
-
- BVERR_BLTPARAMS_VERS = /* bvbltparams.structsize too small */
- BVERRDEF_VENDOR_ALL + 20000,
- BVERR_IMPLEMENTATION = /* bvbltparams.implementation unsupported */
- BVERRDEF_VENDOR_ALL + 21000,
- BVERR_FLAGS = /* bvbltparams.flags unsupported */
- BVERRDEF_VENDOR_ALL + 22000,
- BVERR_OP = /* unsupported operation */
- BVERRDEF_VENDOR_ALL + 22100,
- BVERR_KEY = /* type of color key not supported */
- BVERRDEF_VENDOR_ALL + 22200,
- BVERR_SRC1_TILE = /* src1 tiling not supported */
- BVERRDEF_VENDOR_ALL + 22300,
- BVERR_SRC2_TILE = /* src2 tiling not supported */
- BVERRDEF_VENDOR_ALL + 22310,
- BVERR_MASK_TILE = /* mask tiling not supported */
- BVERRDEF_VENDOR_ALL + 22320,
- BVERR_FLIP = /* flipping not supported */
- BVERRDEF_VENDOR_ALL + 22400,
- BVERR_ROP = /* ROP code not supported */
- BVERRDEF_VENDOR_ALL + 23000,
- BVERR_BLEND = /* blend not supported */
- BVERRDEF_VENDOR_ALL + 23100,
- BVERR_GLOBAL_ALPHA = /* type of global alpha not supported */
- BVERRDEF_VENDOR_ALL + 23110,
- BVERR_FILTER = /* filter type not supported */
- BVERRDEF_VENDOR_ALL + 23200,
- BVERR_FILTER_PARAMS_VERS = /* filter parameter structsize too small */
- BVERRDEF_VENDOR_ALL + 23210,
- BVERR_FILTER_PARAMS = /* filter parameters not supported */
- BVERRDEF_VENDOR_ALL + 23220,
- BVERR_SCALE_MODE = /* bvbltparams.scalemode not supported */
- BVERRDEF_VENDOR_ALL + 24000,
- BVERR_DITHER_MODE = /* bvbltparams.dithermode not supported */
- BVERRDEF_VENDOR_ALL + 25000,
-
- BVERR_DSTDESC = /* invalid bvbltparams.dstdesc */
- BVERRDEF_VENDOR_ALL + 26000,
- BVERR_DSTDESC_VERS = /* bvbufferdesc.structsize too small */
- BVERRDEF_VENDOR_ALL + 26100,
- BVERR_DSTDESC_VIRTADDR = /* bad bvbufferdesc.virtaddr */
- BVERRDEF_VENDOR_ALL + 26200,
- BVERR_DSTDESC_LEN = /* bvbufferdesc.length not supported */
- BVERRDEF_VENDOR_ALL + 26300,
- BVERR_DST_ALIGNMENT = /* unsupported buffer base address */
- BVERRDEF_VENDOR_ALL + 26400,
-
- BVERR_DSTGEOM = /* invalid bvbltparams.dstgeom */
- BVERRDEF_VENDOR_ALL + 27000,
- BVERR_DSTGEOM_VERS = /* dstgeom.structsize too small */
- BVERRDEF_VENDOR_ALL + 27100,
- BVERR_DSTGEOM_FORMAT = /* bltparams.dstgeom.format not supported */
- BVERRDEF_VENDOR_ALL + 27200,
- BVERR_DSTGEOM_STRIDE = /* bltparams.dstgeom.stride not supported */
- BVERRDEF_VENDOR_ALL + 27300,
- BVERR_DSTGEOM_PALETTE = /* dstgeom.paletteformat not supported */
- BVERRDEF_VENDOR_ALL + 27400,
-
-
- BVERR_DSTRECT = /* bvbltparams.dstrect not supported */
- BVERRDEF_VENDOR_ALL + 28000,
-
- BVERR_SRC1DESC = /* invalid bvbltparams.src1.desc */
- BVERRDEF_VENDOR_ALL + 29000,
- BVERR_SRC1DESC_VERS = /* bvbufferdesc.structsize too small */
- BVERRDEF_VENDOR_ALL + 29100,
- BVERR_SRC1DESC_VIRTADDR = /* bad bvbufferdesc.virtaddr */
- BVERRDEF_VENDOR_ALL + 29200,
- BVERR_SRC1DESC_LEN = /* bvbufferdesc.length not supported */
- BVERRDEF_VENDOR_ALL + 29300,
- BVERR_SRC1DESC_ALIGNMENT = /* unsupported buffer base address */
- BVERRDEF_VENDOR_ALL + 29400,
-
- BVERR_SRC1GEOM = /* invalid bvbltparams.src1geom */
- BVERRDEF_VENDOR_ALL + 30000,
- BVERR_SRC1GEOM_VERS = /* src1geom.structsize too small */
- BVERRDEF_VENDOR_ALL + 30100,
- BVERR_SRC1GEOM_FORMAT = /* bltparams.src1geom.format not supported */
- BVERRDEF_VENDOR_ALL + 30200,
- BVERR_SRC1GEOM_STRIDE = /* bltparams.src1geom.stride not supported */
- BVERRDEF_VENDOR_ALL + 30300,
- BVERR_SRC1GEOM_PALETTE = /* src1geom.paletteformat not supported */
- BVERRDEF_VENDOR_ALL + 30400,
-
- BVERR_SRC1RECT = /* bvbltparams.src1rect not supported */
- BVERRDEF_VENDOR_ALL + 31000,
-
- BVERR_SRC1_HORZSCALE = /* horz scale for src1->dst not supported */
- BVERRDEF_VENDOR_ALL + 31100,
- BVERR_SRC1_VERTSCALE = /* vert scale for src1->dst not supported */
- BVERRDEF_VENDOR_ALL + 31200,
- BVERR_SRC1_ROT = /* src1->dst rotation angle not supported */
- BVERRDEF_VENDOR_ALL + 31300,
-
- BVERR_SRC1_TILEPARAMS = /* invalid src1.tileparams */
- BVERR_SRC1DESC,
- BVERR_SRC1_TILE_VERS = /* src1.tileparams.structsize too small */
- BVERRDEF_VENDOR_ALL + 32000,
- BVERR_SRC1_TILEPARAMS_VERS =
- BVERR_SRC1_TILE_VERS,
- BVERR_SRC1_TILE_FLAGS = /* tileparams.flags not supported */
- BVERRDEF_VENDOR_ALL + 32100,
- BVERR_SRC1_TILEPARAMS_FLAGS =
- BVERR_SRC1_TILE_FLAGS,
- BVERR_SRC1_TILE_VIRTADDR =
- BVERR_SRC1DESC_VIRTADDR,
- BVERR_SRC1_TILEPARAMS_VIRTADDR =
- BVERR_SRC1_TILE_VIRTADDR,
- BVERR_SRC1_TILE_ORIGIN = /* tileparams.left or .top not supported */
- BVERRDEF_VENDOR_ALL + 32200,
- BVERR_SRC1_TILEPARAMS_ORIGIN =
- BVERR_SRC1_TILE_ORIGIN,
- BVERR_SRC1_TILE_SIZE = /* tileparams.width or .height not supported */
- BVERRDEF_VENDOR_ALL + 32300,
- BVERR_SRC1_TILEPARAMS_SIZE =
- BVERR_SRC1_TILE_SIZE,
-
- BVERR_SRC2DESC = /* invalid bvbltparams.src2.desc */
- BVERRDEF_VENDOR_ALL + 33000,
- BVERR_SRC2DESC_VERS = /* bvbufferdesc.structsize too small */
- BVERRDEF_VENDOR_ALL + 33100,
- BVERR_SRC2DESC_VIRTADDR = /* bad bvbufferdesc.virtaddr */
- BVERRDEF_VENDOR_ALL + 33200,
- BVERR_SRC2DESC_LEN = /* bvbufferdesc.length not supported */
- BVERRDEF_VENDOR_ALL + 33300,
- BVERR_SRC2DESC_ALIGNMENT = /* unsupported buffer base address */
- BVERRDEF_VENDOR_ALL + 33400,
-
- BVERR_SRC2GEOM = /* invalid bvbltparams.src2geom */
- BVERRDEF_VENDOR_ALL + 34000,
- BVERR_SRC2GEOM_VERS = /* src2geom.structsize too small */
- BVERRDEF_VENDOR_ALL + 34100,
- BVERR_SRC2GEOM_FORMAT = /* bltparams.src2geom.format not supported */
- BVERRDEF_VENDOR_ALL + 34200,
- BVERR_SRC2GEOM_STRIDE = /* bltparams.src2geom.stride not supported */
- BVERRDEF_VENDOR_ALL + 34300,
- BVERR_SRC2GEOM_PALETTE = /* src2geom.paletteformat not supported */
- BVERRDEF_VENDOR_ALL + 34400,
-
- BVERR_SRC2RECT = /* bvbltparams.src2rect not supported */
- BVERRDEF_VENDOR_ALL + 35000,
-
- BVERR_SRC2_HORZSCALE = /* horz scale for src2->dst not supported */
- BVERRDEF_VENDOR_ALL + 35100,
- BVERR_SRC2_VERTSCALE = /* vert scale for src2->dst not supported */
- BVERRDEF_VENDOR_ALL + 35200,
- BVERR_SRC2_ROT = /* src2->dst rotation angle not supported */
- BVERRDEF_VENDOR_ALL + 35300,
-
- BVERR_SRC2_TILEPARAMS = /* invalid src2.tileparams */
- BVERR_SRC2DESC,
- BVERR_SRC2_TILE_VERS = /* src2.tileparams.structsize too small */
- BVERRDEF_VENDOR_ALL + 36000,
- BVERR_SRC2_TILEPARAMS_VERS =
- BVERR_SRC2_TILE_VERS,
- BVERR_SRC2_TILE_FLAGS = /* tileparams.flags not supported */
- BVERRDEF_VENDOR_ALL + 36100,
- BVERR_SRC2_TILEPARAMS_FLAGS =
- BVERR_SRC2_TILE_FLAGS,
- BVERR_SRC2_TILE_VIRTADDR =
- BVERR_SRC2DESC_VIRTADDR,
- BVERR_SRC2_TILEPARAMS_VIRTADDR =
- BVERR_SRC2_TILE_VIRTADDR,
- BVERR_SRC2_TILE_ORIGIN = /* tileparams.left or .top not supported */
- BVERRDEF_VENDOR_ALL + 36200,
- BVERR_SRC2_TILEPARAMS_ORIGIN =
- BVERR_SRC2_TILE_ORIGIN,
- BVERR_SRC2_TILE_SIZE = /* tileparams.width or .height not supported */
- BVERRDEF_VENDOR_ALL + 36300,
- BVERR_SRC2_TILEPARAMS_SIZE =
- BVERR_SRC2_TILE_SIZE,
-
- BVERR_MASKDESC = /* invalid bvbltparams.mask.desc */
- BVERRDEF_VENDOR_ALL + 37000,
- BVERR_MASKDESC_VERS = /* bvbufferdesc.structsize too small */
- BVERRDEF_VENDOR_ALL + 37100,
- BVERR_MASKDESC_VIRTADDR = /* bad bvbufferdesc.virtaddr */
- BVERRDEF_VENDOR_ALL + 37200,
- BVERR_MASKDESC_LEN = /* bvbufferdesc.length not supported */
- BVERRDEF_VENDOR_ALL + 37300,
- BVERR_MASKDESC_ALIGNMENT = /* unsupported buffer base address */
- BVERRDEF_VENDOR_ALL + 37400,
-
- BVERR_MASKGEOM = /* invalid bvbltparams.maskgeom */
- BVERRDEF_VENDOR_ALL + 38000,
- BVERR_MASKGEOM_VERS = /* maskgeom.structsize too small */
- BVERRDEF_VENDOR_ALL + 38100,
- BVERR_MASKGEOM_FORMAT = /* bltparams.maskgeom.format not supported */
- BVERRDEF_VENDOR_ALL + 38200,
- BVERR_MASKGEOM_STRIDE = /* bltparams.maskgeom.stride not supported */
- BVERRDEF_VENDOR_ALL + 38300,
- BVERR_MASKGEOM_PALETTE = /* maskgeom.paletteformat not supported */
- BVERRDEF_VENDOR_ALL + 38400,
-
- BVERR_MASKRECT = /* bvbltparams.maskrect not supported */
- BVERRDEF_VENDOR_ALL + 39000,
-
- BVERR_MASK_HORZSCALE = /* horz scale for mask->dst not supported */
- BVERRDEF_VENDOR_ALL + 39100,
- BVERR_MASK_VERTSCALE = /* vert scale for mask->dst not supported */
- BVERRDEF_VENDOR_ALL + 39200,
- BVERR_MASK_ROT = /* mask->dst rotation angle not supported */
- BVERRDEF_VENDOR_ALL + 39300,
-
- BVERR_MASK_TILEPARAMS = /* invalid mask.tileparams */
- BVERR_MASKDESC,
- BVERR_MASK_TILE_VERS = /* mask.tileparams.structsize too small */
- BVERRDEF_VENDOR_ALL + 40000,
- BVERR_MASK_TILEPARAMS_VERS =
- BVERR_MASK_TILE_VERS,
- BVERR_MASK_TILE_FLAGS = /* tileparams.flags not supported */
- BVERRDEF_VENDOR_ALL + 40100,
- BVERR_MASK_TILEPARAMS_FLAGS =
- BVERR_MASK_TILE_FLAGS,
- BVERR_MASK_TILE_VIRTADDR =
- BVERR_MASKDESC_VIRTADDR,
- BVERR_MASK_TILEPARAMS_VIRTADDR =
- BVERR_MASK_TILE_VIRTADDR,
- BVERR_MASK_TILE_ORIGIN = /* tileparams.left or .top not supported */
- BVERRDEF_VENDOR_ALL + 40200,
- BVERR_MASK_TILEPARAMS_ORIGIN =
- BVERR_MASK_TILE_ORIGIN,
- BVERR_MASK_TILE_SIZE = /* tileparams.width or .height not supported */
- BVERRDEF_VENDOR_ALL + 40300,
- BVERR_MASK_TILEPARAMS_SIZE =
- BVERR_MASK_TILE_SIZE,
-
- BVERR_CLIP_RECT = /* bvbltparams.cliprect not supported */
- BVERRDEF_VENDOR_ALL + 41000,
-
- BVERR_BATCH_FLAGS = /* bvbltparams.batchflags not supported */
- BVERRDEF_VENDOR_ALL + 42000,
- BVERR_BATCH = /* bvbltparams.batch not valid */
- BVERRDEF_VENDOR_ALL + 43000,
-
- BVERR_OP_FAILED = /* async operation failed to start */
- BVERRDEF_VENDOR_ALL + 50000,
- BVERR_OP_INCOMPLETE = /* async operation failed mid-way */
- BVERRDEF_VENDOR_ALL + 50001,
- BVERR_MEMORY_ERROR = /* async operation triggered memory error */
- BVERRDEF_VENDOR_ALL + 51000,
-
- BVERR_FORMAT = /* unsupported format */
- BVERRDEF_VENDOR_ALL + 52000,
-
- BVERR_CACHEOP = /* unsupported cache operation */
- BVERRDEF_VENDOR_ALL + 60000,
-
-#ifdef BVERR_EXTERNAL_INCLUDE
-#include BVERR_EXTERNAL_INCLUDE
-#endif
-};
-
-#endif /* BVERROR_H */
diff --git a/bltsville/bltsville/include/bvfilter.h b/bltsville/bltsville/include/bvfilter.h
deleted file mode 100644
index 2c98d94..0000000
--- a/bltsville/bltsville/include/bvfilter.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * bvfilter.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-/*
- * This file defines the types of shared filters available and the associated
- * parameters.
- *
- * To extend the list of filters, create a file containing additional
- * enumerations to be added to enum bvfilter below. Then #define
- * BVFILTER_EXTERNAL_INCLUDE as the name of that file before including
- * this file in your project. Parameters need to be in a different file.
- */
-
-#ifndef BVFILTER_H
-#define BVFILTER_H
-
-/*
- * bvfilter is an enumeration used to designate the type of filter being used.
- */
-enum bvfiltertype {
- BVFILTER_DUMMY
- /* TBD */
-
-#ifdef BVFILTER_EXTERNAL_INCLUDE
-#include BVFILTER_EXTERNAL_INCLUDE
-#endif
-};
-
-/*
- * bvfilterop contains the filter type and a pointer to the associated
- * parameters when the BVFLAG_FILTER operation is specified in
- * bvbltparams.flags.
- */
-struct bvfilter {
- enum bvfiltertype filter;
- void *params;
-};
-
-#endif /* BVFILTER_H */
diff --git a/bltsville/bltsville/include/bvinternal.h b/bltsville/bltsville/include/bvinternal.h
deleted file mode 100644
index 06e1bed..0000000
--- a/bltsville/bltsville/include/bvinternal.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * bvinternal.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-/*
- * This file contains definitions used by implementations of BLTsville
- * 2-D libraries. It should not be used by clients.
- */
-
-#ifndef BVINTERNAL_H
-#define BVINTENRAL_H
-
-/*
- * bvbuffmap - The bvbuffmap structure is used to track resources
- * associated with a buffer, such as a h/w MMU entry. The implementations
- * add bvbuffmap objects when they allocate the resources. Then when a
- * buffer is accessed, the implementations can regain access to the
- * associated resources. The implementations allocate and populate this
- * structure when a bv_map() call is made. It is used in subsequent
- * bv_blt() and bv_unmap() calls. The latter frees the associated resource
- * and the structure (if applicable). Note that a given resource might be
- * used by more than one implementation.
- */
-struct bvbuffmap {
- unsigned int structsize; /* used to ID structure ver */
-
- /* function to unmap this resource */
- BVFN_UNMAP bv_unmap;
-
- unsigned long handle; /* resource-specific info */
-
- /* pointer to next resource mapping structure */
- struct bvbuffmap *nextmap;
-};
-
-#endif /* BVINTERNAL_H */
diff --git a/bltsville/bltsville/include/bvsurfgeom.h b/bltsville/bltsville/include/bvsurfgeom.h
deleted file mode 100644
index 70029fc..0000000
--- a/bltsville/bltsville/include/bvsurfgeom.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * bvsurfgeom.h
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file is part of BLTsville, an open application programming interface
- * (API) for accessing 2-D software or hardware implementations.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef BVSURFGEOM_H
-#define BVSURFGEOM_H
-
-/*
- * bvsurfdesc - This structure specifies the way a buffer should be used in a
- * 2-D context.
- */
-
-struct bvsurfgeom {
- unsigned int structsize; /* used to identify struct version */
- enum ocdformat format; /* color format of surface */
- unsigned int width; /* width of the surface in pixels */
- unsigned int height; /* height of the surface in lines */
- int orientation; /* angle of the surface in degrees
- (multiple of 90 only) */
- long virtstride; /* distance from one pixel to the
- pixel immediately below it in
- virtual space */
- enum ocdformat paletteformat; /* format of palette */
- void *palette; /* array of palette entries of
- paletteformat; only valid when
- format includes BVFMTDEF_LUT;
- number of entries is 2^bpp. */
-};
-
-#endif /* BVSURFGEOM_H */
diff --git a/bltsville/bltsville/index.html b/bltsville/bltsville/index.html
deleted file mode 100644
index 4b3a96c..0000000
--- a/bltsville/bltsville/index.html
+++ /dev/null
@@ -1,4362 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
-
-<head>
-<meta http-equiv="Content-Language" content="en-us" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Welcome to BLTsville</title>
-<style type="text/css">
-.cmd_line {
- background: #000;
- color: #fff;
- padding: 10px;
-}
-.inline_code {
- font-family: "Courier New", Courier, monospace;
- font-size: small;
-}
-.code_block {
- margin-left: 40px;
- font-family: "Courier New", Courier, monospace;
- font-size: small;
-}
-.small_code_block_in_table {
- font-family: "Courier New", Courier, monospace;
- font-size: x-small;
-}
-.small_code_block {
- font-family: "Courier New", Courier, monospace;
- font-size: x-small;
- margin-left: 40px;
-}
-.underline_code {
- font-family: "Courier New", Courier, monospace;
- font-size: small;
- text-decoration: underline;
-}
-.Code_Header {
- font-size: xx-large;
- font-weight: bold;
- text-align: left;
- font-family: "Courier New", Courier, monospace;
-}
-.Code_Header_2 {
- font-size: x-large;
- font-weight: bold;
- text-align: left;
- font-family: "Courier New", Courier, monospace;
-}
-.Code_Header_3 {
- font-size: large;
- font-weight: bold;
- text-align: left;
- font-family: "Courier New", Courier, monospace;
-}
-.imponly {
- border: thin solid #666666;
- margin-left: 40px;
- background-color: #E5E5E5;
- font-family: Arial, Helvetica, sans-serif;
- color: #333333;
-}
-.Header1 {
- margin: 0px 0 0 0;
- font-size: xx-large;
- font-weight: bold;
- text-align: left;
- line-height: normal;
- background-color: #E0E0E0;
-}
-.Header2 {
- font-size: xx-large;
- font-weight: bold;
- margin: 0px;
- line-height: 100%;
-}
-.Header3 {
- font-size: x-large;
- font-weight: bold;
- margin: 0px;
- line-height: 100%;
-}
-.Header4 {
- font-size: large;
- font-weight: bold;
- margin: 0px;
- line-height: 100%;
-}
-.strong_emphasis {
- text-decoration: underline;
- font-weight: bold;
-}
-.filename {
- font-family: Arial, Helvetica, sans-serif;
- font-size: small;
-}
-.underline {
- text-decoration: underline;
-}
-.grn_left {
- text-align: left;
- color: #009900;
-}
-.left_topbord {
- text-align: left;
- border-top-style: solid;
- border-top-width: 1px;
-}
-.center_topbord {
- text-align: center;
- border-top-style: solid;
- border-top-width: 1px;
-}
-.blue_left_botbord {
- text-align: left;
- border-bottom-style: solid;
- border-bottom-width: 1px;
- color: #0000FF;
-}
-.blue_center_botbord {
- text-align: center;
- border-bottom-style: solid;
- border-bottom-width: 1px;
- color: #0000FF;
-}
-.red_center {
- text-align: center;
- color: #FF0000;
-}
-.red_left {
- text-align: left;
- color: #FF0000;
-}
-.grn_center {
- text-align: center;
- color: #009900;
-}
-.red_center_topbord {
- text-align: center;
- border-top-style: solid;
- border-top-width: 1px;
- color: #FF0000;
-}
-.blu_center_topbord {
- text-align: center;
- border-top-style: solid;
- border-top-width: 1px;
- color: #0000FF;
-}
-.indent_thick_bord {
- border-color: #000000;
- border-style: solid;
- margin-left: 40px;
-}
-.thin_bord {
- border-style: solid;
- border-width: 1px;
-}
-.thin_bord_dbl_botbord {
- border-left-style: solid;
- border-left-width: 1px;
- border-right-style: solid;
- border-right-width: 1px;
- border-top-style: solid;
- border-top-width: 1px;
- border-bottom-style: double;
- border-bottom-width: 3px;
-}
-.dl_link {
- float: right;
-}
-.note {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- margin-left: 40px;
-}
-.small_note {
- font-size: xx-small;
- line-height: 100%;
-}
-.ctr {
- text-align: center;
-}
-.glyph_cache {
- font-family: "Courier New", Courier, monospace;
- font-size: medium;
- font-weight: normal;
- font-style: normal;
- margin-left: 40px;
- background-color: #000000;
- color: #FFFFFF;
-}
-.example {
- border-style: solid;
- border-width: 1px;
- margin-left: 40px;
- margin-right: 40px;
-}
-.rt_thick_bord {
- border-right-style: solid;
- border-right-color: #000000;
-}
-.indent {
- margin-left: 40px;
-}
-.ctr_thin_bord {
- border-style: solid;
- border-width: 1px;
- text-align: center;
-}
-.indent_thin_bord {
- border-style: solid;
- border-width: 1px;
- margin-left: 40px;
-}
-.bold_sans {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
-}
-.nowrap {
- border-style: solid;
- border-width: 1px;
- white-space: nowrap;
- font-size: small;
-}
-</style>
-</head>
-
-<body>
-
-<table style="width: 100%; line-height: 100%;">
- <tr>
- <td style="width: 484px">
- <table>
- <tr>
- <td>
- <div style="background-position: center; background-image: url('bvlogo.png'); width: 484px; height: 400px; background-repeat: no-repeat;">
- <div style="position: relative; left: 0; top: 0;">
- <a href="http://graphics.github.com/ocd">
- <img src="ocdtab.png" alt="Now With OCD" style="border-width: 0; position: absolute; top: 0; right: 0;" /></a>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <td class="ctr"><span class="Header2">Version 2.2</span></td>
- </tr>
- </table>
- </td>
- <td>
- <p>BLTsville is the open 2-D API designed to provide an abstract interface for both hardware and software 2-D implementations.</p>
- <p>BLTs (BLock Transfers) involve the moving around of blocks (rectangles) of pixels.&nbsp; BLTsville is the place
- to go for BLTs.</p>
- <hr />
- <table style="width: 100%">
- <tr>
- <td>
- <div class="dl_link">
- <img alt="CC BY-ND" longdesc="Creative Commons Attribution-NoDerivs 3.0 Unported License" src="http://i.creativecommons.org/l/by-nd/3.0/88x31.png" width="88" height="31" /></div>
- <p class="Header2">License</p>
- </td>
- </tr>
- <tr>
- <td>
- <div>
- <p class="small_note">The API is designed and maintained by Texas Instruments, Inc., but anyone is free
- to use it with no cost or obligation.</p>
- <p>This project is licensed under the <a href="http://creativecommons.org/licenses/by-nd/3.0/">Creative
- Commons Attribution-NoDerivs 3.0 Unported License</a> (user mode), and the
- <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2</a> (kernel
- mode).</p>
- </div>
- </td>
- </tr>
- </table>
- <hr />
- <table style="width: 100%">
- <tr>
- <td>
- <p class="Header2">Dependencies</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>This project is dependent on the <a href="http://graphics.github.com/ocd">Open Color format Defintions
- (OCD) project</a>.</p>
- </td>
- </tr>
- </table>
- <hr />
- <table style="width: 100%">
- <tr>
- <td>
- <p class="Header2">Source</p>
- </td>
- </tr>
- <tr>
- <td>
- <div class="dl_link">
- <a href="http://github.com/graphics/bltsville/zipball/master">
- <img width="90" alt="download zip" src="http://github.com/images/modules/download/zip.png" /></a>
- <a href="http://github.com/graphics/bltsville/tarball/master">
- <img width="90" alt="download tar" src="http://github.com/images/modules/download/tar.png" /></a>
- </div>
- <div>
- Get the source code (headers) from GitHub at <a href="http://github.com/graphics/bltsville">github.com/graphics/bltsville</a>,
- or download the project in <a href="http://github.com/graphics/bltsville/zipball/master">zip</a> or
- <a href="http://github.com/graphics/bltsville/tarball/master">tar</a> format.</div>
- <p>You can also clone the project with <a href="http://git-scm.com">Git</a> by running:</p>
- <pre><a class="cmd_line">$ git clone git://github.com/graphics/bltsville</a></pre>
- </td>
- </tr>
- <tr>
- <td><hr />
- <table style="width: 100%">
- <tr>
- <td class="Header2">Wiki</td>
- </tr>
- <tr>
- <td><a href="https://github.com/graphics/bltsville/wiki">https://github.com/graphics/bltsville/wiki</a></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-<hr />
-<p class="Header1">Points of Interest in BLTsville</p>
-<table style="width: 100%">
- <tr>
- <td style="width: 50%" valign="top">
- <ul>
- <li>Solid fills</li>
- <li>Pattern fills</li>
- <li>Copies</li>
- <li>Color format conversion<ul>
- <li>Extensive color format support<ul>
- <li>RGB, BGR</li>
- <li>RGBA, ARGB, etc.</li>
- <li>YCbCr (YUV)<ul>
- <li>subsampling</li>
- <li>packed</li>
- <li>planar</li>
- </ul>
- </li>
- <li>Monochrome</li>
- <li>Alpha-only</li>
- <li>Look-Up Table (LUT)</li>
- </ul>
- </li>
- <li>Extensible color format</li>
- </ul>
- </li>
- <li>ROP4<ul>
- <li>Three inputs</li>
- </ul>
- </li>
- <li>Blends<ul>
- <li>Pre-defined Porter-Duff blends</li>
- <li>Pre-defined DirectFB support</li>
- <li>Extensible blends</li>
- </ul>
- </li>
- <li>Multiple </li>
- <li>Filters<ul>
- <li>Extensible filters</li>
- </ul>
- </li>
- <li>Independent horizontal and vertical <strong>flipping</strong></li>
- <li>Independent <strong>scaling</strong> of all three inputs</li>
- <li>Clipping</li>
- <li>Independent <strong>rotation</strong> of all three inputs (multiples of 90 degrees)</li>
- </ul>
- </td>
- <td style="width: 50%" valign="top">
- <ul>
- <li>Choice of <strong>scaling</strong> type<ul>
- <li>Quality based choice</li>
- <li>Speed based choice</li>
- <li>Image type based choice</li>
- <li>Specific scale type choice</li>
- <li>Extensible scale type</li>
- </ul>
- </li>
- <li>Synchronous operations</li>
- <li>Asynchronous operations<ul>
- <li>Client notification of BLT completion</li>
- </ul>
- </li>
- <li>Batching<ul>
- <li>Combine multiple BLTs into group that can be handled more efficiently by implementations<ul>
- <li>Character BLTs</li>
- <li>Multi-layer blending</li>
- <li>ROP/Blend combination with specified ordering</li>
- <li>etc.</li>
- </ul>
- </li>
- <li>Delta BLTs</li>
- </ul>
- </li>
- <li>Dithering<ul>
- <li>Quality based choice</li>
- <li>Speed based choice</li>
- <li>Image type based choice</li>
- <li>Specific dither type choice</li>
- <li>Extensible dither type</li>
- </ul>
- </li>
- <li>Any implementation support<ul>
- <li>CPU</li>
- <li>2-D Accelerator</li>
- </ul>
- </li>
- </ul>
- </td>
- </tr>
-</table>
-<hr />
-<ul>
- <li>BLTsville does not dictate capabilities of the implementations<ul>
- <li>Operations specified either work or return an error indicating that the operation is not supported</li>
- </ul>
- </li>
-</ul>
-<hr />
-<p class="Header1">How to Get to BLTsville</p>
-<p>BLTsville&#39;s API is defined in the BLTsville header files.&nbsp; A client must include <span class="inline_code">bltsville.h</span>
-to access the implementations.&nbsp; This header includes the remaining headers (including <span class="inline_code">ocd.h</span>).</p>
-<p class="note">NOTE:&nbsp; The <span class="underline_code">bvinternal.h</span><span class="underline"> header is for implementations
-only</span> and should not be used by clients.</p>
-<p>BLTsville has both user mode and a kernel mode interaces.&nbsp; The kernel mode interface is quite similar to (and compatible
-with) the user mode, but due to the minor differences and license issues, there are two different sets of header files.</p>
-<hr />
-<p class="Header1">History of BLTsville</p>
-<br />
-<p class="Header4">Versions 1.x</p>
-<p>BLTsville was based on a previous closed interface, which had a few implementations and shipped on a few devices.&nbsp;
-That interface represented the 1.x versions.&nbsp; A lot was learned from that work, and these lessons were used in the
-founding of BLTsville.</p>
-<p class="Header4">Version 2.0</p>
-<p>This was the initial release of the user mode interface.&nbsp; This version is not compatible with the 1.x versions.&nbsp;
-Several minor updates were posted, but the API itself did not change, so no changes to the client or implementation were
-required.</p>
-<p class="Header4">Version 2.1</p>
-<p>This is a minor update to the API, and it adds the kernel mode interface.&nbsp; Some additions to the API have been made.&nbsp;
-Details of the changes are below with their compatibility matrices.</p>
-<ul>
- <li><span class="inline_code"><a href="#bv_cache">bv_cache()</a></span> was added to allow manipulation of the CPU cache.&nbsp;
- This is an optional interface meant for hardware implementations.</li>
-</ul>
-<table class="indent_thin_bord">
- <tr>
- <td class="thin_bord">&nbsp;</td>
- <td class="ctr_thin_bord"><strong>2.0 Client</strong></td>
- <td class="ctr_thin_bord"><strong>2.0 Client</strong><br />
- (w/2.1 Headers)</td>
- <td class="ctr_thin_bord"><strong>2.1 Client</strong></td>
- </tr>
- <tr>
- <td class="thin_bord"><strong>2.0 Implementation</strong></td>
- <td class="ctr_thin_bord">compatible</td>
- <td class="ctr_thin_bord">New function and structure definitions have no effect.</td>
- <td class="ctr_thin_bord">Client must deal with lack of <span class="inline_code"><a href="#bv_cache">bv_cache()</a></span>.</td>
- </tr>
- <tr>
- <td class="thin_bord"><strong>2.0 Implementation</strong><br />
- (w/2.1 Headers)</td>
- <td class="ctr_thin_bord">New function and structure definitions have no effect.</td>
- <td class="ctr_thin_bord">New function and structure definitions have no effect.</td>
- <td class="ctr_thin_bord">Client must deal with lack of <span class="inline_code"><a href="#bv_cache">bv_cache()</a></span>.</td>
- </tr>
- <tr>
- <td class="thin_bord"><strong>2.1 Implementation</strong></td>
- <td class="ctr_thin_bord">New function and structures have no effect.</td>
- <td class="ctr_thin_bord">New function and structures have no effect.</td>
- <td class="ctr_thin_bord">compatible</td>
- </tr>
-</table>
-<ul>
- <li><span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> was extended with the
- <span class="inline_code"><a href="#bvbuffdesc.auxtype">auxtype</a></span> and <span class="inline_code">
- <a href="#bvbuffdesc.auxptr">auxptr</a></span> members to allow buffer descriptions beyond a virtual address.&nbsp;
- Note that only the kernel mode interface currently includes a standard <span class="inline_code">auxtype</span>, but
- user mode interface <span class="inline_code">auxtype</span>s may be added later.&nbsp; Both interfaces provide a mechanism
- for individual vendors to add their own <span class="inline_code">auxtype</span>, using the same vendor ID mechanism
- as the rest of BLTsville.</li>
-</ul>
-<table class="indent_thin_bord">
- <tr>
- <td class="thin_bord">&nbsp;</td>
- <td class="ctr_thin_bord"><strong>2.0 Client</strong></td>
- <td class="ctr_thin_bord"><strong>2.0 Client</strong><br />
- (w/2.1 Headers)</td>
- <td class="ctr_thin_bord"><strong>2.1 Client</strong></td>
- </tr>
- <tr>
- <td class="thin_bord"><strong>2.0 Implementation</strong></td>
- <td class="ctr_thin_bord">compatible</td>
- <td class="ctr_thin_bord">Client must clear <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
- using <span class="inline_code"><span style="white-space: nowrap">sizeof(<a href="#bvbuffdesc">bvbuffdesc</a>)</span></span>.</td>
- <td class="ctr_thin_bord">Implementation must handle <span class="inline_code">
- <a href="#bvbuffdesc.structsize">bvbuffdesc.structsize</a> &gt; <span style="white-space: nowrap">sizeof(<a href="#bvbuffdesc">bvbuffdesc</a>)</span></span>.</td>
- </tr>
- <tr>
- <td class="thin_bord"><strong>2.0 Implementation</strong><br />
- (w/2.1 Headers)</td>
- <td class="ctr_thin_bord">Implementation must handle <span class="inline_code">
- <a href="#bvbuffdesc.structsize">bvbuffdesc.structsize</a> &lt; <span style="white-space: nowrap">sizeof(<a href="#bvbuffdesc">bvbuffdesc</a>)</span></span>.</td>
- <td class="ctr_thin_bord">Client must clear <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
- using <span class="inline_code"><span style="white-space: nowrap">sizeof(<a href="#bvbuffdesc">bvbuffdesc</a>)</span></span>.</td>
- <td class="ctr_thin_bord">Client must deal with implementation that uses <span class="inline_code">
- <a href="#bvbuffdesc.virtaddr">bvbuffdesc.virtaddr</a></span> or returns error if <span class="inline_code">
- <a href="#bvbuffdesc.virtaddr">bvbuffdesc.virtaddr</a></span> is 0.</td>
- </tr>
- <tr>
- <td class="thin_bord"><strong>2.1 Implementation</strong></td>
- <td class="ctr_thin_bord">Implementation must handle <span class="inline_code">
- <a href="#bvbuffdesc.structsize">bvbuffdesc.structsize</a> &lt; <span style="white-space: nowrap">sizeof(<a href="#bvbuffdesc">bvbuffdesc</a>)</span></span>.</td>
- <td class="ctr_thin_bord">Client must clear <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
- using <span class="inline_code"><span style="white-space: nowrap">sizeof(<a href="#bvbuffdesc">bvbuffdesc</a>)</span></span>.</td>
- <td class="ctr_thin_bord">compatible</td>
- </tr>
-</table>
-<ul>
- <li>Added documentation of <a href="#NOP">NOP BLT</a> used as synchronization mechanism for <a href="#BVFLAG_ASYNC">
- asynchronous BLTs</a>.<ul>
- <li>Clients that do not use <a href="#BVFLAG_ASYNC">asynchronous BLTs</a> or the <a href="#NOP">NOP BLT</a> will
- not be affected.</li>
- <li>Implementations that do not support the NOP BLT will return an error.&nbsp; This will not cause a problem
- for clients when using implementations which are actually synchronous.&nbsp; For clients using asynchronous
- implementations, an alternate supported but innocuous BLT will be necessary (e.g. copying a pixel to itself).</li>
- </ul>
- </li>
-</ul>
-<p class="Header4">Version 2.2</p>
-<p>This is a minor update which includes the following:</p>
-<ul>
- <li>Addition of the <span class="inline_code"><a href="#src2auxdstrect">src2auxdstrect</a></span> and
- <span class="inline_code"><a href="#maskauxdstrect">maskauxdstrect</a></span> members to <span class="inline_code">
- <a href="#bvbltparams">bvbltparams</a></span> with example.</li>
- <li>Addition of <span class="inline_code"><a href="#BVFLAG_SRC2_AUXDSTRECT">BVFLAG_SRC2_AUXDSTRECT</a></span> and <span class="inline_code">
- <a href="#BVFLAG_MASK_AUXDSTRECT">BVFLAG_MASK_AUXDSTRECT</a></span> flags.</li>
- <li>Added <span class="inline_code"><a href="#BVAT_PHYSADDR">BVAT_PHYSADDR</a></span> to the kernel mode
- <span class="inline_code"><a href="#bvbuffdesc.auxtype">bvbuffdesc.auxtype</a></span> enumerations.</li>
- <li>Added clarification to the <span class="inline_code"><a href="#bvphysdesc">bvphysdesc</a></span> documentation.</li>
-</ul>
-<p>Compatibility</p>
-<ul>
- <li>Clients that do not use the <span class="inline_code"><a href="#BVFLAG_SRC1_AUXDSTRECT">BVFLAG_*_AUXDSTRECT</a></span>
- flags will not be affected.</li>
- <li>Clients using the new (long) <span class="inline_code"><a href="#bvbltparams">bvbltparams</a></span> will work with
- older implementations.&nbsp; If the clients set the <span class="inline_code"><a href="#BVFLAG_SRC2_AUXDSTRECT">
- BVFLAG_*_AUXDSTRECT</a></span> flags, the implementations will return <span class="inline_code">BVERR_FLAGS</span>,
- indicating the lack of support for this feature.</li>
- <li>Implementations supporting the new <span class="inline_code"><a href="#bvbltparams">bvbltparams</a></span> will
- accept the older (smaller) version, distinguished by the <span class="inline_code">
- <a href="#bvbltparams.structsize">structsize</a></span> member.&nbsp; Clients using the older versions will not set
- the <span class="inline_code"><a href="#BVFLAG_SRC2_AUXDSTRECT">BVFLAG_*_AUXDSTRECT</a></span> flags, so the new
- members will not be utilized.</li>
- <li>Clients using <span class="inline_code"><a href="#BVAT_PHYSADDR">BVAT_PHYSADDR</a></span> will get an error from
- implementations that do not support this enumeration.&nbsp; The <span class="inline_code"><a href="#BVAT_PHYSDESC">
- BVAT_PHYSDESC</a></span> may be used if supported by the implementation, but care must be taken to ensure the buffer
- is defined properly.&nbsp; See <span class="inline_code"><a href="#bvphysdesc">bvphysdesc</a></span> for details.</li>
-</ul>
-<hr />
-<p class="Header1">BLTsville Neighborhoods</p>
-<p>Implementations may be software (CPU) or 2-D hardware, and many may coexist.&nbsp; Each implementation will have an individual
-entry point, so it can be directly addressed.&nbsp; But there will also be a more general interface for each of these two
-types of implementations so that system integrators can choose the most appropriate implementation.&nbsp; In other words,
-the system integrator will choose one software and one 2-D hardware implementation to be the &quot;default&quot; used when a client
-does not need to choose a specific implementation.</p>
-<p class="Header2">User Mode Interface</p>
-<p>Clients use the standard names below to access the default implementations.&nbsp; The client then imports the pointers
-to the functions.&nbsp; (The specific name decoration and import method will be dictated by the host Operating System (O/S).)&nbsp;
-Some examples:</p>
-<ul>
- <li>CPU:&nbsp; <span class="filename">bltsville_cpu</span><ul>
- <li>Linux/Android:&nbsp; <span class="filename">libbltsville_cpu.so</span></li>
- <li>Windows:&nbsp; <span class="filename">bltsville_cpu.dll</span></li>
- <li>etc.</li>
- </ul>
- </li>
- <li>2-D hardware:&nbsp; <span class="filename">bltsville_hw2d</span><ul>
- <li>Linux/Android:&nbsp; <span class="filename">libbltsville_hw2d.so</span></li>
- <li>Windows:&nbsp; <span class="filename">bltsville_hw2d.dll</span></li>
- <li>etc.</li>
- </ul>
- </li>
-</ul>
-<p>Usually these entry points will be symbolic links (either explicit in systems like Linux which support them, or implicit
-using a thin wrapper) to the specific implementation.&nbsp; This allows system integrators to connect the client with the
-most capable implementation available in the system.&nbsp; For example, <span class="filename">bltsville_hw2d</span> might
-be a symbolic link to <span class="filename">bltsville_gc2d</span>.</p>
-<p>In addition, there may be more implementations co-existing in a given system.&nbsp; These will have additional unique
-names as determined by the vendors.&nbsp; For example:</p>
-<ul>
- <li>Reference CPU software implementation:&nbsp; <span class="filename">bltsville_refcpu</span></li>
- <li>System DMA 2-D hardware implementation:&nbsp; <span class="filename">bltsville_mydma</span></li>
-</ul>
-<p class="Header3">Initialization</p>
-<p>In general, each O/S has the ability to manually load a library.&nbsp; This in turn causes a function in the library
-to be called so the library can perform initialization.&nbsp; Unfortunately, not all O/Ss allow this initialization
-function to return an error if the initialization fails.&nbsp; Equally unfortunately, it may be necessary for the
-initialization to be performed in that function.&nbsp; To accommodate this, BLTsville defers the specific initialization
-to the O/S environment.</p>
-<p class="Header4">Linux/Android</p>
-<p>The client will call <span class="inline_code">dlopen()</span> to open the library.&nbsp; It will then import the
-<span class="inline_code">bv_*()</span> functions, and call them as desired.&nbsp; Initialization will occur in
-association with one or more of these activities.&nbsp; If the initialization fails, the bv_*() functions will return
-the <span class="inline_code">BVERR_RSRC</span> error, indicating that a required resource was not obtained.</p>
-<p class="imponly"><strong>Implementations Only<br />
-</strong><br />
-If the library has designated a function with the <span class="inline_code">__attribute__ ((constructor))</span>, that
-function will be called.&nbsp; Linux implementations may use this function to perform initialization (including opening
-an interface to an associated kernel module).&nbsp; However, since this function cannot return an error, and thus cannot
-fail, if the initialization fails, this must be recorded.&nbsp; Then, when the client calls any of the
-<span class="inline_code">bv_*()</span> functions, these should immediately return the <span class="inline_code">
-BVERR_RSRC</span> error, indicating that the library was unable to initialize (obtain a necessary resource).<br />
-<br />
-Linux implementations may also choose to initialize on the first call to a <span class="inline_code">bv_*()</span>
-function.&nbsp; Failure is likewise indicated by returning the <span class="inline_code">BVERR_RSRC</span> error.<br />
-<br />
-<strong>NOTE:&nbsp; Be careful not to repeatedly attempt initialization when a failure is encountered.&nbsp; Some
-initializations, and especially initialization failures, can take a long time.&nbsp; This means clients trying to call
-</strong><span class="inline_code"><strong>bv_*()</strong></span><strong> functions (presumably before falling back to
-alternatives) will be repeatedly penalized if the library can&#39;t initialize.&nbsp; Instead, attempt initialization
-once, and from them on return <span class="inline_code">BVERR_RSRC</span>.</strong></p>
-<p class="Header2">Kernel Mode Interface</p>
-<p>For most kernel space BLTsville clients, only a 2-D hardware implementation will be used.&nbsp; However, both types of
-implementations are supported.&nbsp; Clients use the standard names below to access the default implementations and obtain
-pointers to the functions.&nbsp; (The specific method of obtaining the interface will be dictated by the host Operating
-System (O/S).)&nbsp; Some examples:</p>
-<ul>
- <li>CPU<ul>
- <li>Linux/Android <span class="inline_code">bvcpu_entry()</span></li>
- <li>etc.</li>
- </ul>
- </li>
- <li>2-D hardware<ul>
- <li>Linux/Android <span class="inline_code">bv2d_entry()</span></li>
- <li>etc.</li>
- </ul>
- </li>
-</ul>
-<p>These entry points may represent the implementations themselves, but more likely they will link the client to the implementations
-using more specific names.&nbsp; For example, <span class="inline_code">bv2d_entry()</span> may link the client to
-<span class="inline_code">gcbv_entry()</span>.</p>
-<p>In addition, there may be more implementations co-existing in the kernel.&nbsp; These will require additional unique
-names as determined by the vendors.&nbsp; For example:</p>
-<ul>
- <li>Reference CPU software implementation:&nbsp; <span class="inline_code">cpurefbv_entry()</span></li>
- <li>Vivante GC320 2-D hardware implementation:&nbsp; <span class="inline_code">gcbv_entry()</span></li>
-</ul>
-<hr />
-<p class="Header1">Things To Do In BLTsville</p>
-<p>BLTsville&#39;s interface consists of three or four functions per implementation, which must be imported by the
-client at run time:</p>
-<ul>
- <li><span class="inline_code"><a href="#bv_map">bv_map()</a></span></li>
- <li><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></li>
- <li><span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span></li>
- <li><span class="inline_code"><a href="#bv_cache">bv_cache()</a></span> (optional)</li>
-</ul>
-<p class="note">NOTE:&nbsp; If the library failed to initialize, these functions will return <span class="inline_code">
-BVERR_RSRC</span>, indicating that a required resource was not obtained.</p>
-<a name="bv_map" class="Code_Header">bv_map()</a>
-<p class="code_block">enum bverror bv_map(<a href="#bvbuffdesc">struct bvbuffdesc* buffdesc</a>);</p>
-<p><span class="strong_emphasis">BLTsville does not allocate buffers.</span>&nbsp;&nbsp; Clients must describe a buffer
-in BLTsville using the <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> structure so a given implementation
-can access the buffer.</p>
-<p><span class="inline_code">bv_map()</span> is used to provide the implementation an opportunity to associate hardware
-resources with the specified buffer.&nbsp; Most hardware requires this type of mapping, and there is usually appreciable
-overhead associated with it.&nbsp; By providing a separate call for this operation, BLTsville allows the client to move
-this overhead to the most appropriate time in its execution.</p>
-<p>For a given buffer, the client can call the <span class="inline_code">bv_map()</span> function imported from each implementation
-to establish the mapping immediately.&nbsp; But this is not required.</p>
-<p>As a special bonus, BLTsville clients can call to any implementation&#39;s <span class="inline_code">bv_map()</span>.&nbsp;
-This is sufficient to indicate that the client can be trusted to make the corresponding call to
-<span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span> upon destruction of the buffer.&nbsp; Then when a client
-calls an implementation&#39;s <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span>, if the mapping needs to be done,
-it&#39;s done at that time.&nbsp; But the mapping is maintained, so that the overhead is avoided on subsequent
-<span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> calls.&nbsp; This lets implementations use <em>lazy mapping</em>
-only as necessary.&nbsp; If an implementation is not called, the mapping is not done.</p>
-<p><em>Normally, the lowest overhead </em><span class="inline_code"><em>bv_map()</em></span><em> call will be in the CPU-based
-implementation.&nbsp; So most clients will want to make a single, low overhead </em><span class="inline_code"><em>bv_map()</em></span><em>
-call to the bltsville_cpu implementation to avoid the mapping/unmapping overhead on each </em><span class="inline_code">
-<a href="#bv_blt"><em>bv_blt()</em></a></span><em> call, while avoiding the mapping overhead when possible.</em></p>
-<p><em><strong>Calling </strong></em><span class="inline_code"><em><strong>bv_map()</strong></em></span><em><strong> is
-actually optional prior to calling </strong></em><span class="inline_code"><a href="#bv_blt"><em><strong>bv_blt()</strong></em></a></span><em><strong>.&nbsp;
-However, if it is not called at least once for a given buffer, it must be assumed that </strong></em>
-<span class="inline_code"><a href="#bv_unmap"><strong><em>bv_unmap()</em></strong></a></span><em><strong> will not be called.&nbsp;
-So the mapping must be done when </strong></em><span class="inline_code"><a href="#bv_blt"><em><strong>bv_blt()</strong></em></a></span><em><strong>
-is called, and unmapping done when it is complete.&nbsp; This means the overhead will be incurred for every </strong>
-</em><a href="#bv_blt" class="inline_code"><em><strong>bv_blt()</strong></em></a><em><strong> call which uses that buffer.</strong></em></p>
-<p class="note">NOTE: Obviously any API cannot add capabilities beyond an implementation&#39;s capabilities.&nbsp; So, for example,
-if an implementation requires memory to be allocated from a special pool of memory, that responsibility falls upon the client.&nbsp;
-The <span class="inline_code">bv_map()</span> function for that implementation will need to check the characteristics of
-the memory and return an error if it does not meet the necessary criteria.</p>
-<p class="Header4"><a name="bv_map_Function_Sequences">Function Sequences</a></p>
-<p>To clarify, here are some function sequences and the operations associated with them:</p>
-<table class="indent">
- <tr>
- <td class="ctr_thin_bord"><strong>Implementation</strong></td>
- <td class="ctr_thin_bord"><strong>Function</strong></td>
- <td class="ctr_thin_bord"><strong>Operation</strong></td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">map A<br />
- BLT A<br />
- unmap A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">map A<br />
- BLT A<br />
- unmap A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">B</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">map B<br />
- BLT B<br />
- unmap B</td>
- </tr>
-</table>
-<br />
-<table class="indent">
- <tr>
- <td class="ctr_thin_bord"><strong>Implementation</strong></td>
- <td class="ctr_thin_bord"><strong>Function</strong></td>
- <td class="ctr_thin_bord"><strong>Operation</strong></td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_map">bv_map()</a></span></td>
- <td class="thin_bord">map A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">BLT A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">BLT A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span></td>
- <td class="thin_bord">unmap A</td>
- </tr>
-</table>
-<br />
-<table class="indent">
- <tr>
- <td class="ctr_thin_bord"><strong>Implementation</strong></td>
- <td class="ctr_thin_bord"><strong>Function</strong></td>
- <td class="ctr_thin_bord"><strong>Operation</strong></td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_map">bv_map()</a></span></td>
- <td class="thin_bord">map A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">B</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_map">bv_map()</a></span></td>
- <td class="thin_bord">map B</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">BLT A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">B</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">BLT B</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span></td>
- <td class="thin_bord">unmap A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">B</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span></td>
- <td class="thin_bord">unmap B</td>
- </tr>
-</table>
-<br />
-<table class="indent">
- <tr>
- <td class="ctr_thin_bord"><strong>Implementation</strong></td>
- <td class="ctr_thin_bord"><strong>Function</strong></td>
- <td class="ctr_thin_bord"><strong>Operation</strong></td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_map">bv_map()</a></span></td>
- <td class="thin_bord">map A</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">B</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">map B<br />
- BLT B</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">B</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_blt">bv_blt()</a></span></td>
- <td class="thin_bord">BLT B</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">A</td>
- <td class="thin_bord"><span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span></td>
- <td class="thin_bord">unmap A<br />
- unmap B</td>
- </tr>
-</table>
-<br />
-<div class="note">
- NOTE:&nbsp; Calling <span class="inline_code">bv_map()</span> and <span class="inline_code"><a href="#bv_unmap">
- bv_unmap()</a></span> with the same <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> from
- different, unsynchronized threads, even (especially) from different implementations, will result in undefined
- behavior.&nbsp; This is similar to calling <span class="inline_code">malloc()</span> and <span class="inline_code">
- free()</span> using the same buffer pointer in different, unsynchronized threads.&nbsp; While this may work
- sometimes and for some implementations and combinations of implementations, BLTsville does not provide any
- synchronization mechanism to make this safe.&nbsp; Clients must ensure that these calls are synchronized in cases
- where such behavior appears to be necessary.</div>
-<br />
-<a name="bv_blt" class="Code_Header">bv_blt()</a>
-<p class="code_block">enum bverror bv_blt(<a href="#bvbltparams">struct bvbltparams* bltparams</a>);</p>
-<p>The main function of BLTsville is <span class="inline_code">bv_blt()</span>.&nbsp; A <span class="inline_code">
-<a href="#bvbltparams">bvbltparams</a></span> structure is passed into <span class="inline_code">bv_blt()</span> to trigger
-the desired 2-D operation.</p>
-<a name="bv_unmap" class="Code_Header">bv_unmap()</a>
-<p class="code_block">enum bverror bv_unmap(<a href="#bvbuffdesc">struct bvbuffdesc* buffdesc</a>);</p>
-<p><span class="inline_code">bv_unmap()</span> is used to free implementation resources associated with a buffer.&nbsp;
-Normally, if <span class="inline_code"><a href="#bv_map">bv_map()</a></span> was called for a given buffer,
-<span class="inline_code">bv_unmap()</span> should be called as well.</p>
-<p>For convenience, only one <span class="inline_code">bv_unmap()</span> needs to be called for each buffer, regardless
-of how many implementations were used, including multiple calls to <span class="inline_code"><a href="#bv_map">bv_map()</a></span>.</p>
-<p>Also for convenience, <span class="inline_code">bv_unmap()</span> may be called multiple times on the same buffer.&nbsp;
-Note that only the first call will actually free (all) the associated resources.&nbsp; See the
-<a href="#bv_map_Function_Sequences">Function Sequences</a> under <span class="inline_code"><a href="#bv_map">bv_map()</a></span>
-for more details.</p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Implementations must ensure that unmapping of buffers which are in use by asynchronous BLTs are appropriately delayed to
-avoid improper access.</p>
-<a name="bv_cache" class="Code_Header">bv_cache()</a>
-<p class="code_block">enum bverror bv_cache(<a href="#bvcopprams">struct bvcopparams *copparams</a>);</p>
-<p><span class="inline_code">bv_cache()</span> provides manual CPU cache control to maintain cache coherence of surfaces
-between the CPU and other hardware.&nbsp; The <a href="#bvbuffdesc">bvcopparams</a> structure provides the information needed
-to properly manipulate the CPU cache.</p>
-<p>This function is <em>optional</em>.&nbsp; If this function fails to import, it means the implementation does not provide
-it, but <span class="inline_code"><a href="#bv_map">bv_map()</a></span>,&nbsp; <span class="inline_code">
-<a href="#bv_blt">bv_blt()</a></span>, and <span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span> may still
-be used.</p>
-<p><em>In general, this function will be provided with BLTsville implementations which utilize 2-D hardware, even though
-it manipulates the CPU cache.&nbsp; This is because most systems require a kernel module to manipulate the cache, and this
-is not always practical to include with a user-mode CPU implementation.</em></p>
-<p><strong>BEWARE:&nbsp; Manipulation of the CPU cache is tricky.&nbsp; Moreover, different CPUs behave differently, so
-cache manipulation that works on one device may fail on another.&nbsp; Also, mismanaged operation of the cache can have
-significant impact on overall system performance.&nbsp; And incorrect manipulation of the cache can cause instability or
-crashes.&nbsp; Please read and understand all of the discussions below before using this function.</strong></p>
-<ol>
- <li>To avoid system instability, do not perform cache operations on buffers which would not be accessed by BLTsville.</li>
- <li>For maximum performance, combine adjacent rectangles into one <span class="inline_code">bv_cache()</span> call.&nbsp;
- For example, when BLTing a line of characters, do not issue a <span class="inline_code">bv_cache()</span> call for each
- character.&nbsp; Instead, make one call to bv_cache() which includes all the characters.</li>
- <li>When using a hardware BLTsville implementation to read data written into a cached surface by the CPU, use the
- <span class="inline_code"><a href="#CPU_TO_DEVICE">BVCACHE_CPU_TO_DEVICE</a></span> operation after the CPU has completed
- its operation and before the hardware BLTsville operation is initiated.</li>
- <li>When using a hardware BLTsville implementation to write data into a cached surface that will be read by the CPU,
- use the <span class="inline_code"><a href="#CPU_FROM_DEVICE">BVCACHE_CPU_FROM_DEVICE</a></span> operation after the
- hardware BLTsville operation has completed (note this means after the callback if the BLT is asynchronous) and before
- the CPU accesses the surface.</li>
- <li>When using a hardware BLTsville implementation to write data into a cached surface that has been written by the
- CPU, using the <span class="inline_code"><a href="#CPU_TO_DEVICE">BVCACHE_CPU_TO_DEVICE</a></span> operation after the
- CPU has completed its operation and before the hardware BLTsville operation is initiated.<ul>
- <li class="bold_sans">NOTE:&nbsp; This cache operation may not be necessary on all hardware, but it is good practice to perform it
- anyway.&nbsp; This operation will be necessary for a CPU with a write allocation policy on the cache, but may not
- be necessary for CPUs without such a configuration.</li>
- <li class="bold_sans"><strong>NOTE WELL:&nbsp; CPU access to a destination buffer is not always initiated by the client.&nbsp; Buffers
- recently allocated may be cleared by the CPU on behalf of the client via the allocation call.&nbsp; Failure to perform
- this operation may result in image corruption even if no further CPU accesses are performed on the surface!</strong></li>
- </ul>
- </li>
-</ol>
-<table class="example">
- <tr>
- <td>
- <p><strong>Example</strong>:&nbsp; On one particular device, a surface was allocated using the standard user mode
- <span class="inline_code">malloc()</span>.&nbsp; An image was copied into a portion of this surface using a hardware
- implementation of BLTsville.&nbsp; The result was then read by the CPU.</p>
- <p>Logically, <span class="inline_code">bv_cache()</span> was used to perform a <span class="inline_code">
- <a href="#CPU_FROM_DEVICE">BVCACHE_CPU_FROM_DEVICE</a></span> operation after the hardware-based BLTsville operation
- completed, but before the CPU read was performed.&nbsp; However, corruption appeared both inside the image copied,
- as well as outside the image!</p>
- <p>Both corruptions were caused by not realizing that there was a CPU operation (clear) performed on behalf of the
- <span class="inline_code">malloc()</span>, for which the proper cache manipulation was not performed.</p>
- <p>The corruption outside the image was due to data in the cache being invalidated before it reached the memory.&nbsp;
- As mentioned above, buffers allocated are normally cleared by the system.&nbsp; In this case, since the buffer used
- for the surface was configured with a write allocated cache, this meant that not all writes to clear the buffer
- were in memory when the&nbsp; <span class="inline_code"><a href="#CPU_FROM_DEVICE">BVCACHE_CPU_FROM_DEVICE</a></span>
- operation was performed.&nbsp; As a result, the uncommitted data in the cache was invalidated and lost, and the
- previous contents of the memory remained for the CPU to read.</p>
- <p>The corruption inside the image was caused by data in the cache being committed to memory after the hardware
- BLT completed, but before the <span class="inline_code"><a href="#CPU_FROM_DEVICE">BVCACHE_CPU_FROM_DEVICE</a></span>
- operation was executed.</p>
- <p>Both corruptions were corrected by performing a <span class="inline_code"><a href="#CPU_TO_DEVICE">BVCACHE_CPU_TO_DEVICE</a></span>
- operation on the <span class="underline">destination</span> surface <strong>before</strong> performing the BLT (item
- 5 above), in addition to the <span class="inline_code"><a href="#CPU_FROM_DEVICE">BVCACHE_CPU_FROM_DEVICE</a></span>
- operation performed <strong>after</strong> the BLT (item 3 above).</p>
- </td>
- </tr>
-</table>
-<br />
-<hr /><a name="bvbltparams" class="Code_Header">bvbltparams</a>
-<p><span class="inline_code">bvbltparams</span> is the central structure in BLTsville.&nbsp; This structure holds the details
-of the BLT being requested by the client.</p>
-<p class="small_code_block">union bvop {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned short <a href="#rop">rop</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enum bvblend <a href="#blend">blend</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct bvfilter *<a href="#filter">filter</a>;<br />
-};<br />
-<br />
-struct bvinbuff {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvbuffdesc">struct bvbuffdesc</a> *<a href="#src1.desc">desc</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvtileparams">struct bvtileparams</a> *<a href="#src1.tileparams">tileparams</a>;<br />
-};<br />
-<br />
-struct bvbltparams {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvbltparams.structsize">structsize</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *<a href="#errdesc">errdesc</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#implementation">implementation</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#flags">flags</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; union bvop <a href="#op">op</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *<a href="#colorkey">colorkey</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; union bvalpha <a href="#globalalpha">globalalpha</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enum bvscalemode <a href="#scalemode">scalemode</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enum bvdithermode <a href="#dithermode">dithermode</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvbuffdesc">struct bvbuffdesc</a> *<a href="#dstdesc">dstdesc</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvsurfgeom">struct bvsurfgeom</a> *<a href="#dstgeom">dstgeom</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#dstrect">dstrect</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; union bvinbuff <a href="#src1">src1</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvsurfgeom">struct bvsurfgeom</a> *<a href="#src1geom">src1geom</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#src1rect">src1rect</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; union bvinbuff <a href="#src2">src2</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvsurfgeom">struct bvsurfgeom</a> *<a href="#src2geom">src2geom</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#src2rect">src2rect</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; union bvinbuff <a href="#mask">mask</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvsurfgeom">struct bvsurfgeom</a> *<a href="#maskgeom">maskgeom</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#maskrect">maskrect</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#cliprect">cliprect</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#batchflags">batchflags</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct bvbatch *<a href="#batch">batch</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void (*<a href="#callbackfn">callbackfn</a>)(<a href="#bvcallbackerror">struct
-bvcallbackerror</a> *err,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-unsigned long callbackdata);<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#callbackdata">callbackdata</a>;<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#src2auxdstrect">src2auxdstrect</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a> <a href="#maskauxdstrect">maskauxdstrect</a>;<br />
-};</p>
-<a name="bvbltparams.structsize" class="Code_Header_2">bvbltparams.structsize</a>
-<p><span class="code_block">unsigned long structsize; /* input */</span></p>
-<p>This member is used to allow backwards and forwards compatibility between versions of BLTsville.&nbsp; It should be set
-to the <span class="inline_code">sizeof()</span> the structure by the client or implementation, whichever allocated the
-structure.</p>
-<p>BLTsville is designed to be forwards and backwards compatible between client and library versions.&nbsp; But this compatibility
-would be eliminated if clients chose to check for a specific version of the BLTsville implementations and fail if the specific
-version requested was not in place.&nbsp; So, instead of exporting a version number, BLTsville structures use the
-<span class="inline_code">structsize</span> member to indicate the number of bytes in the structure.&nbsp; This is used
-to communicate between the client and implementation which portions of the structure exist.&nbsp; This effectively bypasses
-the concept of a version and focuses on the specifics of what changes need to be considered to maintain compatibility.</p>
-<ol>
- <li>When an old client calls into a new implementation, that implementation will realize if the client only provides
- a subset of an updated structure.&nbsp; The implementation will handle this and utilize only that information which
- has been provided.&nbsp; New features will be disabled, but functionality will be maintained.</li>
- <li>When a new client calls into an old implementation, that implementation will ignore the extra members of the structure
- and operate in ignorance of them.&nbsp; If these members are necessary for some new functionality, this will be evident
- from other fields in the structure, so that the implementation can gracefully fail.</li>
-</ol>
-<p>If <span class="inline_code">structsize</span> is set to a value that is too small for an implementation, it may return
-a <span class="inline_code"><a href="#BVERR_BLTPARAMS_VERS">BVERR_BLTPARAMS_VERS</a></span> error.</p>
-<p class="Code_Header_2"><a name="bvbltparams.errdesc">bvbltparams.errdesc</a></p>
-<p><span class="code_block">char* errdesc; /* output */</span></p>
-<p><span class="inline_code">errdesc</span> is optionally used by implementations to pass a 0-terminated string with additional
-debugging information back to clients for debugging purposes.&nbsp; <span class="inline_code">errdesc</span> is not localized
-or otherwise meant to provide information that is displayed to users.</p>
-<p class="Code_Header_2"><a name="implementation">bvbltparams.implementation</a></p>
-<p class="code_block">unsigned long implementation; /* input */</p>
-<p>Multiple implementations of BLTsville can be combined under managers which can distribute the BLT requests to the implementations
-based on whatever criteria the manager chooses.&nbsp; This might include availability of the operation, performance, loading,
-or power state.&nbsp; In such a scenario, the client may need to override or augment the choice made by the manager.&nbsp;
-This field allows that control.</p>
-<p><strong><em>Note that this feature is extremely complicated, and more detailed documentation needs to be created to allow
-creation of managers and smooth integration by a client.&nbsp; There are serious issues that must be understood before any
-manager can be put into place, such as CPU cache coherence and multiple implementation operation interdependence.&nbsp;
-For now, this field should be set to 0 by clients.</em></strong></p>
-<p>If the implementation cannot respond to the <span class="inline_code">implementation</span> flags set, it may return
-a <span class="inline_code"><a href="#BVERR_IMPLEMENTATION">BVERR_IMPLEMENTATION</a></span> error.</p>
-<p class="Code_Header_2"><a name="flags">bvbltparams.flags</a></p>
-<p class="code_block">unsigned long flags; /* input */</p>
-<p>The <span class="inline_code">flags</span> member provides the baseline of information to <span class="inline_code">
-<a href="#bv_blt">bv_blt()</a></span> about the type of BLT being requested.</p>
-<p>To maintain compatibility, unused bits in the flags member should be set to 0.</p>
-<p>If the flags set are not supported by the implementation, it may return <span class="inline_code">
-<a href="#BVERR_FLAGS">BVERR_FLAGS</a></span>, or a more specific <a href="#bverror">error code</a>.</p>
-<p class="Code_Header_3"><a name="BVFLAG_OP_">bvbltparams.flags - BVFLAG_OP_*</a></p>
-<p>The <span class="inline_code">op</span> field of the flags member specifies the type of BLT operation to perform.&nbsp;
-Currently there are three types of BLT operations defined:</p>
-<table class="indent">
- <tr>
- <td valign="top">1.</td>
- <td><span class="inline_code"><strong><a name="BVFLAG_ROP">BVFLAG_ROP</a></strong></span><br />
- <p>This flag indicates the operation being performed is a raster operation, and the <span class="inline_code">
- <a href="#op">bvbltparams.op</a></span> union is treated as <span class="inline_code"><a href="#rop">rop</a></span>.&nbsp;
- Raster OPerations are binary operations performed on the bits of the inputs.&nbsp; See <span class="inline_code">
- <a href="#rop">bvbltparams.op.rop</a></span> for details.<br />
- <br />
- </p>
- </td>
- </tr>
- <tr>
- <td valign="top">2.</td>
- <td>
- <p><span class="inline_code"><strong><a name="BVFLAG_BLEND">BVFLAG_BLEND</a></strong></span><br />
- </p>
- <p>This flag indicates the operation being performed is a blend, and the <span class="inline_code">
- <a href="#op">bvbltparams.op</a></span> union is treated as <span class="inline_code"><a href="#blend">blend</a></span>.&nbsp;
- Blending involves mixing multiple layers of pixels using the specified equations.&nbsp; Surrounding pixels are not
- involved in blend operations.&nbsp; See <span class="inline_code"><a href="#blend">bvbltparams.op.blend</a></span>
- for details.<br />
- <br />
- </p>
- </td>
- </tr>
- <tr>
- <td valign="top">3.</td>
- <td><span class="inline_code"><strong><a name="BVFLAG_FILTER">BVFLAG_FILTER</a></strong></span><br />
- <br />
- This flag indicates the operation being performed is a filter, and the <span class="inline_code"><a href="#op">bvbltparams.op</a></span>
- union is treated as <span class="inline_code"><a href="#filter">filter</a></span>.&nbsp; Filtering involves mixing
- multiple layers of pixels.&nbsp; Surrounding pixels are involved in filter operations.&nbsp; See
- <span class="inline_code"><a href="#filter">bvbltparams.op.filter</a></span> for details.<br />
- </td>
- </tr>
-</table>
-<p class="Code_Header_3"><a name="BVFLAG_KEY_SRC">bvbltparams.flags - BVFLAG_KEY_SRC</a>/<a name="BVFLAG_KEY_DST">DST</a></p>
-<p>The <span class="inline_code">BVFLAG_KEY_SRC</span> and <span class="inline_code">BVFLAG_KEY_DST</span> enable source
-and destination color keying, respectively.&nbsp; When either flag is set, the <span class="inline_code">
-<a href="#colorkey">colorkey</a></span> member of <span class="inline_code"><a href="#bvbltparams">bvbltparams</a></span>
-is used.</p>
-<p><span class="inline_code">BVFLAG_KEY_SRC</span> and <span class="inline_code">BVFLAG_KEY_DST</span> are mutually exclusive.</p>
-<p>See <span class="inline_code"><a href="#colorkey">bvbltparams.colorkey</a></span> for details.</p>
-<p class="Code_Header_3"><a name="BVFLAG_CLIP">bvbltparams.flags - BVFLAG_CLIP</a></p>
-<p>When <span class="inline_code">BVFLAG_CLIP</span> is set, the <span class="inline_code"><a href="#cliprect">cliprect</a></span>
-member of <span class="inline_code"><a href="#bvbltparams">bvbltparams</a></span> is used by the implementation as a limiting
-rectangle on data written to the destination.&nbsp; See <span class="inline_code"><a href="#cliprect">cliprect</a></span>
-for details.</p>
-<p class="Code_Header_3"><a name="BVFLAG_SRCMASK">bvbltparams.flags - BVFLAG_SRCMASK</a></p>
-<p>Normally, the mask is applied at the destination, after all scaling has been completed (including scaling the mask if
-necessary).&nbsp; But some environments require that the mask be applied at the sources, before scaling occurs.&nbsp; The
-<span class="inline_code">BVFLAG_SRCMASK</span> flag requests that the implementation use this method if supported.</p>
-<p class="Code_Header_3">bvbltparams.flags - BVFLAG_TILE_*</p>
-<p>Normally, when a source&#39;s size does not match the destination, the source is scaled to fill the destination.&nbsp; But
-when the corresponding <span class="inline_code">BVFLAG_TILE_*</span> flag is set, this behavior is modified.</p>
-<p>First, the source&#39;s size specifies a tile (or pattern, or brush) to be used to fill the destination.&nbsp; This tile
-is replicated instead of scaled.</p>
-<p>The origin of the source&#39;s rectangle is used to locate the tile within a larger surface. </p>
-<p>Second, a <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> object is no longer supplied by the client
-in the bvbltparams structure.&nbsp; In its place is a <span class="inline_code"><a href="#bvtileparams">bvtileparams</a></span>
-object.</p>
-<p>Refer to the <span class="inline_code"><a href="#bvtileparams">bvtileparams</a></span> structure definition for details.</p>
-<p class="Code_Header_3">bvbltparams.flags - <a name="BVFLAG_HORZ_FLIP">BVFLAG_HORZ</a>/<a name="BVFLAG_VERT_FLIP">VERT_FLIP_*</a></p>
-<p>These flags indicate that the corresponding image is flipped horizontally or vertically as it is used by the operation.</p>
-<p class="Code_Header_3">bvbltparams.flags - BVFLAG_SCALE/DITHER_RETURN</p>
-<p>The scale and dither types can be specified with an implicit type.&nbsp; The implementation will then convert that internally
-to an explicit scale or dither type.&nbsp; These flags request that the implementation return the explicit type chosen to
-the client in the corresponding <span class="inline_code"><a href="#scalemode">bvbltparams.scalemode</a></span> and
-<span class="inline_code"><a href="#dithermode">bvbltparams.dithermode</a></span> members.</p>
-<p class="Code_Header_3">bvbltparams.flags - BVFLAG_ASYNC</p>
-<p>This flag allows the client to inform the implementation that it can queue the requested BLT and return from
-<span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> before it has completed.&nbsp; If this bit is not set, when
-the <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> returns, the operation is complete.</p>
-<p>Normally, a client will also utilize the <span class="inline_code"><a href="#callbackfn">bvbltparams.callbackfn</a></span>
-and <span class="inline_code"><a href="#callbackdata">bvbltparams.callbackdata</a></span> members to receive a notification
-when the BLT has completed.</p>
-<p class="note">NOTE:&nbsp; Asynchronous BLTs are performed in the order in which they are submitted within an implementation.&nbsp;
-This was done to provide a simple dependency mechanism.&nbsp;
-However, synchronization between implementations must be handled by the client, using the callback mechanism.</p>
-<p class="note">NOTE:&nbsp; Since asynchronous BLTs are performed in the order in which they are submitted, it follows
-that a synchronized BLT after a set of asynchronous BLTs may be used as synchronization as well.</p>
-<p class="note"><a name="NOP">NOTE</a>:&nbsp; Certain situations may require manual synchronization without an associated BLT.&nbsp;
-Rather than introduce an additional BLTsville function call, the method of handling this will be via a NOP BLT.&nbsp; To
-accomplish a NOP BLT, the client should issue a BLT using the <span class="inline_code"><a href="#rop">
-bvbltparams.op.rop</a></span> code of <span class="inline_code">0xAAAA</span> (copy destination to destination), and
-with the <span class="inline_code">BVFLAG_ASYNC</span> flag <span class="underline">not</span> set.&nbsp; Alternatively, the NOP BLT may set the
-<span class="inline_code">BVFLAG_ASYNC</span> and provide a <span class="inline_code"><a href="#callbackfn">
-bvbltparams.callbackfn</a></span>.&nbsp; <em>To facilitate implementations, a valid destination surface should be
-specified.</em></p>
-<p class="imponly"><strong>Implementations Only<br />
-<br />
-</strong>In general, this BLTsville specification has avoided placing any requirement on implementations for specific
-operations.&nbsp; However, in support of this special case, support for these NOP BLTs will need to be an implementation
-<span class="underline"><strong>requirement</strong></span>. </p>
-<p class="Code_Header_3">bvbltparams.flags - BVFLAG_BATCH_BEGIN/CONTINUE/END</p>
-<p>These flags are used to control batching of BLTs for two main reasons:</p>
-<ol>
- <li>To group small, similar BLTs to consolidate overhead.&nbsp; For example, the BLTs associated with rendering each
- character in a word.</li>
- <li>To group related BLTs, which may allow an implementation to perform a more efficient, but equivalent set of operations.</li>
-</ol>
-<p>See <a href="#batching">Batching</a> for details.</p>
-<p class="Code_Header_3">bvbltparams.flags - <a name="BVFLAG_SRC2_AUXDSTRECT">BVFLAG_SRC2</a>/<a name="BVFLAG_MASK_AUXDSTRECT">MASK_AUXDSTRECT</a></p>
-<p>These flags are used to indicate that the bvbltparams.src2auxdstrect and bvbltparams.maskauxdstrect are to be used.&nbsp;
-See these entries below for details. These flags are likely to be ignored except for the special case explained below,
-so they should be used only when necessary.</p>
-<p class="Code_Header_2"><a name="rop">bvbltparams.op.rop</a></p>
-<p class="code_block">unsigned short op; /* input */ </p>
-<p>When <span class="inline_code"><a href="#BVFLAG_ROP">BVFLAG_ROP</a></span> is set in the <span class="inline_code">
-<a href="#flags">bvbltparams.flags</a></span> member, the <span class="inline_code"><a href="#op">bvbltparams.op</a></span>
-union is treated as <span class="inline_code">rop</span>.&nbsp; Raster OPerations are binary operations performed on the
-bits of the inputs:</p>
-<ul>
- <li>ROP1s have one source:&nbsp; the destination.&nbsp; Two bits are sufficient to specify the four possible (2<sup>2</sup>)
- ROP1 operations.</li>
- <li>ROP2s have two sources:&nbsp; the destination and a source.&nbsp; Four bits are used to specify the sixteen (2<sup>2+2</sup>)
- ROP2 operations.</li>
- <li>ROP3s have three sources:&nbsp; the destination, a source (source 1), and a pattern (a.k.a. brush), which we call
- source 2 in BLTsville.&nbsp; Eight bits are used to specify the 256 (2<sup>2+2+2</sup>) ROP3 operations.</li>
- <li>ROP4s have four sources:&nbsp; the destination, two sources, and a mask.&nbsp; Sixteen bits are used to specify
- the 65,536 (2<sup>2+2+2+2</sup>) ROP4 operations.</li>
-</ul>
-<p>BLTsville&#39;s <span class="inline_code">rop</span> element is used to specify a ROP4, but anything from ROP1 up to ROP4
-can be defined using this member:</p>
-<ul>
- <li>To specify an 8-bit ROP3 as a 16-bit ROP4, replicate the 8 bits twice:&nbsp; 0x2323.</li>
- <li>To specify a 4-bit ROP2 as a 16-bit ROP4, replicate the 4 bits four times:&nbsp; 0x2222.</li>
- <li>To specify a 2-bit ROP1 as a 16-bit ROP4, replicate the 2 bits eight times:&nbsp; 0x5555.</li>
-</ul>
-<p class="note">NOTE:&nbsp;
-By far the most common ROP used will be 0xCCCC, which indicates a simple copy from source 1 to the destination.</p>
-<p>The table below is the magic decoder ring: </p>
-<table class="indent">
- <tr>
- <td>Mask</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;1&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- <td class="ctr">&nbsp;0&nbsp;</td>
- </tr>
- <tr>
- <td class="red_left">Source 2 </td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;1&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- <td class="red_center">&nbsp;0&nbsp;</td>
- </tr>
- <tr>
- <td class="grn_left">Source 1 </td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;1&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- <td class="grn_center">&nbsp;0&nbsp;</td>
- </tr>
- <tr>
- <td class="blue_left_botbord">Destination </td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;1&nbsp;</td>
- <td class="blue_center_botbord">&nbsp;0&nbsp;</td>
- </tr>
- <tr>
- <td class="left_topbord">Raster Operation </td>
- <td class="center_topbord">&nbsp;15&nbsp;</td>
- <td class="center_topbord">&nbsp;14&nbsp;</td>
- <td class="center_topbord">&nbsp;13&nbsp;</td>
- <td class="center_topbord">&nbsp;12&nbsp;</td>
- <td class="center_topbord">&nbsp;11&nbsp;</td>
- <td class="center_topbord">&nbsp;10&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;9&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;8&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;7&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;6&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;5&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;4&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;3&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;2&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;1&nbsp;</td>
- <td class="center_topbord">&nbsp;&nbsp;0&nbsp;</td>
- </tr>
-</table>
-<br />
-For example, to specify an operation that uses the mask to choose between source 1 and destination (source 1 when mask is
-1, destination when mask is 0), a client would calculate the bottom line by parsing each column:<br />
-<br />
-When mask is 1 (the first eight columns), the <span class="inline_code">rop</span> matches the source 1 row.&nbsp; When
-mask is 0 (the last eight columns), the <span class="inline_code">rop</span> matches the destination row.<br />
-<br />
-<table class="indent">
- <tr>
- <td class="left_topbord">Raster Operation </td>
- <td class="red_center_topbord">&nbsp;1&nbsp;</td>
- <td class="red_center_topbord">&nbsp;1&nbsp;</td>
- <td class="red_center_topbord">&nbsp;1&nbsp;</td>
- <td class="red_center_topbord">&nbsp;1&nbsp;</td>
- <td class="red_center_topbord">&nbsp;0&nbsp;</td>
- <td class="red_center_topbord">&nbsp;0&nbsp;</td>
- <td class="red_center_topbord">&nbsp;0&nbsp;</td>
- <td class="red_center_topbord">&nbsp;0&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;1&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;0&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;1&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;0&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;1&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;0&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;1&nbsp;</td>
- <td class="blu_center_topbord">&nbsp;0&nbsp;</td>
- </tr>
-</table>
-<br />
-So the <span class="inline_code">rop</span> for this operation would be 0xF0AA.<br />
-<br />
-Here is a list of some commonly used raster operations that have been given names:<br />
-<br />
-<table class="indent_thick_bord">
- <tr>
- <td class="thin_bord_dbl_botbord"><strong>ROP </strong></td>
- <td class="thin_bord_dbl_botbord"><strong>Constant</strong></td>
- <td class="thin_bord_dbl_botbord"><strong>Description</strong></td>
- </tr>
- <tr>
- <td class="thin_bord">BLACKNESS</td>
- <td class="thin_bord">0x0000</td>
- <td class="thin_bord">Set all destination bits to black (0).&nbsp; Dest = 0</td>
- </tr>
- <tr>
- <td class="thin_bord">NOTSRCERASE</td>
- <td class="thin_bord">0x1111</td>
- <td class="thin_bord">Dest = ~Src1 &amp; ~Dest = ~(Src1 | Dest)</td>
- </tr>
- <tr>
- <td class="thin_bord">NOTSRCCOPY</td>
- <td class="thin_bord">0x3333</td>
- <td class="thin_bord">Dest = ~Src1</td>
- </tr>
- <tr>
- <td class="thin_bord">SRCERASE</td>
- <td class="thin_bord">0x4444</td>
- <td class="thin_bord">Dest = Src1 &amp; ~Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">DSTINVERT</td>
- <td class="thin_bord">0x5555</td>
- <td class="thin_bord">Invert (NOT) the destination bits.&nbsp; Dest = ~Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">PATINVERT</td>
- <td class="thin_bord">0x5A5A</td>
- <td class="thin_bord">XOR with Src2.&nbsp; Dest = Src2 ^ Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">SRCINVERT</td>
- <td class="thin_bord">0x6666</td>
- <td class="thin_bord">XOR with Src1.&nbsp; Dest = Src1 ^ Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">SRCAND</td>
- <td class="thin_bord">0x8888</td>
- <td class="thin_bord">Dest = Src1 &amp; Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">NOP</td>
- <td class="thin_bord">0xAAAA</td>
- <td class="thin_bord">Dest = Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">MERGEPAINT</td>
- <td class="thin_bord">0xBBBB</td>
- <td class="thin_bord">Dest = ~Src1 | Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">MERGECOPY</td>
- <td class="thin_bord">0xC0C0</td>
- <td class="thin_bord">Dest = Src1 &amp; Src2</td>
- </tr>
- <tr>
- <td class="thin_bord">SRCCOPY</td>
- <td class="thin_bord">0xCCCC</td>
- <td class="thin_bord">Dest = Src1</td>
- </tr>
- <tr>
- <td class="thin_bord">SRCPAINT</td>
- <td class="thin_bord">0xEEEE</td>
- <td class="thin_bord">OR with Src1.&nbsp; Dest = Src1 | Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">PATCOPY</td>
- <td class="thin_bord">0xF0F0</td>
- <td class="thin_bord">Copy source 2 to destination.&nbsp; Dest = Src2</td>
- </tr>
- <tr>
- <td class="thin_bord">PATPAINT</td>
- <td class="thin_bord">0xFBFB</td>
- <td class="thin_bord">Dest =&nbsp; ~Src1 | Src2 | Dest</td>
- </tr>
- <tr>
- <td class="thin_bord">WHITENESS</td>
- <td class="thin_bord">0xFFFF</td>
- <td class="thin_bord">Set all destination bits to white (1).&nbsp; Dest = 1</td>
- </tr>
-</table>
-<br />
-<span class="Code_Header_2"><a name="blend">bvbltparams.op.blend</a></span>
-<p class="code_block">enum bvblend blend; /* input */</p>
-<p>When <span class="inline_code"><a href="#BVFLAG_BLEND">BVFLAG_BLEND</a></span> is set in the
-<span class="inline_code"><a href="#flags">bvbltparams.flags</a></span> member, the <span class="inline_code">
-<a href="#op">bvbltparams.op</a></span> union is treated as a <span class="inline_code">blend</span>.</p>
-<p>To specify the blend, the client fills in <span class="inline_code">blend</span> with one of the
-<span class="inline_code"><a href="#bvblend">bvblend</a></span> values.</p>
-<p><span class="inline_code"><a href="#bvblend">bvblend</a></span> is an enumeration assembled from sets of fields.&nbsp;
-The values specified may be extended beyond those that are explicitly defined using the definitions in the
-<span class="filename">bvblend.h</span> header file.</p>
-<p>The first 4 bits are the format.&nbsp; Currently two format groups are defined, but others can be added.&nbsp; The remainder
-of the bits are used as defined by the individual format:</p>
-<table class="indent">
- <tr>
- <td valign="top">1.</td>
- <td><span class="Code_Header_3">BVBLENDDEF_FORMAT_CLASSIC</span><br />
- <br />
- The <span class="inline_code">BVBLENDDEF_FORMAT_CLASSIC</span> is meant to handle the classic Porter-Duff equations.
- It can also handle the DirectFB blending.<br />
- <br />
- <span class="inline_code">BVBLENDDEF_FORMAT_CLASSIC</span> is based on the following equations:<br />
- <div>
- <p class="indent">C<sub>d</sub> = K<sub>1</sub>C<sub>1</sub> + K<sub>2</sub>C<sub>2</sub><br />
- A<sub>d</sub> = K<sub>3</sub>A<sub>1</sub> + K<sub>4</sub>A<sub>2</sub></p>
- </div>
- where:<br />
- <div>
- <p class="indent">C<sub>d</sub>: destination color<br />
- C<sub>1</sub>: source 1 color<br />
- C<sub>2</sub>: source 2 color<br />
- A<sub>d</sub>: destination alpha<br />
- A<sub>1</sub>: source 1 alpha<br />
- A<sub>2</sub>: source 2 alpha<br />
- K<sub>#</sub>: one of the constants defined using the bitfields below</p>
- </div>
- The 28 bits for <span class="inline_code">BVBLENDDEF_FORMAT_CLASSIC</span> are divided into 5 sections.<br />
- <br />
- The most significant 4 bits are modifiers, used to include additional alpha values from global or remote sources.<br />
- <br />
- [27] The most significant bit indicates that a remote alpha is to be included in the blend. The format of this is
- defined by <span class="inline_code"><a href="#maskgeom">bvbltparams.maskgeom.format</a></span>.<br />
- <br />
- [26] The next bit is reserved.<br />
- <br />
- [25:24] The next 2 bits are used to indicate that a global alpha is to be included, and what its format is:<br />
- <div>
- <p class="indent">00: no global included<br />
- 01: global included; bvbltparams.globalalpha.size8 is used (0 -&gt; 255)<br />
- 10: this value is reserved<br />
- 11: global included; bvbltparams.flogalalpha.fp is used (0.0 -&gt; 1.0) </p>
- </div>
- The remaining bits are divided into 4 sections, one to define each of the constants:<br />
- <br />
- [23:18] - K1<br />
- [17:12] - K2<br />
- [11:6] - K3<br />
- [5:0] - K4<br />
- <br />
- The format is the same for all 4 constant fields:<br />
- <br />
- [5:4] The first 2 bits of each field indicates the way in which the other 2 fields are interpreted:<br />
- <div>
- <p class="indent">00: only As: the other two fields contain only As; there should be only one valid A value
- between the two fields<br />
- 01: minimum: the value of the constant is the minimum of the two fields<br />
- 10: maximum: the value of the constant is the maximum of the two fields<br />
- 11: only Cs: the other two fields contain only Cs; there should be only one valid C value between the two fields</p>
- </div>
- [3:2] The middle 2 bits of each field contain the inverse field:<br />
- <div>
- <p class="indent">00: 1-C1 (&quot;don&#39;t care&quot; for &quot;only As&quot;)<br />
- 01: 1-A1 (&quot;don&#39;t care&quot; for &quot;only Cs&quot;)<br />
- 10: 1-C2 (&quot;don&#39;t care&quot; for &quot;only As&quot;)<br />
- 11: 1-A2 (&quot;don&#39;t care&quot; for &quot;only Cs&quot;)</p>
- </div>
- [1:0] The last 2 bits if each field contain the normal field:<br />
- <div>
- <p class="indent">00: C1 (&quot;don&#39;t care&quot; for &quot;only As&quot;)<br />
- 01: A1 (&quot;don&#39;t care&quot; for &quot;only Cs&quot;)<br />
- 10: C2 (&quot;don&#39;t care&quot; for &quot;only As&quot;)<br />
- 11: A2 (&quot;don&#39;t care&quot; for &quot;only Cs&quot;)</p>
- </div>
- EXCEPTIONS:<br />
- <br />
- 00 00 00 - The value 00 00 00, which normally would indicate &quot;only As&quot; with two &quot;don&#39;t care&quot; fields, is interpreted
- as a constant of 0.<br />
- <br />
- 11 11 11 - The value 11 11 11, which normally would indicate &quot;only Cs&quot; with two &quot;don&#39;t care&quot; fields, is interpreted
- as a constant of 1.<br />
- <br />
- <span class="Header4">Constants</span><br />
- <br />
- Put together, these can define portions of the blend equations that can be put together in a variety of ways:<br />
- <br />
- <table class="indent_thick_bord">
- <tr>
- <td class="rt_thick_bord">
- <table>
- <tr>
- <td class="thin_bord">00 00 00</td>
- <td class="thin_bord">undefined -&gt; zero</td>
- </tr>
- <tr>
- <td class="thin_bord">00 00 01</td>
- <td class="thin_bord">A1 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 00 10</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">00 00 11</td>
- <td class="thin_bord">A2 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 01 00</td>
- <td class="thin_bord">1-A1 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 01 01</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">00 01 10</td>
- <td class="thin_bord">1-A1 (use 00 01 00)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 01 11</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">00 10 00</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">00 10 01</td>
- <td class="thin_bord">A1 (use 00 00 01)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 10 10</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">00 10 11</td>
- <td class="thin_bord">A2 (use 00 00 11)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 11 00</td>
- <td class="thin_bord">1-A2 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 11 01</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">00 11 10</td>
- <td class="thin_bord">1-A2 (use 00 11 00)</td>
- </tr>
- <tr>
- <td class="thin_bord">00 11 11</td>
- <td class="thin_bord">undefined</td>
- </tr>
- </table>
- </td>
- <td class="rt_thick_bord">
- <table>
- <tr>
- <td class="thin_bord">01 00 00</td>
- <td class="thin_bord">min(C1,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 00 01</td>
- <td class="thin_bord">min(A1,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 00 10</td>
- <td class="thin_bord">min(C2,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 00 11</td>
- <td class="thin_bord">min(A2,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 01 00</td>
- <td class="thin_bord">min(C1,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 01 01</td>
- <td class="thin_bord">min(A1,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 01 10</td>
- <td class="thin_bord">min(C2,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 01 11</td>
- <td class="thin_bord">min(A2,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 10 00</td>
- <td class="thin_bord">min(C1,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 10 01</td>
- <td class="thin_bord">min(A1,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 10 10</td>
- <td class="thin_bord">min(C2,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 10 11</td>
- <td class="thin_bord">min(A2,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 11 00</td>
- <td class="thin_bord">min(C1,1-A2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 11 01</td>
- <td class="thin_bord">min(A1,1-A2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 11 10</td>
- <td class="thin_bord">min(C2,1-A2)</td>
- </tr>
- <tr>
- <td class="thin_bord">01 11 11</td>
- <td class="thin_bord">min(A2,1-A2)</td>
- </tr>
- </table>
- </td>
- <td class="rt_thick_bord">
- <table>
- <tr>
- <td class="thin_bord">10 00 00</td>
- <td class="thin_bord">max(C1,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 00 01</td>
- <td class="thin_bord">max(A1,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 00 10</td>
- <td class="thin_bord">max(C2,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 00 11</td>
- <td class="thin_bord">max(A2,1-C1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 01 00</td>
- <td class="thin_bord">max(C1,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 01 01</td>
- <td class="thin_bord">max(A1,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 01 10</td>
- <td class="thin_bord">max(C2,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 01 11</td>
- <td class="thin_bord">max(A2,1-A1)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 10 00</td>
- <td class="thin_bord">max(C1,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 10 01</td>
- <td class="thin_bord">max(A1,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 10 10</td>
- <td class="thin_bord">max(C2,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 10 11</td>
- <td class="thin_bord">max(A2,1-C2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 11 00</td>
- <td class="thin_bord">max(C1,1-A2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 11 01</td>
- <td class="thin_bord">max(A1,1-A2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 11 10</td>
- <td class="thin_bord">max(C2,1-A2)</td>
- </tr>
- <tr>
- <td class="thin_bord">10 11 11</td>
- <td class="thin_bord">max(A2,1-A2)</td>
- </tr>
- </table>
- </td>
- <td>
- <table>
- <tr>
- <td class="thin_bord">11 00 00</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 00 01</td>
- <td class="thin_bord">1-C1 (use 11 00 11)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 00 10</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 00 11</td>
- <td class="thin_bord">1-C1 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 01 00</td>
- <td class="thin_bord">C1 (use 11 11 00)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 01 01</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 01 10</td>
- <td class="thin_bord">C2 (use 11 11 10)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 01 11</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 10 00</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 10 01</td>
- <td class="thin_bord">1-C2 (use 11 10 11)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 10 10</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 10 11</td>
- <td class="thin_bord">1-C2 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 11 00</td>
- <td class="thin_bord">C1 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 11 01</td>
- <td class="thin_bord">undefined</td>
- </tr>
- <tr>
- <td class="thin_bord">11 11 10</td>
- <td class="thin_bord">C2 (preferred)</td>
- </tr>
- <tr>
- <td class="thin_bord">11 11 11</td>
- <td class="thin_bord">undefined -&gt; one</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <span class="Header4"><br />
- DirectFB Example</span><br />
- <br />
- Putting these together into the proper constants, the blending equations can be built for different APIs.&nbsp;
- Here is how DirectFB would be mapped:<br />
- <br />
- For DirectFB, the
- <a href="http://directfb.org/docs/DirectFB_Reference_1_2/IDirectFBSurface_SetSrcBlendFunction.html" class="inline_code">
- SetSrcBlendFunction()</a> and
- <a href="http://directfb.org/docs/DirectFB_Reference_1_2/IDirectFBSurface_SetDstBlendFunction.html" class="inline_code">
- SetDstBlendFunction()</a> can specify 121 combinations of blends (11 x 11). It&#39;s impractical to specify these combinations
- individually. Instead, the settings indicated by each call should be bitwise OR&#39;d to make the proper single value
- used in BLTsville.<br />
- <br />
- <table class="code_block">
- <tr>
- <td class="ctr">&nbsp;</td>
- <td colspan="5" class="ctr"><strong>32-bit Binary Value</strong></td>
- </tr>
- <tr>
- <td><strong>
- <a href="http://directfb.org/docs/DirectFB_Reference_1_2/IDirectFBSurface_SetSrcBlendFunction.html">SetSrcBlendFunction()</a></strong></td>
- <td class="ctr"><strong>[VendorID]</strong></td>
- <td class="ctr"><strong>&nbsp;[--K1--] </strong></td>
- <td class="ctr"><strong>&nbsp;[--K2--] </strong></td>
- <td class="ctr"><strong>&nbsp;[--K3--] </strong></td>
- <td class="ctr"><strong>&nbsp;[--K4--] </strong></td>
- </tr>
- <tr>
- <td>DSBF_ZERO</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">00 00 00</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 00</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_ONE</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">11 11 11</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">11 11 11</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_SRCCOLOR</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">11 11 00</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 01</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_INVSRCCOLOR</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">11 00 11</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 01 00</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_SRCALPHA</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">00 00 01</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 01</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_INVSRCALPHA</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">00 01 00</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 01 00</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_DESTCOLOR</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">11 11 10</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 11</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_INVDESTCOLOR</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">11 10 11</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 11 00</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_DESTALPHA</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">00 00 11</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 11</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_INVDESTALPHA</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">00 11 00</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 11 00</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- <tr>
- <td>DSBF_SRCALPHASAT</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">01 11 01</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">11 11 11</td>
- <td class="ctr">xx xx xx</td>
- </tr>
- </table>
- <br />
- <table class="code_block">
- <tr>
- <td class="ctr">&nbsp;</td>
- <td colspan="5" class="ctr"><strong>32-bit Binary Value</strong></td>
- </tr>
- <tr>
- <td><strong>
- <a href="http://directfb.org/docs/DirectFB_Reference_1_2/IDirectFBSurface_SetDstBlendFunction.html">SetDstBlendFunction()</a></strong></td>
- <td class="ctr"><strong>[VendorID]</strong></td>
- <td class="ctr"><strong>&nbsp;[--K1--] </strong></td>
- <td class="ctr"><strong>&nbsp;[--K2--] </strong></td>
- <td class="ctr"><strong>&nbsp;[--K3--] </strong></td>
- <td class="ctr"><strong>&nbsp;[--K4--] </strong></td>
- </tr>
- <tr>
- <td>DSBF_ZERO</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 00</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 00</td>
- </tr>
- <tr>
- <td>DSBF_ONE</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">11 11 11</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">11 11 11</td>
- </tr>
- <tr>
- <td>DSBF_SRCCOLOR</td>
- <td class="ctr">0000 0000</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">11 11 00</td>
- <td class="ctr">xx xx xx</td>
- <td class="ctr">00 00 01</td>
- </tr>
- <tr>
- <td>etc.</td>
- <td class="ctr">&nbsp;</td>
- <td class="ctr">&nbsp;</td>
- <td class="ctr">&nbsp;</td>
- <td class="ctr">&nbsp;</td>
- <td>&nbsp;</td>
- </tr>
- </table>
- <br />
- <span class="Header4">Porter-Duff</span><br />
- <br />
- For Porter-Duff blends, the equations can be more specifically defined. For convenience, these are enumerated in
- the <span class="inline_code">bvblend.h</span> header. These enumerations utilize only the local alpha in the equations
- as indicated. To use global or remote alpha, these enumerations need to be modified. For example, to include the
- global alpha in the Porter-Duff <span class="inline_code">BVBLEND_SRC1OVER</span> blend, the blend could be defined
- like this:<br />
- <br />
- <div>
- <table class="indent">
- <tr>
- <td valign="top"><span class="inline_code">params.op.blend =</span></td>
- <td><span class="inline_code">BVBLEND_SRC1OVER +<br />
- BVBLENDDEF_GLOBAL_UCHAR;</span></td>
- </tr>
- </table>
- </div>
- <br />
- To include the remote alpha, the blend could be defined like this:<br />
- <br />
- <div>
- <table class="indent">
- <tr>
- <td valign="top"><span class="inline_code">params.op.blend =</span></td>
- <td><span class="inline_code">BVBLEND_SRC1OVER +<br />
- BVBLENDDEF_REMOTE;</span></td>
- </tr>
- </table>
- </div>
- <br />
- And to include both:<br />
- <br />
- <div>
- <table class="indent">
- <tr>
- <td valign="top"><span class="inline_code">params.op.blend =</span></td>
- <td><span class="inline_code">BVBLEND_SRC1OVER +<br />
- BVBLENDDEF_GLOBAL_UCHAR +<br />
- BVBLENDDEF_REMOTE;</span></td>
- </tr>
- </table>
- </div>
- <br />
- Note that if the source color formats include local alphas, the local alphas, global alpha, and remote alpha will
- be used together.<br />
- <br />
- Note also that the equations assume the surfaces are premultiplied. So if the surface formats indicate that they
- are not premultiplied, the alpha multiplication of each color is done prior to using the surface values in the equations.<br />
- <br />
- For example, <span class="inline_code">BVBLEND_SRC1OVER</span> specifies the equations:<br />
- <table class="indent">
- <tr>
- <td>C<sub>d</sub> = C<sub>1</sub> + (1 - A<sub>1</sub>)C<sub>2</sub><br />
- A<sub>d</sub> = A<sub>1</sub> + (1 - A<sub>1</sub>)A<sub>2</sub> </td>
- </tr>
- </table>
- <br />
- If the format of surface 1 is non-premultiplied, the equations are modified to include the multiplication explicitly:<br />
- <br />
- <table class="indent">
- <tr>
- <td>C<sub>d</sub> = A<sub>1</sub>C<sub>1</sub> + (1 - A<sub>1</sub>)C<sub>2</sub><br />
- A<sub>d</sub> = A<sub>1</sub> + (1 - A<sub>1</sub>)A<sub>2</sub> </td>
- </tr>
- </table>
- <br />
- Likewise, if the format of surface 2 is non-premultiplied, the equations are modified for this:<br />
- <br />
- <table class="indent">
- <tr>
- <td>
- <div>
- C<sub>d</sub> = C<sub>1</sub> + (1 - A<sub>1</sub>)A<sub>2</sub>C<sub>2</sub><br />
- A<sub>d</sub> = A<sub>1</sub> + (1 - A<sub>1</sub>)A<sub>2</sub> </div>
- </td>
- </tr>
- </table>
- <br />
- When including global or remote alphas, these values are used to modify the source 1 value values before being used
- in the blend equation:<br />
- <br />
- <table class="indent">
- <tr>
- <td class="ctr">C<sub>1</sub> = A<sub>g</sub>C<sub>1</sub><br />
- A<sub>1</sub> = A<sub>g</sub>A<sub>1</sub></td>
- <td style="width: 20%" class="ctr">-or-</td>
- <td class="ctr">C<sub>1</sub> = A<sub>r</sub>C<sub>1</sub><br />
- A<sub>1</sub> = A<sub>r</sub>A<sub>1</sub></td>
- <td class="ctr">-or-</td>
- <td class="ctr">C<sub>1</sub> = A<sub>r</sub>A<sub>g</sub>C<sub>1</sub><br />
- A<sub>1</sub> = A<sub>r</sub>A<sub>g</sub>A<sub>1</sub></td>
- </tr>
- </table>
- <br />
- </td>
- </tr>
- <tr>
- <td valign="top">2.</td>
- <td><span class="Code_Header_3"><strong><a name="BVBLENDDEF_FORMAT_ESSENTIAL0">BVBLENDDEF_FORMAT_ESSENTIAL</a></strong></span><br />
- <br />
- The essential blending equations are based on the blending equations in common image manipulation programs.<pre class="indent"><code>BVBLEND_LIGHTEN max(src1, src2)
-BVBLEND_DARKEN min(src1, src2)
-BVBLEND_MULTIPLY (src1 * src2) / 255
-BVBLEND_AVERAGE (src1 + src2) / 2
-BVBLEND_ADD src1 + src2 (saturated)
-BVBLEND_SUBTRACT src1 + src2 - 255 (saturated)
-BVBLEND_DIFFERENCE abs(src - src2)
-BVBLEND_NEGATION 255 - abs(255 - src1 - src2)
-BVBLEND_SCREEN 255 - (((255 - src1) * (255 - src2)) / 256)
-BVBLEND_EXCLUSION src1 + src2 - ((2 * src1 * src2) / 255)
-BVBLEND_OVERLAY (src2 &lt; 128) ? (2 * src1 * src2 / 255) : (255 - 2 * (255 - src1) * (255 - src2) / 255)
-BVBLEND_SOFT_LIGHT (src2 &lt; 128) ? (2 * ((src1 &gt;&gt; 1) + 64)) * ((float)src2 / 255) : (255 - (2 * (255 - ((src1 &gt;&gt; 1) + 64)) * (float)(255 - src2) / 255))
-BVBLEND_HARD_LIGHT (src1 &lt; 128) ? (2 * src2 * src1 / 255) : (255 - 2 * (255 - src2) * (255 - src1) / 255)
-BVBLEND_COLOR_DODGE (src2 == 255) ? src2 : min(255, ((src1 &lt;&lt; 8) / (255 - src2))
-BVBLEND_COLOR_BURN (src2 == 0) ? src2 : max(0, (255 - ((255 - src1) &lt;&lt; 8 ) / src2))))
-BVBLEND_LINEAR_DODGE same as BVBLEND_ADD
-BVBLEND_LINEAR_BURN same as BVBLEND_SUBTRACT
-BVBLEND_LINEAR_LIGHT (src2 &lt; 128) ? LINEAR_BURN(src1,(2 * src2)) : LINEAR_DODGE(src1,(2 * (src2 - 128)))
-BVBLEND_VIVID_LIGHT (src2 &lt; 128) ? COLOR_BURN(src1,(2 * src2)) : COLOR_DODGE(src1,(2 * (src2 - 128))))
-BVBLEND_PIN_LIGHT (src2 &lt; 128) ? DARKEN(src1,(2 * src2)) : LIGHTEN(src1,(2 * (src2 - 128)))
-BVBLEND_HARD_MIX (VIVID_LIGHT(src1, src2) &lt; 128) ? 0 : 255
-BVBLEND_REFLECT (src2 == 255) ? src2 : min(255, (src1 * src1 / (255 - src2)))
-BVBLEND_GLOW (src1 == 255) ? src1 : min(255, (src2 * src2 / (255 - src1)))
-BVBLEND_PHOENIX min(src1, src2) - max(src1, src2) + 255)
-BVBLEND_ALPHA alf * src1 + (1 - alf) * src2)</code></pre>
- </td>
- </tr>
-</table>
-<a name="filter" class="Code_Header_2">bvbltparams.op.filter</a>
-<p class="code_block">struct bvfilter *filter; /* input */</p>
-<p>When <span class="inline_code"><a href="#BVFLAG_FILTER">BVFLAG_FILTER</a></span> is set in the
-<span class="inline_code"><a href="#flags">bvbltparams.flags</a></span> member, the <span class="inline_code">
-<a href="#op">bvbltparams.op</a></span> union is treated as a <span class="inline_code">filter</span>.</p>
-<p>To specify the filter, the client fills in <span class="inline_code">filter</span> with one of the
-<span class="inline_code">bvfilter</span> values.</p>
-<p>These values will be extended as general filter types are requested.</p>
-<a name="colorkey" class="Code_Header_2">bvbltparams.colorkey</a>
-<p class="code_block">void *colorkey; /* input */</p>
-<p>When either <span class="inline_code"><a href="#BVFLAG_KEY_SRC">BVFLAG_KEY_SRC</a></span> or
-<span class="inline_code"><a href="#BVFLAG_KEY_DST">BVFLAG_KEY_DST</a></span> is set in the <span class="inline_code">
-<a href="#flags">bvbltparams.flags</a></span> member, <span class="inline_code">colorkey</span> points to a single pixel
-used as the color key.</p>
-<p>The format of this pixel matches the surface being keyed.&nbsp; i.e. <span class="inline_code"><a href="#bvsurfgeom">
-src1geom.format</a></span> is the format of the color key if <span class="inline_code">BVFLAG_KEY_SRC</span> is set, or
-<span class="inline_code"><a href="#bvsurfgeom">dst.format</a></span> is the format of the color key if
-<span class="inline_code">BVFLAG_KEY_DST</span> is set.</p>
-<p><em>Subsampled formats do not currently support color keying.</em></p>
-<p class="Code_Header_2"><a name="globalalpha">bvbltparams.globalalpha</a></p>
-<p class="code_block">union bvalpha globalalpha; /* input */</p>
-<p>When <span class="inline_code"><a href="#BVFLAG_BLEND">BVFLAG_BLEND</a></span> is set in the
-<span class="inline_code"><a href="#flags">bvbltparams.flags</a></span>, and when the <span class="inline_code">
-<a href="#blend">blend</a></span> chosen requires it, <span class="inline_code">globalalpha</span> is used to provide an
-alpha blending value for the entire operation.&nbsp; The type is also dependent on the <span class="inline_code">
-<a href="#blend">blend</a></span> chosen.</p>
-<p>For the <span class="inline_code">BVBLENDDEF_FORMAT_CLASSIC</span> blend types, if the <span class="inline_code">BVBLENDDEF_GLOBAL_MASK</span>
-field is not 0, this field is used.&nbsp; Currently <span class="inline_code">BVBLENDDEF_FORMAT_CLASSIC</span> provides
-for an 8-bit (unsigned character / byte) format designated by <span class="inline_code">BVBLENDDEF_GLOBAL_UCHAR</span> as
-well as a 32-bit floating point format designated by <span class="inline_code">BVBLENDDEF_GLOBAL_FLOAT</span>.</p>
-<p class="Code_Header_2"><a name="scalemode">bvbltparams.scalemode</a></p>
-<p class="code_block">enum bvscalemode scalemode; /* input/output */</p>
-<p>This member allows the client to specify the type of scaling to be used.&nbsp; The enumeration begins with 8 bits indicating
-the vendor.&nbsp; The remaining bits are defined by the vendor.&nbsp; <span class="inline_code">BVSCALEDEF_VENDOR_ALL</span>
-and <span class="inline_code">BVSCALEDEF_VENDOR_GENERAL</span> are shared by all implementations.</p>
-<p><span class="inline_code">BVSCALEDEF_VENDOR_ALL</span> can be used to specify an implicit scale type.&nbsp; This type
-is converted to an explicit type by the implementation:</p>
-<table class="indent">
- <tr>
- <td class="inline_code">BVSCALE_FASTEST</td>
- <td>The fastest method of scaling available is used.&nbsp; This may include nearest neighbor.&nbsp; The value of
- this enumeration is purposely 0, and is the default scale type.&nbsp; No implementation will return an error for
- this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_FASTEST_NOT_NEAREST_NEIGHBOR</td>
- <td>The fastest method of scaling available that is not nearest neighbor is used.&nbsp; This may include an alternative
- point sample technique.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_FASTEST_POINT_SAMPLE</td>
- <td>The fastest method of scaling using a point sample technique.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_FASTEST_INTERPOLATED</td>
- <td>The fastest method of scaling using an interpolation technique.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_FASTEST_PHOTO</td>
- <td>The fastest method of scaling appropriate for photographs is used.&nbsp; This may include nearest neighbor.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_FASTEST_DRAWING</td>
- <td>The fastest method of scaling appropriate for drawings is used.&nbsp; This may include nearest neighbor.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_GOOD</td>
- <td>A scaling technique is chosen that may be higher quality than the <span class="inline_code">BVSCALE_FASTEST</span>
- choice.&nbsp; This may include nearest neighbor.&nbsp; No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_GOOD_POINT_SAMPLE</td>
- <td>A point sample scaling technique is chosen that may be higher quality than the <span class="inline_code">BVSCALE_FASTEST_POINT_SAMPLE</span>
- choice.&nbsp; This may include nearest neighbor.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_GOOD_INTERPOLATED</td>
- <td>An interpolated scaling technique is chosen that may be higher quality than the <span class="inline_code">BVSCALE_FASTEST_INTERPOLATED</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_GOOD_PHOTO</td>
- <td>A scaling technique appropriate for photographs is chosen that may be higher quality than the
- <span class="inline_code">BVSCALE_FASTEST_PHOTO</span> choice.&nbsp; This may include nearest neighbor.&nbsp; No
- implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_GOOD_DRAWING</td>
- <td>A scaling technique appropriate for drawings is chosen that may be higher quality than the
- <span class="inline_code">BVSCALE_FASTEST_DRAWING</span> choice.&nbsp; This may include nearest neighbor.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BETTER</td>
- <td>A scaling technique is chosen that may be higher quality than the <span class="inline_code">BVSCALE_GOOD</span>
- choice.&nbsp; This may include nearest neighbor.&nbsp; No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BETTER_POINT_SAMPLE</td>
- <td>A point sample scaling technique is chosen that may be higher quality than the <span class="inline_code">BVSCALE_GOOD_POINT_SAMPLE</span>
- choice.&nbsp; This may include nearest neighbor.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BETTER_INTERPOLATED</td>
- <td>An interpolated scaling technique is chosen that may be higher quality than the <span class="inline_code">BVSCALE_GOOD_INTERPOLATED</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BETTER_PHOTO</td>
- <td>A scaling technique appropriate for photographs is chosen that may be higher quality than the
- <span class="inline_code">BVSCALE_GOOD_PHOTO</span> choice.&nbsp; This may include nearest neighbor.&nbsp; No implementation
- will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BETTER_DRAWING</td>
- <td>A scaling technique appropriate for drawings is chosen that may be higher quality than the
- <span class="inline_code">BVSCALE_GOOD_DRAWING</span> choice.&nbsp; This may include nearest neighbor.&nbsp; No
- implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BEST</td>
- <td>The highest quality scaling technique is chosen.&nbsp; This may include nearest neighbor.&nbsp; No implementation
- will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BEST_POINT_SAMPLE</td>
- <td>The highest quality point sample technique is chosen.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BEST_INTERPOLATED</td>
- <td>The highest quality interpolated scaling technique is chosen.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BEST_PHOTO</td>
- <td>The highest quality scaling technique appropriate for photographs is chosen.&nbsp; This may include nearest
- neighbor.&nbsp; No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BEST_DRAWING</td>
- <td>The highest quality scaling technique appropriate for drawings is chosen.&nbsp; This may include nearest neighbor.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
-</table>
-<br />
-<span class="inline_code">BVSCALEDEF_VENDOR_GENERAL</span> can be used to specify one of the shared explicit scale types.&nbsp;
-At this point, only a limited number of explicit scale types are defined: <br />
-<br />
-<table class="indent">
- <tr>
- <td class="inline_code">BVSCALE_NEAREST_NEIGHBOR</td>
- <td>This is a point sample scaling technique where the resampled destination pixel is set to the value of the closest
- source pixel.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BILINEAR</td>
- <td>This is an interpolated scaling technique where the resampled destination pixel is set to a value linearly interpolated
- in two dimensions from the four closest source pixels.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_BICUBIC</td>
- <td>This is an interpolated scaling technique where the resampled destination pixel is set to a value calculated
- using cubic interpolation in two dimensions.</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_3x3_TAP</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_5x5_TAP</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_7x7_TAP</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td class="inline_code">BVSCALE_9x9_TAP</td>
- <td>&nbsp;</td>
- </tr>
-</table>
-<p>If the client wants to know the explicit type chosen by a given implementation, it can set <span class="inline_code">
-BVFLAG_SCALE_RETURN</span> in the <span class="inline_code"><a href="#flags">bvbltparams.flags</a></span> member, and the
-explicit scale type is returned in the <span class="inline_code">scalemode</span> member.</p>
-<p class="note">NOTE:&nbsp; Extending the <span class="inline_code">BVSCALEDEF_VENDOR_GENERAL</span> scale types or obtaining
-a vendor ID can be accomplished by submitting a patch.</p>
-<p class="Code_Header_2"><a name="dithermode">bvbltparams.dithermode</a></p>
-<p class="code_block">enum bvdithermode dithermode; /* input/output */</p>
-<p>This member allows the client to specify the type of dithering to be used, when the output format has fewer bits of depth
-than the internal calculation.&nbsp; The enumeration begins with 8 bits indicating the vendor.&nbsp; The remaining bits
-are defined by the vendor.&nbsp; <span class="inline_code">BVDITHERDEF_VENDOR_ALL</span> and <span class="inline_code">BVDITHERDEF_VENDOR_GENERAL</span>
-are shared by all implementations.</p>
-<p><span class="inline_code">BVDITHERDEF_VENDOR_ALL</span> can be used to specify an implicit dither type.&nbsp; This type
-is converted to an explicit type by the implementation:</p>
-<table class="indent">
- <tr>
- <td class="inline_code">BVDITHER_FASTEST</td>
- <td>The fastest method of dithering available is used.&nbsp; This may include no dithering (truncation).&nbsp; The
- value of this enumeration is purposely 0, and is the default dither type.&nbsp; No implementation will return an
- error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_FASTEST_ON</td>
- <td>The fastest method of dithering available is used.&nbsp; This will not include no dithering.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_FASTEST_RANDOM</td>
- <td>The fastest method of dithering using a random technique.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_FASTEST_ORDERED</td>
- <td>The fastest method of dithering using an ordered diffusion technique.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_FASTEST_DIFFUSED</td>
- <td>The fastest method of dithering using an error diffusion technique.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_FASTEST_PHOTO</td>
- <td>The fastest method of dithering appropriate for photographs is used.&nbsp; This may include no dithering.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_FASTEST_DRAWING</td>
- <td>The fastest method of dithering appropriate for drawings is used.&nbsp; This may include no dithering.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD</td>
- <td>A dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_FASTEST</span>
- choice.&nbsp; This may include no dithering.&nbsp; No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD_ON</td>
- <td>Any dithering technique available is used.&nbsp; This will not include no dithering.&nbsp; This may be higher
- quality than <span class="inline_code">BVDITHER_FASTEST_ON</span>.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD_RANDOM</td>
- <td>A random dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_FASTEST_RANDOM</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD_ORDERED</td>
- <td>An ordered dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_FASTEST_ORDERED</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD_DIFFUSED</td>
- <td>A diffused dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_FASTEST_DIFFUSED</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD_PHOTO</td>
- <td>A dithering technique appropriate for photographs is chosen that may be higher quality than the
- <span class="inline_code">BVDITHER_FASTEST_PHOTO</span> choice.&nbsp; This may include no dithering.&nbsp; No implementation
- will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_GOOD_DRAWING</td>
- <td>A dithering technique appropriate for drawings is chosen that may be higher quality than the
- <span class="inline_code">BVDITHER_FASTEST_DRAWING</span> choice.&nbsp; This may include no dithering.&nbsp; No
- implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER</td>
- <td>A dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_GOOD</span>
- choice.&nbsp; This may include no dithering.&nbsp; No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER_ON</td>
- <td>Any dithering technique available is used.&nbsp; This will not include no dithering.&nbsp; This may be higher
- quality than <span class="inline_code">BVDITHER_GOOD_ON</span>.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER_RANDOM</td>
- <td>A random dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_GOOD_RANDOM</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER_ORDERED</td>
- <td>An ordered dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_GOOD_ORDERED</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER_DIFFUSED</td>
- <td>A diffused dithering technique is chosen that may be higher quality than the <span class="inline_code">BVDITHER_GOOD_DIFFUSED</span>
- choice.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER_PHOTO</td>
- <td>A scaling technique appropriate for photographs is chosen that may be higher quality than the
- <span class="inline_code">BVSCALE_GOOD_PHOTO</span> choice.&nbsp; No implementation will return an error for this
- setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BETTER_DRAWING</td>
- <td>A scaling technique appropriate for drawings is chosen that may be higher quality than the
- <span class="inline_code">BVSCALE_GOOD_DRAWING</span> choice.&nbsp; No implementation will return an error for this
- setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST</td>
- <td>The highest quality dithering technique is chosen.&nbsp; This may include no dithering.&nbsp; No implementation
- will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST_ON</td>
- <td>Any dithering technique available is used.&nbsp; This will not include no dithering.&nbsp; This may be higher
- quality than <span class="inline_code">BVDITHER_BEST_ON</span>.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST_RANDOM</td>
- <td>The highest quality random dithering technique is chosen.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST_ORDERED</td>
- <td>The highest quality ordered dithering technique is chosen.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST_DIFFUSED</td>
- <td>The highest quality diffused dithering technique is chosen.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST_PHOTO</td>
- <td>The highest quality dithering technique appropriate for photographs is chosen.&nbsp; This may include no dithering.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_BEST_DRAWING</td>
- <td>The highest quality dithering technique appropriate for drawings is chosen.&nbsp; This may include no dithering.&nbsp;
- No implementation will return an error for this setting.</td>
- </tr>
-</table>
-<br />
-<span class="inline_code">BVDITHERDEF_VENDOR_GENERAL</span> can be used to specify one of the shared explicit dithering
-types.&nbsp; At this point, only a limited number of explicit dither types are defined:<br />
-<br />
-<table class="indent">
- <tr>
- <td class="inline_code">BVDITHER_NONE</td>
- <td>No dithering is performed.&nbsp; Internal pixel component values are truncated to the destination component
- bit depth.</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_ORDERED_2x2</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_ORDERED_4x4</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td class="inline_code">BVDITHER_ORDERED_2x2_4x4</td>
- <td>2x2 ordered dither is used for components with the lowest bit reduction.&nbsp; 4x4 ordered dither is used for
- the components with the highest bit reduction.&nbsp; (E.g. RGB24 to RGB565 will use 2x2 ordered dither for the green
- component and 4x4 ordered dither for the red and blue components.)</td>
- </tr>
-</table>
-<p>If the client wants to know the explicit type chosen by a given implementation, it can set <span class="inline_code">
-BVFLAG_DITHER_RETURN</span> in the <span class="inline_code"><a href="#flags">bvbltparams.flags</a></span> member, and the
-explicit scale type is returned in the <span class="inline_code">dithermode</span> member.</p>
-<p class="note">NOTE:&nbsp; Extending the <span class="inline_code">BVDITHERDEF_VENDOR_GENERAL</span> scale types or obtaining
-a vendor ID can be accomplished by submitting a patch.</p>
-<p class="Code_Header_2"><a name="dstdesc">bvbltparams.dstdesc</a></p>
-<p class="code_block"><a href="#bvbuffdesc">struct bvbuffdesc</a> *dstdesc;</p>
-<p><span class="inline_code">dstdesc</span> is used to specify the destination buffer.&nbsp; If the buffer has not been
-mapped with a call to <span class="inline_code"><a href="#bv_map">bv_map()</a></span>, <span class="inline_code">
-<a href="#bv_blt">bv_blt()</a></span> will map the buffer as necessary to perform the BLT and then unmap afterwards.&nbsp;
-See <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> for details.</p>
-<p class="Code_Header_2"><a name="dstgeom">bvbltparams.dstgeom</a></p>
-<p class="code_block"><a href="#bvsurfgeom">struct bvsurfgeom</a> *dstgeom;</p>
-<p><span class="inline_code">dstgeom</span> is used to specify the geometry of the surface contained in the destination
-buffer.&nbsp; See <span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> for details.</p>
-<p class="Code_Header_2"><a name="dstrect">bvbltparams.dstrect</a></p>
-<p class="code_block"><a href="#bvrect">struct bvrect</a> dstrect;</p>
-<p><span class="inline_code">dstrect</span> is used to specify the destination rectangle to receive the BLT.&nbsp; This
-rectangle is clipped by <span class="inline_code"><a href="#cliprect">bvbltparams.cliprect</a></span> when
-<span class="inline_code"><a href="#BVFLAG_CLIP">BVFLAG_CLIP</a></span> is set in the <span class="inline_code">
-<a href="#flags">bvbltparams.flags</a></span> member.</p>
-<p class="Code_Header_2">bvbltparams.<a name="src1.desc">src1</a>/<a name="src2.desc">src2</a>/<a name="mask.desc">mask.desc</a></p>
-<p class="code_block"><a href="#bvbuffdesc">struct bvbuffdesc</a> *src1.desc;<br />
-<a href="#bvbuffdesc">struct bvbuffdesc</a> *src2.desc;<br />
-<a href="#bvbuffdesc">struct bvbuffdesc</a> *mask.desc;</p>
-<p>These members are used to identify the buffer for the source1, source2, and mask surfaces when the associated
-<span class="inline_code">BVFLAG_TILE_*</span> flag is not set.&nbsp; The buffer is the memory in which the surface lies.&nbsp;
-See the <span class="inline_code"><a href="#src1geom">bvbltparams.src1/src2/maskgeom</a></span> for the format and layout/geometry
-of the surface.</p>
-<p class="note">NOTE WELL:&nbsp; Clients should never change the value of a <span class="inline_code">
-<a href="#bvbuffdesc">bvbuffdesc</a></span> structure while a buffer is mapped.</p>
-<p class="Code_Header_2">bvbltparams.<a name="src1.tileparams">src1</a>/<a name="src2.tileparams">src2</a>/<a name="mask.tileparams">mask.tileparams</a></p>
-<p class="code_block"><a href="#bvtileparams">struct bvtileparams</a> *src1.tileparams;<br />
-<a href="#bvtileparams">struct bvtileparams</a> *src2.tileparams;<br />
-<a href="#bvtileparams">struct bvtileparams</a> *mask.tileparams;</p>
-<p>These members are used to identify the buffer for the source1, source2, and mask surfaces when the associated
-<span class="inline_code">BVFLAG_TILE_*</span> flag is set.&nbsp; The buffer is the memory in which the surface lies.&nbsp;
-This differs from the <span class="inline_code"><a href="#src1.desc">src1/src2/mask.desc</a></span> identity by providing
-more information needed for tiling and by not requiring mapping (for hardware implementations that support tiling, the tile
-data is usually moved into an on-chip cache).</p>
-<p class="Code_Header_2">bvbltparams.<a name="src1geom">src1</a>/<a name="src2geom">src2</a>/<a name="maskgeom">maskgeom</a></p>
-<p class="code_block"><a href="#bvsurfgeom">struct bvsurfgeom</a> src1geom;<br />
-<a href="#bvsurfgeom">struct bvsurfgeom</a> src2geom;<br />
-<a href="#bvsurfgeom">struct bvsurfgeom</a> maskgeom;</p>
-<p>These members describe the format and layout/geometry of their respective surfaces.&nbsp; Separating
-<span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> from the <span class="inline_code">
-<a href="#bvbuffdesc">bvbuffdesc</a></span> allows easy use of buffers for multiple geometries without remapping.&nbsp;
-See <span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> and <span class="inline_code">
-<a href="#bvbuffdesc">bvbuffdesc</a></span> for details.</p>
-<p class="Code_Header_2">bbvbltparams.src1/src2/maskrect</p>
-<p class="code_block"><a href="#bvrect">struct bvrect</a> src1rect;<br />
-<a href="#bvrect">struct bvrect</a> src2rect;<br />
-<a href="#bvrect">struct bvrect</a> maskrect;</p>
-<p>These members specify the rectangle from which data is read for the BLT.&nbsp; These rectangles are clipped by a scaled
-version of the <span class="inline_code"><a href="#cliprect">bvbltparams.cliprect</a></span>&nbsp; (scaling is based on
-the relationship between them and the <span class="inline_code"><a href="#dstrect">bvbltparams.dstrect</a></span>) when
-<span class="inline_code"><a href="#BVFLAG_CLIP">BVFLAG_CLIP</a></span> is set in the <span class="inline_code">
-<a href="#flags">bvbltparams.flags</a></span> member.</p>
-<table class="example">
- <tr>
- <td>
- <p><strong>Example:</strong></p>
- <a href="#src1rect" class="inline_code">src1rect</a> = (0, 0) - (400 x 200)<br />
- <a href="#dstrect" class="inline_code">dstrect</a> = (0, 0) - (800 x 600)<br />
- <a href="#cliprect" class="inline_code">cliprect</a> = (10, 30) - (300 x 300)<p>The scaling ratio of the
- <a href="#dstrect" class="inline_code">dstrect</a> to the <a href="#src1rect" class="inline_code">src1rect</a> is
- (800/400,&nbsp; 600/300) or (2, 3).&nbsp; Using this, the effective source 1 clipping rectangle becomes (10/2, 30/3)
- - (300/2 x 300/3) or (5, 10) - (150 x 100).</p>
- </td>
- </tr>
-</table>
-<p>This approach allows fractional clipping at the source using a method which is simpler to implement than fractional coordinates.</p>
-<p class="note">NOTE:&nbsp; In BLTsville, reading outside the source rectangle is forbidden.&nbsp; So scaling algorithms
-which require pixels around a particular source pixel must utilize boundary techniques (mirror, repeat, clamp, etc.) at
-the edges of the source rectangle.&nbsp; However, if the clipping rectangle, when translated back to the source rectangle,
-leaves space between it and the source rectangle, pixels outside the clipped region may be accessed by the implementation.</p>
-<p class="Code_Header_2"><a name="cliprect">bvbltparams.cliprect</a></p>
-<p class="code_block"><a href="#bvrect">struct bvrect</a> cliprect;</p>
-<p><span class="inline_code">cliprect</span> is used to specify a rectangle that limits what region of the destination is
-written.&nbsp; This is most useful for scaling operations, where the necessary scaling factor will not allow translation
-of the destination rectangle back to the source on an integer pixel boundary.</p>
-<p class="note">NOTE:&nbsp; If <span class="inline_code">cliprect</span> exceeds the destination surface, the behavior is
-undefined. </p>
-<p>For example, if the goal is to show a 640 x 480 video on a 1920 x 1080 screen, the video would be stretched to 1440 x
-1080 to maintain the proper aspect ratio.&nbsp; So the relevant rectangles would be:</p>
-<table class="indent">
- <tr>
- <td class="thin_bord"><strong>src1rect</strong></td>
- <td class="thin_bord"><strong>dstrect</strong></td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 0) - 640 x 480</td>
- <td class="thin_bord">(240, 0) - 1440 x 1080</td>
- </tr>
-</table>
-<p>However, to handle a 640 x 480 pop-up window that appears centered on the screen, in front of the video, the single BLT
-may be broken into four smaller BLTs pieced around the popup.&nbsp; These rectangles would need to be:</p>
-<table class="indent">
- <tr>
- <td class="thin_bord"><strong>src1rect</strong></td>
- <td class="thin_bord"><strong>dstrect</strong></td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 0) - 640 x 133.333...</td>
- <td class="thin_bord">(240, 0) - 1440 x 300</td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 133.333...) - 284.444... x 213.333...</td>
- <td class="thin_bord">(240, 300) - 400 x 480</td>
- </tr>
- <tr>
- <td class="thin_bord">(568.888..., 133.333...) - 284.444... x 213.333...</td>
- <td class="thin_bord">(1280, 300) - 400 x 480</td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 346.666...) - 640 x 133.333...</td>
- <td class="thin_bord">(240, 780) - 1440 x 300</td>
- </tr>
-</table>
-<p>Since this is a scaling factor of 2.25x, translating the required destination rectangles back to the source results in
-non-integer coordinates and dimensions, as illustrated above.&nbsp; And adjusting the source rectangles to the nearest integer
-values will result in visible discontinuities at the boundaries between the rectangles.</p>
-<p>Instead, using the <span class="inline_code">cliprect</span>, this situation can be handled more easily:</p>
-<table class="indent">
- <tr>
- <td class="thin_bord"><strong>src1rect</strong></td>
- <td class="thin_bord"><strong>dstrect</strong></td>
- <td class="thin_bord"><strong>cliprect</strong></td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 0) - 640 x 480</td>
- <td class="thin_bord">(240, 0) - 1440 x 1080</td>
- <td class="thin_bord">(240, 0) - 1440 x 300</td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 0) - 640 x 480</td>
- <td class="thin_bord">(240, 0) - 1440 x 1080</td>
- <td class="thin_bord">(240, 300) - 400 x 480</td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 0) - 640 x 480</td>
- <td class="thin_bord">(240, 0) - 1440 x 1080</td>
- <td class="thin_bord">(1280, 300) - 400 x 480</td>
- </tr>
- <tr>
- <td class="thin_bord">(0, 0) - 640 x 480</td>
- <td class="thin_bord">(240, 0) - 1440 x 1080</td>
- <td class="thin_bord">(240, 780) - 1440 x 300</td>
- </tr>
-</table>
-<p class="Code_Header_2"><a name="batchflags">bvbltparams.batchflags</a></p>
-<p class="code_block">unsigned long batchflags;</p>
-<p><span class="inline_code">batchflags</span> are used by the client as a hint to indicate to the implementation which
-parameters are changing between successive BLTs of a batch.&nbsp; The flags may be used when the
-<span class="inline_code"><a href="#flags">bvbltparams.flags</a></span> has <span class="inline_code">
-<a href="#BVFLAG_BATCH_CONTINUE">BVFLAG_BATCH_CONTINUE</a></span> or <span class="inline_code">
-<a href="#BVFLAG_BATCH_END">BVFLAG_BATCH_END</a></span> set.</p>
-<table style="" class="indent">
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_OP">BVBATCH_OP</a></span></td>
- <td>indicates that the operation type (<span class="inline_code"><a href="#BVFLAG_ROP">BVFLAG_ROP</a></span>,
- <span class="inline_code"><a href="#BVFLAG_BLEND">BVFLAG_BLEND</a></span>, <span class="inline_code">
- <a href="#BVFLAG_FILTER">BVFLAG_FILTER</a></span>, etc.) has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_KEY">BVBATCH_KEY</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#colorkey">bvbltparams.colorkey</a></span> or the color
- key mode (<span class="inline_code"><a href="#BVFLAG_KEY_SRC">BVFLAG_KEY_SRC</a></span>/<span class="inline_code"><a href="#BVFLAG_KEY_DST">BVFLAG_KEY_DST</a></span>)
- has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_MISCFLAGS">BVBATCH_MISCFLAGS</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#flags">bvbltparams.flags</a></span> other than the operation,
- color key, or clip flag have changes.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_ALPHA">BVBATCH_ALPHA</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#globalalpha">bvbltparams.globalalpha</a></span> or global
- alpha type has changed.</td>
- </tr>
- <tr>
- <td><a name="BVBATCH_DITHER" class="inline_code">BVBATCH_DITHER</a></td>
- <td>indicates that <span class="inline_code"><a href="#dithermode">bvbltparams.dithermode</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SCALE">BVBATCH_SCALE</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#scalemode">bvbltparams.scalemode</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_DST">BVBATCH_DST</a></span></td>
- <td>indicates that the destination surface (<span class="inline_code"><a href="#dstdesc">bvbltparams.dstdesc</a></span>,
- <span class="inline_code"><a href="#dstgeom">bvbltparams.dstgeom</a></span> ,or <span class="inline_code">
- <a href="#dstrect">bvbltparams.dstrect</a></span>) has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SRC1">BVBATCH_SRC1</a></span> </td>
- <td>indicates that the source 1 surface (<span class="inline_code"><a href="#src1.desc">bvbltparams.src1.desc</a></span>
- or <span class="inline_code"><a href="#src1.tileparams">bvbltparams.src1.tileparams</a></span>, or
- <span class="inline_code"><a href="#src1geom">bvbltparams.src1geom</a></span>) has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SRC2">BVBATCH_SRC2</a></span> </td>
- <td>indicates that the source 2 surface (<span class="inline_code"><a href="#src2.desc">bvbltparams.src2.desc</a></span>
- or <span class="inline_code"><a href="#src2.tileparams">bvbltparams.src2.tileparams</a></span>, or
- <span class="inline_code"><a href="#src2geom">bvbltparams.src2geom</a></span>) has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_MASK">BVBATCH_MASK</a></span> </td>
- <td>indicates that the mask surface (<span class="inline_code"><a href="#mask.desc">bvbltparams.mask.desc</a></span>
- or <span class="inline_code"><a href="#mask.tileparams">bvbltparams.mask.tileparams</a></span>, or
- <span class="inline_code"><a href="#maskgeom">bvbltparams.maskgeom</a></span>) has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_DSTRECT_ORIGIN">BVBATCH_DSTRECT_ORIGIN</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#dstrect">bvbltparams.dstrect.left</a></span> or
- <span class="inline_code"><a href="#dstrect">top</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_DSTRECT_SIZE">BVBATCH_DSTRECT_SIZE</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#dstrect">bvbltparams.dstrect.width</a></span> or
- <a href="#dstrect">height</a> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SRC1RECT_ORIGIN">BVBATCH_SRC1RECT_ORIGIN</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#src1rect">bvbltparams.src1rect.left</a></span> or
- <span class="inline_code"><a href="#dstrect">top</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SRC1RECT_SIZE">BVBATCH_SRC1RECT_SIZE</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#src1rect">bvbltparams.src1rect.width</a></span> or
- <a href="#src1rect">height</a> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SRC2RECT_ORIGIN">BVBATCH_SRC2RECT_ORIGIN</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#src2rect">bvbltparams.src2rect.left</a></span> or
- <span class="inline_code"><a href="#src2rect">top</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_SRC2RECT_SIZE">BVBATCH_SRC2RECT_SIZE</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#src2rect">bvbltparams.src2rect.width</a></span> or
- <a href="#src2rect">height</a> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_MASKRECT_ORIGIN">BVBATCH_MASKRECT_ORIGIN</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#maskrect">bvbltparams.maskrect.left</a></span> or
- <span class="inline_code"><a href="#maskrect">top</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_MASKRECT_SIZE">BVBATCH_MASKRECT_SIZE</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#maskrect">bvbltparams.maskrect.width</a></span> or
- <a href="#maskrect">height</a> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_CLIPRECT_ORIGIN">BVBATCH_CLIPRECT_ORIGIN</a></span></td>
- <td>indicates that <span class="inline_code"><a href="#cliprect">bvbltparams.cliprect.left</a></span> or
- <span class="inline_code"><a href="#cliprect">top</a></span> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_CLIPRECT_SIZE">BVBATCH_CLIPRECT_SIZE</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#cliprect">bvbltparams.cliprect.width</a></span> or
- <a href="#cliprect">height</a> has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_TILE_SRC1">BVBATCH_TILE_SRC1</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#src1.tileparams">bvbltparams.src1.tileparams</a></span>
- has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_TILE_SRC2">BVBATCH_TILE_SRC2</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#src2.tileparams">bvbltparams.src2.tileparams</a></span>
- has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_TILE_MASK">BVBATCH_TILE_MASK</a></span></td>
- <td>indicates that the <span class="inline_code"><a href="#mask.tileparams">bvbltparams.mask.tileparams</a></span>
- has changed.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVBATCH_ENDNOP">BVBATCH_ENDNOP</a></span></td>
- <td>is a special flag used with <span class="inline_code"><a href="#batch_end">BVFLAG_BATCH_END</a></span>, for
- clients that do not have information that a batch is ending until after the last BLT has been issued.&nbsp; When
- this flag is set, no BLT is done, but the batch is ended.</td>
- </tr>
-</table>
-<p class="note">NOTE:&nbsp; These flags are hints, and may be used or not by a BLTsville implementation.&nbsp; So if
-<span class="inline_code"><a href="#bvbltparams">bvbltparams</a></span> members are changed between BLTs in a batch, but
-the <span class="inline_code">bvbltparams.batchflags</span> member is not correctly updated, the resulting behavior on different
-implementations will not be consistent.</p>
-<p class="Code_Header_2"><a name="batch">bvbltparams.batch</a></p>
-<p class="code_block"><a href="#bvbatch">struct bvbatch</a> *batch;</p>
-<p>This member is used as a batch handle, so that multiple batches can be under construction at the same time.</p>
-<p class="Code_Header_2"><a name="callbackfn">bvbltparams.callbackfn</a></p>
-<p class="code_block">void (*callbackfn)(<a href="#bvcallbackerror">struct bvcallbackerror</a> *err, unsigned long
-<a href="#callbackdata">callbackdata</a>);</p>
-<p>This member is a pointer to a client-supplied function which is called by the implementation when
-<span class="inline_code"><a href="#BVFLAG_ASYNC">BVFLAG_ASYNC</a></span> is set and the BLT is complete.&nbsp; If this
-member is NULL, no callback is performed.&nbsp; When there is no error, the <span class="inline_code">err</span>
-parameter will be set to 0;</p>
-<p class="note">NOTE:&nbsp; This function <span class="underline">can be called</span> before the
-<span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> call has returned.</p>
-<p class="Code_Header_2"><a name="callbackdata">bvbltparams.callbackdata</a></p>
-<p class="code_block">unsigned long callbackdata;</p>
-<p>This member is used as the parameter passed back by the <span class="inline_code"><a href="#callbackfn">bvbltparams.callbackfn</a></span>.&nbsp;
-This can be anything from an identifying index to a pointer used by the client.</p>
-<p class="Code_Header_2">bvbltparams.<a name="src2auxdstrect">src2</a>/<a name="maskauxdstrect">maskauxdstrect</a></p>
-<p class="code_block">struct bvrect src2auxdstrect;<br />
-struct bvrect maskauxdstrect;</p>
-<p>These two members are used only when the associated <span class="inline_code"><a href="#BVFLAG_SRC2_AUXDSTRECT">
-BVFLAG_SRC2</a></span>/<span class="inline_code"><a href="#BVFLAG_MASK_AUXDSTRECT">MASK_AUXDSTRECT</a></span> flags are
-set.&nbsp; They are only necessary (and should only be used) in the case where scaling of the inputs differs and the
-entire source images are not being used.&nbsp; <span class="inline_code"><a href="#dstrect">bvbltparams.dstrect</a></span> is always
-used to specify the destination of source 1 image.&nbsp; When the associated flags are set, these two members are used
-to specify the destination of the source 2 and mask images, instead of <span class="inline_code"><a href="#dstrect">
-bvbltparams.dstrect</a></span>.</p>
-<p>These flags must be used with the <span class="inline_code"><a href="#BVFLAG_CLIP">BVFLAG_CLIP</a></span> flag.&nbsp;
-And if the resulting clipped destination does not include all enabled destination rectangles, the results are undefined.</p>
-<div class="example"><strong>Example:</strong>&nbsp; We have two images that we want to merge and view on an 854x480 LCD panel.&nbsp; One
-image is a small background image with 16:9 (64x36) aspect ratio that we want to stretch to fill the screen.&nbsp;
-The other is a standard definition 720x480 (4:3 aspect ratio) image with transparency we want to blend on top of our
-background.<br />
-<table align="center">
- <tr>
- <td>
- <table>
- <tr>
- <td class="ctr"><img alt="" src="concrete-64x36.png" width="64" height="36" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown actual size)</td>
- </tr>
- </table>
- </td>
- <td>
- <table class="ctr">
- <tr>
- <td><img alt="" src="clock-720x480_4x3-fauxtrans.jpg" width="360" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x; not adjusted for aspect ratio)</td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-We want to blend the second image onto the center of the first, scaling both, so that it looks like this:<br />
-<table align="center">
- <tr>
- <td><img alt="" src="blend-854x480.jpg" width="427" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x)</td>
- </tr>
-</table>
-The screen is effectively a 16:9 aspect ratio (we can ignore the fraction of a pixel here), which matches our
-background image.&nbsp; So the background image just needs to be scaled from 64x36 to 854x480.<br />
-<br />
- However, since the second image has a 4:3 aspect ratio, it will not cover the entire background image if we want to
- maintain its aspect ratio.&nbsp; Our second image is not as wide as our 16:9 image, which means it&#39;s height will match
- the screen height, but the width will be smaller.&nbsp; Since the screen is 480 lines (pixels) high, to maintain our 4:3
- aspect ratio, our second image will need to be 640 pixels wide (4 * 480 / 3).&nbsp; So it will need to be scaled from
- 720x480 to 640x480.<br />
-<br />
-As we mentioned, we would like to center the 640 pixel image on our 854 pixel wide screen.&nbsp; That means the left edge
-of the image will be at pixel 107 ( (854 - 640) / 2 ).&nbsp; So the leftmost 107 columns of pixels will just be a copy
-of the left portion of the background image.&nbsp; Likewise, the rightmost 107 columns will be a copy of the right
-portion of the background image.&nbsp; Only the middle section should be blended.<br />
-<table align="center">
- <tr>
- <td><img alt="" src="blend-854x480-threeblts.jpg" width="427" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x)</td>
- </tr>
-</table>
- The side two BLTs are quite easy with BLTsville, by using the clipping rectangle:<br />
-<br />
-<table class="indent"><tr><td>
-<span class="inline_code">bvbltparams.flags = BVFLAG_ROP | BVFLAG_CLIP;<br />
-bvbltparams.op.rop = 0xCCCC;<br />
-<br />
-bvbltparams.src1.desc = bkgnddesc;<br />
-bvbltparams.src1geom = bkgndgeom;<br />
-bvbltparams.src1rect.left = 0;<br />
-bvbltparams.src1rect.top = 0;<br />
-bvbltparams.src1width = 64;<br />
-bvbltparams.src1height = 36;<br />
-<br />
-bvbltparams.dstdesc = screendesc;<br />
-bvbltparams.dstgeom = screengeom;<br />
-bvbltparams.dstrect.left = 0;<br />
-bvbltparams.dstrect.top = 0;<br />
-bvbltparams.dstrect.width = 854;<br />
-bvbltparams.dstrect.height = 480;<br />
-<br />
-bvbltparams.cliprect.left = 0;<br />
-bvbltparams.cliprect.top = 0;<br />
-bvbltparams.cliprect.width = 107;<br />
-bvbltparams.cliprect.height = 480;<br />
-bv_blt(&amp;bvbltparams);<br />
-<br />
-bvbltparams.cliprect.left += 640;<br />
-bv_blt(&amp;bvbltparams);</span></td></tr></table>
-<br />
- However, if we try the same approach with the middle BLT, we run into problems:<br />
-<br />
-<table class="indent"><tr><td>
-<span class="inline_code">bvbltparams.flags = BVFLAG_BLEND | BVFLAG_CLIP;<br />
-bvbltparams.op.blend = BVBLEND_SRC1OVER;<br />
-<br />
-bvbltparams.src1.desc = foregnddesc;<br />
-bvbltparams.src1geom = foregndgeom;<br />
-bvbltparams.src1rect.left = 0;<br />
-bvbltparams.src1rect.top = 0;<br />
-bvbltparams.src1rect.width = 720;<br />
-bvbltparams.src1rect.height = 480;<br />
-<br />
-bvbltparams.src2.desc = bkgnddesc;<br />
-bvbltparams.src2geom = bkgndgeom;<br />
-bvbltparams.src2rect.left = 0;<br />
-bvbltparams.src2rect.top = 0;<br />
-bvbltparams.src2width = 64;<br />
-bvbltparams.src2height = 36;<br />
-<br />
-bvbltparams.cliprect.left = 107;<br />
-bvbltparams.cliprect.top = 0;<br />
-bvbltparams.cliprect.width = 640;<br />
-bvbltparams.cliprect.height = 480;<br />
-bv_blt(&amp;bvbltparams);</span></td></tr></table>
-<table align="center">
- <tr>
- <td><img alt="" src="blend-854x480-bad.jpg" width="427" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x)</td>
- </tr>
-</table>
- The result is that the foreground image is stretched horizontally.&nbsp; That&#39;s because the scaling factor is
- derived from the source (1) rectangle and the destination rectangle, which is the full width of the screen.&nbsp;
- Since we were also scaling the background, we set the destination rectangle to cover the screen, as we did in the
- previous two BLTs.<br />
- <br />
- The edges of our foreground image are also cropped, since we were only modifying the middle of the screen.<br />
- <br />
- What if we change the destination rectangle?<br />
- <br />
-<table class="indent"><tr><td>
-<span class="inline_code">bvbltparams.dstrect.left = 107;<br />
-bvbltparams.dstrect.top = 0;<br />
-bvbltparams.dstrect.width = 640;<br />
-bvbltparams.dstrect.height = 480;<br />
-<br />
-bv_blt(&amp;bvbltparams);</span></td></tr></table>
-<table align="center">
- <tr>
- <td><img alt="" src="blend-854x480-bad2.jpg" width="427" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x)</td>
- </tr>
-</table>
- Here we get the proper scaling of the foreground image, but the background image is scaled improperly.<br />
- <br />
- What if we adjust the source rectangles?&nbsp;
-For our purposes, we want all of the foreground image, but we only need the middle of the background image.&nbsp; So
- we can manually specify the middle of the background image by modifying the source 2 rectangle:<br />
- <br />
-<table class="indent"><tr><td>
-<span class="inline_code">bvbltparams.src2rect.left = 107 * 64 / 854;<br />
-bvbltparams.src2rect.width = 640 * 64 / 854;</span></td></tr></table><br />
-Nice, but what are those values?<br />
-<br />
-<table class="indent"><tr><td>
-107 * 1280 / 854 = 8.0187...<br />
-640 * 1280 / 854 = 47.9625...<br />
-</td></tr></table>
-<br />
- In BLTsville, all rectangle parameters are expressed in integers (this also allows BLTsville to be used in the
- kernels where floating point variables are not allowed).&nbsp; The clipping rectangle then handles introducing the
- necessary source pixel subdivision (by translating the clipping rectangle back to the source rectangle in the
- implementation).&nbsp; So what happens if we actually do use these values as integers?<br />
-<br />
-<table class="indent"><tr><td>
-<span class="inline_code">bvbltparams.src2rect.left = 8;<br />
-bvbltparams.src2rect.top = 0;<br />
-bvbltparams.src2rect.width = 47;<br />
-bvbltparams.src2height = 36;<br />
-<br />
-bv_blt(&amp;bvbltparams);</span></td></tr></table>
-<br />
- And this is what we get:<br />
-<table align="center">
- <tr>
- <td><img alt="" src="blend-854x480-roundingerror.jpg" width="427" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x)</td>
- </tr>
-</table>
- Closer, but not quite.&nbsp; Rounding the values above to integers still results in visible errors at the boundaries
- between the middle and the side BLTs (the one on the right is a bit more visible at this reduced size, but if you
- view the full image, you&#39;ll see the left one as well), because the left edge and scaling (and right edge as a
- result) don&#39;t match the alignment and scaling done for the BLTs on the side.&nbsp; <p class="note">NOTE:&nbsp; This artifact is not always obvious in still images.&nbsp;
- The images here were chosen to make the artifacts obvious in this documentation.&nbsp; But even if the static images
- appear correct, movement of the images (e.g. moving the foreground image across the background image) or changes in
- the blending (e.g. fading the foreground image out and finally removing it), will show these less obvious
- discrepancies.</p>This is actually what the
- clipping rectangle is for.&nbsp; It&#39;s meant to allow us to always specify the source and destination rectangles the
- same, but move the clipping window around on the destination to get just the pixels we want.&nbsp; That way the
- scaling and alignment area always the same.&nbsp; Unfortunately, for this special case, we really need a way to
- specify different scaling factors for the different inputs.&nbsp; The src2auxdstrect (and maskauxdstrect, when
- needed) have been added to provide this capability.<br />
- <br />
- Here is how this set of BLTs can be done:<br />
-<br />
-<table class="indent"><tr><td>
-<span class="inline_code">bvbltparams.flags = BVFLAG_ROP | BVFLAG_CLIP;<br />
-bvbltparams.op.rop = 0xCCCC;<br />
-<br />
-bvbltparams.src1.desc = bkgnddesc;<br />
-bvbltparams.src1geom = bkgndgeom;<br />
-bvbltparams.src1rect.left = 0;<br />
-bvbltparams.src1rect.top = 0;<br />
-bvbltparams.src1width = 64;<br />
-bvbltparams.src1height = 36;<br />
-<br />
-bvbltparams.dstdesc = screendesc;<br />
-bvbltparams.dstgeom = screengeom;<br />
-bvbltparams.dstrect.left = 0;<br />
-bvbltparams.dstrect.top = 0;<br />
-bvbltparams.dstrect.width = 854;<br />
-bvbltparams.dstrect.height = 480;<br />
-<br />
-bvbltparams.cliprect.left = 0;<br />
-bvbltparams.cliprect.top = 0;<br />
-bvbltparams.cliprect.width = 107;<br />
-bvbltparams.cliprect.height = 480;<br />
-bv_blt(&amp;bvbltparams);<br />
-<br />
-bvbltparams.cliprect.left += 640;<br />
-bv_blt(&amp;bvbltparams);<br />
-<br />
-bvbltparams.flags = BVFLAG_BLEND | BVFLAG_CLIP | BVFLAG_SRC2_AUXDSTRECT;<br />
-bvbltparams.op.blend = BVBLEND_SRC1OVER;<br />
-<br />
-bvbltparams.src1.desc = foregnddesc;<br />
-bvbltparams.src1geom = foregndgeom;<br />
-bvbltparams.src1rect.left = 0;<br />
-bvbltparams.src1rect.top = 0;<br />
-bvbltparams.src1rect.width = 720;<br />
-bvbltparams.src1rect.height = 480;<br />
-<br />
-bvbltparams.dstrect.left = 107;<br />
-bvbltparams.dstrect.top = 0;<br />
-bvbltparams.dstrect.width = 640;<br />
-bvbltparams.dstrect.height = 480;<br />
-<br />
-bvbltparams.src2.desc = bkgnddesc;<br />
-bvbltparams.src2geom = bkgndgeom;<br />
-bvbltparams.src2rect.left = 0;<br />
-bvbltparams.src2rect.top = 0;<br />
-bvbltparams.src2width = 64;<br />
-bvbltparams.src2height = 36;<br />
-<br />
-bvbltparams.src2auxdstrect.left = 0;<br />
-bvbltparams.src2auxdstrect.top = 0;<br />
-bvbltparams.src2auxdstrect.width = 854;<br />
-bvbltparams.src2auxdstrect.height = 480;<br />
-<br />
-bvbltparams.cliprect.left = 107;<br />
-bvbltparams.cliprect.top = 0;<br />
-bvbltparams.cliprect.width = 640;<br />
-bvbltparams.cliprect.height = 480;<br />
-bv_blt(&amp;bvbltparams);</span></td></tr></table>
-<br />
-Using this approach, we get the desired output:<br />
-<table align="center">
- <tr>
- <td><img alt="" src="blend-854x480.jpg" width="427" height="240" /></td>
- </tr>
- <tr>
- <td class="ctr">(shown 1/2x)</td>
- </tr>
-</table>
- It may also be clear that in that last BLT, the clip rectangle isn&#39;t really necessary.&nbsp; This is good, because
- it frees up the clipping rectangle to be used to further subdivide the image if necessary (e.g. if partially
- occluded).<br />
-</div>
-<br />
-<hr />
-<p class="Code_Header"><a name="bvrect">bvrect</a></p>
-<p class="small_code_block">struct bvrect {<br />
-&nbsp;&nbsp;&nbsp; int <a href="#bvrect.left">left</a>;<br />
-&nbsp;&nbsp;&nbsp; int <a href="#bvrect.top">top</a>;<br />
-&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvrect.width">width</a>;<br />
-&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvrect.height">height</a>;<br />
-};</p>
-<p class="Code_Header_2"><a name="bvrect.left">bvrect.left</a></p>
-<p class="code_block">int left;</p>
-<p>This member indicates the left edge of the rectangle, measured in pixels from the left edge of the surface.&nbsp; Note
-that this value <span class="underline">can</span> be negative, indicating that the rectangle begins before the left edge
-of the surface.&nbsp; However, this is only allowed when a rectangle is clipped to the surface.&nbsp; If, after clipping,
-the left edge of the rectangle is still negative, this is an error.</p>
-<p class="Code_Header_2"><a name="bvrect.top">bvrect.top</a></p>
-<p class="code_block">int top;</p>
-<p>This member indicates the top edge of the rectangle, measured in lines of
-<a href="#bfbuffdesc.virtstride" class="inline_code">bvbuffdesc.virtstride</a> bytes from the top edge of the surface.&nbsp;
-Note that this value <span class="underline">can</span> be negative, indicating that the rectangle begins before the top
-edge of the surface.&nbsp; However, this is only allowed when a rectangle is clipped to the surface.&nbsp; If, after clipping,
-the top edge of the rectangle is still negative, this is an error.</p>
-<p class="Code_Header_2"><a name="bvrect.width">bvrect.width</a></p>
-<p class="code_block">unsigned int width;</p>
-<p>This member indicates the width of the rectangle, measured in pixels.&nbsp; Note that this value
-<span class="underline">cannot</span> be negative.&nbsp; (Horizontal flipping is indicated using the
-<span class="inline_code"><a href="#BVFLAG_HORZ_FLIP">BVFLAG_HORZ_FLIP_*</a></span> flags.)&nbsp; The value of this member
-may exceed the width of the associated surface.&nbsp; However, this is only allowed when a rectangle is clipped to the surface.&nbsp;
-If, after clipping, the right edge of the rectangle still exceeds the width of the surface, this is an error.</p>
-<p class="Code_Header_2"><a name="bvrect.height">bvrect.height</a></p>
-<p class="code_block">unsigned int height;</p>
-<p>This member indicates the height of the rectangle, measured in lines of <span class="inline_code">
-<a href="#bvbuffdesc.virtstride">bvbuffdesc.virtstride</a></span> bytes.&nbsp; Note that this value
-<span class="underline">cannot</span> be negative.&nbsp; (Vertical flipping is indicated using the
-<span class="inline_code"><a href="#BVFLAG_VERT_FLIP">BVFLAG_VERT_FLIP_*</a></span> flags.)&nbsp; The value of this member
-may exceed the width of the associated surface.&nbsp; However, this is only allowed when a rectangle is clipped to the surface.&nbsp;
-If, after clipping, the right edge of the rectangle still exceeds the height of the surface, this is an error.</p>
-<hr />
-<a name="bvcopparams" class="Code_Header">bvcopparams</a>
-<p><span class="inline_code">bvcopparams</span> is used to define the cache operation to be performed by
-<span class="inline_code"><a href="#bv_cache">bv_cache()</a></span>.</p>
-<p class="small_code_block">struct bvcopparams {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvcopparams.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvbuffdesc">struct bvbuffdesc</a> *<a href="#bvcopparams.desc">desc</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvsurfgeom">struct bvsurfgeom</a> *<a href="#bvcopparams.geom">geom</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvrect">struct bvrect</a>&nbsp;&nbsp;&nbsp;&nbsp; *<a href="#bvcopparams.rect">rect</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enum bvcacheop&nbsp; <a href="#bvcopparams.cacheop">cacheop</a>;<br />
-};</p>
-<a name="bvcopparams.structsize" class="Code_Header_2">bvcopparams.structsize</a>
-<p><span class="code_block">unsigned long structsize; /* input */</span></p>
-<p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
-<a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
-<p class="Code_Header_2"><a name="bvcopparams.desc">bvcopparams.desc</a></p>
-<p class="code_block"><a href="#bvbuffdesc">struct bvbuffdesc</a> *desc;</p>
-<p>This member points to the <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> of the surface for which
-the cache is being manipulated.&nbsp; This buffer should have been mapped with a call to <span class="inline_code">
-<a href="#bv_map">bv_map()</a></span>.</p>
-<p class="note">NOTE:&nbsp; Implementations may choose to dynamically map the surface as with <span class="inline_code">
-<a href="#bv_blt">bv_blt()</a></span>, however in many systems, this will not function properly due to dynamic paging which
-can occur when a surface is not locked.</p>
-<p><span class="Code_Header_2"><a name="bvcopparams.geom">bvcopparams.geom</a></span></p>
-<p class="code_block"><a href="#bvsurfgeom">struct bvsurfgeom</a> *geom;</p>
-<p>This member points to the <span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> of the surface for which
-the cache is being manipulated.</p>
-<p><span class="Code_Header_2"><a name="bvcopparams.rect">bvcopparams.rect</a></span></p>
-<p class="code_block"><a href="#bvrect">struct bvrect</a> *rect;</p>
-<p>This member points to the <span class="inline_code"><a href="bvrect">bvrect</a></span> describing the rectangle of the
-surface which is being manipulated.</p>
-<p><span class="Code_Header_2"><a name="bvcopparams.cacheop">bvcopparams.cacheop</a></span></p>
-<p class="code_block">enum bvcacheop cacheop;</p>
-<p>This member specifies the cache operation to be performed.&nbsp; It is an enumeration from the following list:</p>
-<table style="" class="indent">
- <tr>
- <td><span class="inline_code"><a name="BVCACHE_BIDIRECTIONAL">BVCACHE_BIDIRECTIONAL</a></span></td>
- <td>(This usually performs a cache flush operation.)</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVCACHE_CPU_TO_DEVICE">BVCACHE_CPU_TO_DEVICE</a></span></td>
- <td>Performs the appropriate cache operation to ensure data can be transferred correctly when it was written with
- the CPU, but will be read by the 2-D device.&nbsp; (This is usually a cache clean operation.)</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVCACHE_CPU_FROM_DEVICE">BVCACHE_CPU_FROM_DEVICE</a></span></td>
- <td>Performs the appropriate cache operation to ensure data can be transferred correctly when it was written by
- the 2-D device, but will be read by the CPU.&nbsp; (This is usually a cache invalidate operation.)</td>
- </tr>
-</table>
-<br />
-<hr />
-<p class="Code_Header"><a name="bvbuffdesc">bvbuffdesc</a></p>
-<p>This structure is used in conjunction with a <span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> structure
-to specify the characteristics of a graphic surface.&nbsp; This structure specifies the memory buffer itself.</p>
-<p class="small_code_block">struct bvbuffdesc {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvbuffdesc.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *<a href="#bvbuffdesc.virtaddr">virtaddr</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#bvbuffdesc.length">length</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bvbuffmap">struct bvbuffmap</a> *<a href="#bvbuffdesc.map">map</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enum bvauxtype <a href="#bvbuffdesc.auxtype">auxtype</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *<a href="#bvbuffdesc.auxptr">auxptr</a>;<br />
-};</p>
-<p class="Code_Header_2"><a name="bvbuffdesc.structsize">bvbuffdesc.structsize</a></p>
-<p class="code_block">unsigned int structsize;</p>
-<p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
-<a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
-<p class="Code_Header_2"><a name="bvbuffdesc.virtaddr">bvbuffdesc.virtaddr</a></p>
-<p class="code_block">void *virtaddr;</p>
-<p>This member is used to indicate the CPU virtual address of the start of the buffer.&nbsp; This value must be provided
-unless the <span class="inline_code"><a href="#bvbuffdesc.auxtype">auxtype</a></span>/<span class="inline_code"><a href="#bvbuffdesc.auxptr">auxptr</a></span>
-members below are used.&nbsp; At that time, this member is optional, and the <span class="inline_code">
-<a href="#auxptr">auxptr</a></span> usually has higher priority than this member.</p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Note that this is always the beginning of the buffer.&nbsp; This means that if the <span class="inline_code">
-<a href="#bvsurfgeom.virtaddr">bvsurfgeom.virtstride</a></span> is negative, or the <a href="#bvsurfgeom.orientation">bvsurfgeom.orientation</a>
-does not normalize to 0º&nbsp; (i.e. <span class="inline_code">orientation % 360 != 0</span>), implementations may need
-to use a modified version of <span class="inline_code">virtaddr</span> internally to operate correctly.</p>
-<p class="Code_Header_2"><a name="bvbuffdesc.length">bvbuffdesc.length</a></p>
-<p class="code_block">unsigned long length;</p>
-<p>This member specifies the length of the buffer in bytes.</p>
-<p class="note">NOTE:&nbsp; When used with a <span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> structure,
-<span class="inline_code">length</span> should be greater than or equal to <span class="inline_code">
-<a href="#bvsurfgeom.height">bvsurfgeom.height</a> * <a href="#bvsurfgeom.virtstride">bvsurfgeom.virtstride</a></span>.</p>
-<p class="Code_Header_2"><a name="bvbuffdesc.map">bvbuffdesc.map</a></p>
-<p class="code_block">struct bvbuffmap *map;</p>
-<p>This member is used by the implementations and should <span class="underline"><strong>NEVER</strong></span> be manipulated
-by the client.&nbsp; When the <span class="inline_code">bvbuffdesc</span> structure is created, this member should be set
-to 0, indicating that no implementations have mapped the buffer.&nbsp; After a buffer has been mapped using a call to
-<span class="inline_code"><a href="#bv_map">bv_map()</a></span>, this member should be left as-is by clients.&nbsp; (The
-implementation will set this back to 0 before returning from <span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span>.)</p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-This member points to a linked list of <span class="inline_code"><a href="#bvbuffmap">bvbuffmap</a></span> structures associated
-with the buffer.&nbsp; Each <span class="inline_code"><a href="#bvbuffmap">bvbuffmap</a></span> is added to the list as
-the buffer is mapped by a given implementation.&nbsp; This may be done with an explicit call to
-<span class="inline_code"><a href="#bv_map">bv_map()</a></span>, or implicitly with a call to <span class="inline_code">
-<a href="#bv_blt">bv_blt()</a></span>, after a call to <span class="inline_code"><a href="#bv_map">bv_map()</a></span> from
-a different implementation.<br />
-<br />
-Implementations should not assume that the first entry in the list is their <span class="inline_code">
-<a href="#bvbuffmap">bvbuffmap</a></span>.&nbsp; Instead, implementations should compare the <span class="inline_code">
-<a href="#bv_unmap">bv_unmap()</a></span> pointer in the structure to their own function address.</p>
-<p class="Code_Header_2"><a name="bvbuffdesc.auxtype">bvbuffdesc.auxtype</a></p>
-<p class="code_block">enum bvauxtype auxtype;</p>
-<p>This member is used to identify the type of additional information about the buffer provided by
-<span class="inline_code"><a href="#bvbuffdesc.auxptr">auxptr</a></span>.&nbsp; Currently no values are defined for the
-user mode interface, so it should be initialized to 0 or <span class="inline_code">BVAT_NONE</span>.&nbsp; See the
-<a href="#Kernel_Mode_Interface">Kernel Mode Interface</a> for details on the values defined for the kernel mode interface.</p>
-<p class="Code_Header_2"><a name="bvbuffdesc.auxptr">bvbuffdesc.auxptr</a></p>
-<p class="code_block">void *auxptr;</p>
-<p>This member is used to point to additional information about the buffer.&nbsp; The type of this pointer is determined
-by the <span class="inline_code"><a href="#auxtype">auxtype</a></span> value.&nbsp; Currently there are no types defined
-for the user mode interface, so this member is ignored.&nbsp; See the <a href="#Kernel_Mode_Interface">Kernel Mode Interface</a>
-for details on the types defined for the kernel mode interface. </p>
-<hr /><br />
-<table style="" class="imponly">
- <tr>
- <td>
- <p><strong>Implementations Only</strong></p>
- <p class="Code_Header"><a name="bvbuffmap">bvbuffmap</a></p>
- <p>This structure is used from the bvbuffdesc.map member to allow implementations to associate their own data with
- a buffer.</p>
- <p class="small_code_block"><span class="small_code_block_in_table">struct bvbuffmap {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvbuffmap.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BVFN_UNMAP <a href="#bvbuffmap.bv_unmap">bv_unmap</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#bvbuffmap.handle">handle</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct bvbuffmap *<a href="#bvbuffmap.nextmap">nextmap</a>;<br />
- };</span></p>
- <p class="Code_Header_2"><a name="bvbuffmap.structsize">bvbuffmap.structsize</a></p>
- <p class="code_block">unsigned int structsize;</p>
- <p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
- <a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
- <p class="Code_Header_2"><a name="bvbuffmap.bv_unmap">bvbuffmap.bv_unmap</a></p>
- <p class="code_block">BVFN_UNMAP bv_unmap;</p>
- <p>This member holds the pointer to the <span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span> function
- of the implementation associated with the <span class="inline_code">bvbuffmap</span> structure.&nbsp; It serves
- to allow implementations to identify their <span class="inline_code">bvbuffmap</span> structure in the linked list,
- as well as to allow implementations to call each other&#39;s <span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span>
- calls from their own.</p>
- <p class="Code_Header_2"><a name="bvbuffmap.handle">bvbuffmap.handle</a></p>
- <p class="code_block">unsigned long handle;</p>
- <p>This member is used to hold an implementation-specific piece of data.</p>
- <p class="Code_Header_2"><a name="bvbuffmap.nextmap">bvbuffmap.nextmap</a></p>
- <p class="code_block">struct bvbuffmap *nextmap;</p>
- <p>This member holds a pointer to the next bvbuffmap structure in the linked list.&nbsp; If this member is 0, there
- are no more entries in the list.<br />
- <br />
- <span class="note">NOTE:&nbsp; The Linux/Android Kernel Mode Interface differs slightly from this structure.&nbsp;
- Refer to the <a href="#Kernel_Mode_Interface">Kernel Mode Interface</a> section for details.</span></p>
- </td>
- </tr>
-</table>
-<br />
-<hr />
-<p class="Code_Header"><a name="bvsurfgeom">bvsurfgeom</a></p>
-<p>This structure is used in conjunction with a <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> structure
-to specify the characteristics of a graphic surface.&nbsp; This structure specifies the surface geometric characteristics.</p>
-<p class="note">NOTE:&nbsp; This structure was separated from <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
-to afford much flexibility to the client.&nbsp; Using the same <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
-structure with different <span class="inline_code">bvsurfgeom</span> structures or using the same
-<span class="inline_code">bvsurfgeom</span> structure with different <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
-structures may be of benefit.&nbsp; See the <a href="#bvsurfgeom_examples">examples</a> at the bottom of this section.</p>
-<p class="small_code_block">struct bvcopparams {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvsurfgeom.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://graphics.github.com/ocd/">enum ocdformat</a> format;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int width;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int height;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int orientation;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long virtstride;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://graphics.github.com/ocd/">enum ocdformat</a> paletteformat;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *palette;<br />
-};</p>
-<p class="Code_Header_2"><a name="bvsurfgeom.structsize">bvsurfgeom.structsize</a></p>
-<p class="inline_code">unsigned int structsize;</p>
-<p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
-<a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
-<p class="Code_Header_2"><a name="bvsurfgeom.format">bvsurfgeom.format</a></p>
-<p class="code_block"><a href="http://graphics.github.com/ocd/">enum ocdformat</a> format;</p>
-<p>This member specifies the format of the surface using the <a href="http://graphics.github.com/ocd">Open Color format
-Definitions (OCD)</a>.</p>
-<p class="Code_Header_2"><a name="bvsurfgeom.width">bvsurfgeom.width</a></p>
-<p class="code_block">unsigned int width;</p>
-<p>This member specifies the width of the surface in pixels.&nbsp; This size does not have to be equivalent to the
-<span class="inline_code"><a href="#bvsurfgeom.virtstride">virtstride</a></span> size.</p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Implementations should never assume that <span class="inline_code">width</span> is equivalent to
-<span class="inline_code"><a href="#bvsurfgeom.virtstride">virtstride</a></span>.</p>
-<p class="Code_Header_2"><a name="bvsurfgeom.height">bvsurfgeom.height</a></p>
-<p class="code_block">unsigned int height;</p>
-<p>This member specifies the height of the surface in lines of <span class="inline_code">
-<a href="#bvsurfgeom.virtstride">virtstride</a></span> width.</p>
-<p class="Code_Header_2"><a name="bvsurfgeom.orientation">bvsurfgeom.orientation</a></p>
-<p class="code_block">int orientation;</p>
-<p>This member specifies the orientation or angle of the surface in degrees.&nbsp; Since BLTsville is designed only to specify
-orthogonal rectangles, this value must be a multiple of 90º.&nbsp; This value <span class="underline">may</span> be negative.&nbsp;
-<em>(Extending BLTsville to handle non-orthogonal rectangles may be considered if there is sufficient interest.)</em></p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Implementations should normalize orientation angles.&nbsp; For example, a client that sets the orientation to -450º should
-behave as if the value of 270º were specified. </p>
-<p class="Code_Header_2"><a name="bvsurfgeom.virtstride">bvsurfgeom.virtstride</a></p>
-<p class="code_block">long virtstride;</p>
-<p>This member specifies the horizontal stride of the surface in bytes for an unrotated surface.&nbsp; The stride represents
-the number of bytes needed to move from one pixel to the pixel immediately below it.&nbsp; This value
-<span class="underline">may</span> be negative.</p>
-<p class="note">NOTE:&nbsp; This means the <span class="inline_code">orientation</span> does not affect the
-<span class="inline_code">virtstride</span>.&nbsp; However, rotating a surface usually results in a different configuration
-(i.e. <span class="inline_code">width</span>), which <span class="underline">will</span> affect the
-<span class="inline_code">virtstride</span>.&nbsp; For example, a 320 x 240 x 32 bpp 0º surface might have a
-<span class="inline_code">virtstride</span> of 1280 bytes (320 pixels/line * 32 bits/pixel / 8 bits/byte).&nbsp; When the
-orientation is set to 180º, the <span class="inline_code">virtstride</span> would be the same.&nbsp; But when the orientation
-is set to 90º (or 270º), the <span class="inline_code">virtstride</span> would most likely need to be set to 960 bytes (240
-pixels/line * 32 bits/pixel / 8 bits/byte). </p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Implementations that do not support a negative <span class="inline_code">virtstride</span> must compensate using whatever
-mechanism is appropriate for the implementation.&nbsp; For example, using a vertical flipping/mirroring setting.</p>
-<p class="note">NOTE:&nbsp; The <span class="inline_code">virtstride</span> name must be maintained for backwards compatibility.&nbsp;
-However, no situation should arise where the client would need to provide two different strides for the virtual and physical
-views of a surface (there are situations where a physical stride will need to be available within the implementation, but
-the client will not be the one to supply it), so <em>physstride</em> will most likely never be needed.&nbsp; However, when
-a client provides a physical description of the buffer (see the <a href="#Kernel_Mode_Interface">Kernel Mode Interface</a>
-section below), the <span class="inline_code">virtstride</span> entry should be used to provide the physical stride.</p>
-<p class="Code_Header_2"><a name="bvsurfgeom.paletteformat">bvsurfgeom.paletteformat</a></p>
-<p class="code_block"><a href="http://graphics.github.com/ocd/">enum ocdformat</a> paletteformat;</p>
-<p>This member specifies the format of the palette supplied via the <span class="inline_code">
-<a href="#bvsurfgeom.palette">palette</a></span> member for palettized formats using the
-<a href="http://graphics.github.com/ocd">Open Color format Definitions (OCD)</a>.</p>
-<p class="Code_Header_2"><a name="bvsurfgeom.palette">bvsurfgeom.palette</a></p>
-<p class="code_block">void *palette;</p>
-<p>This member points to a palette used for palettized formats.&nbsp; The format of the palette is specified by the
-<span class="inline_code"><a href="#bvsurfgeom.palette">paletteformat</a></span> member.&nbsp; Palettes are packed based
-on their container size:</p>
-<table class="indent">
- <tr>
- <td class="ctr_thin_bord"><strong>Palette Format</strong></td>
- <td class="ctr_thin_bord"><strong>Palette Layout (byte address)</strong></td>
- <td class="ctr_thin_bord"><strong>Palette Layout (little endian)</strong></td>
- </tr>
- <tr class="small_code_block_in_table">
- <td class="thin_bord">OCDFMT_xRGB12</td>
- <td class="ctr_thin_bord">n/a</td>
- <td class="thin_bord">
- <table style="width: 100%">
- <tr>
- <td class="thin_bord">*(((unsigned short *)palette) + 0)</td>
- <td class="thin_bord">0xFrgb</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned short *)palette) + 1)</td>
- <td class="thin_bord">0xFrgb</td>
- </tr>
- <tr>
- <td class="thin_bord">...</td>
- <td class="thin_bord">...</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned short *)palette) + n - 1)</td>
- <td class="thin_bord">0xFrgb</td>
- </tr>
- </table>
- </td>
- </tr>
- <tr class="small_code_block_in_table">
- <td class="thin_bord">OCDFMT_RGB24</td>
- <td class="thin_bord">
- <table style="width: 100%">
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 0)</td>
- <td class="thin_bord">red0</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 1)</td>
- <td class="thin_bord">green0</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 2)</td>
- <td class="thin_bord">blue0</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 3)</td>
- <td class="thin_bord">red1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 4)</td>
- <td class="thin_bord">green1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 5)</td>
- <td class="thin_bord">blue1</td>
- </tr>
- <tr>
- <td class="thin_bord">...</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (3 * n) - 3)</td>
- <td class="thin_bord">redNm1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (3 * n) - 2)</td>
- <td class="thin_bord">greenNm1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (3 * n) - 1)</td>
- <td class="thin_bord">blueNm1</td>
- </tr>
- </table>
- </td>
- <td class="ctr_thin_bord">n/a</td>
- </tr>
- <tr class="small_code_block_in_table">
- <td class="thin_bord">OCDFMT_RGBx24</td>
- <td class="thin_bord">
- <table style="width: 100%">
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 0)</td>
- <td class="thin_bord">red0</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 1)</td>
- <td class="thin_bord">green0</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 2)</td>
- <td class="thin_bord">blue0</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 3)</td>
- <td class="thin_bord">0xFF</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 4)</td>
- <td class="thin_bord">red1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 5)</td>
- <td class="thin_bord">green1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 6)</td>
- <td class="thin_bord">blue1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + 7)</td>
- <td class="thin_bord">0xFF</td>
- </tr>
- <tr>
- <td class="thin_bord">...</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (4 * n) - 4)</td>
- <td class="thin_bord">redNm1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (4 * n) - 3)</td>
- <td class="thin_bord">greenNm1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (4 * n) - 2)</td>
- <td class="thin_bord">blueNm1</td>
- </tr>
- <tr>
- <td class="thin_bord">*(((unsigned char *)palette) + (4 * n) - 1)</td>
- <td class="thin_bord">0xFF</td>
- </tr>
- </table>
- </td>
- <td class="thin_bord">
- <table style="width: 100%">
- <tr>
- <td class="thin_bord">*(((unsigned long *)palette) + 0)</td>
- <td class="thin_bord">0xFFbbggrr<br />
- </td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">*(((unsigned long *)palette) + 1)<br />
- </td>
- <td class="thin_bord">0xFFbbggrr<br />
- </td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">...</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">*(((unsigned long *)palette) + n - 1)|<br />
- </td>
- <td class="thin_bord">0xFFbbggrr<br />
- </td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- <tr class="thin_bord">
- <td class="thin_bord">&nbsp;</td>
- <td class="thin_bord">&nbsp;</td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-<p class="note">NOTE:&nbsp; Use of subsampled formats for <span class="inline_code">paletteformat</span> is currently undefined.</p>
-<p class="Header4"><a name="bvsurfgeom_examples">Examples</a></p>
-<p>Mixing and matching <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> and
-<span class="inline_code">bvsurfgeom</span> structures provides maximum flexibility for a client.</p>
-<table style="width: 100%" class="example">
- <tr>
- <td><strong>Example:</strong>&nbsp; Using two different <span class="inline_code">bvsurfgeom</span> structures with
- the same <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> structure allows in-place format
- conversion:</td>
- </tr>
- <tr>
- <td>
- <p class="indent"><span class="small_code_block_in_table">...<br />
- // Convert premultiplied image to non-premultiplied in place<br />
- struct
- bvbltparams parms;<br />
- ...<br />
- struct
- bvbuffdesc buff;<br />
- ...<br />
- struct
- bvsurfgeom srcgeom, dstgeom;<br />
- ...<br />
- srcgeom.format = OCDFMT_RGBA24;<br />
- dstgeom.format = OCDFMT_nRGBA24;<br />
- ...<br />
- parms.src1.desc = &amp;buff;<br />
- parms.src1geom = &amp;srcgeom;<br />
- parms.dstdesc = &amp;buff;<br />
- parms.dstgeom = &amp;dstgeom;<br />
- ...<br />
- bv_blt(&amp;parms);<br />
- ... </span></p>
- </td>
- </tr>
-</table>
-<br />
-<table style="width: 100%" class="example">
- <tr>
- <td><strong>Example:</strong>&nbsp; Using three different <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>
- structures with the same <span class="inline_code">bvsurfgeom</span> structure reduces code and copy errors:</td>
- </tr>
- <tr>
- <td>
- <p class="indent"><span class="small_code_block_in_table">...<br />
- // Blend two images of the same size<br />
- struct
- bvbltparams parms;<br />
- ...<br />
- struct
- bvbuffdesc src1buff, src2buff, dstbuff;<br />
- ...<br />
- struct
- bvsurfgeom geom;<br />
- ...<br />
- parms.src1.desc = &amp;src1buff;<br />
- parms.src1geom = &amp;geom;<br />
- parms.src2.desc = &amp;src2buff;<br />
- parms.src2geom = &amp;geom;<br />
- parms.dstdesc = &amp;dstbuff;<br />
- parms.dstgeom = &amp;dstgeom;<br />
- ...<br />
- bv_blt(&amp;parms);<br />
- ... </span></p>
- </td>
- </tr>
-</table>
-<br />
-<hr />
-<p class="Code_Header"><a name="bvtileparams">bvtileparams</a></p>
-<p>This structure is used to define the parameters necessary to use a small image as a tile or block that will be repeated
-when used as a source.&nbsp; This structure is used in conjunction with the associated <span class="inline_code">
-<a href="#bvsurfgeom">bvsurfgeom</a></span> and the associated <span class="inline_code"><a href="#bvrect">bvrect</a></span>
-to determine the operation that is performed.</p>
-<p class="small_code_block">struct bvcopparams {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvtileparams.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#bvtileparams.flags">flags</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *<a href="#bvtileparams.virtaddr">virtaddr</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int <a href="#bvtileparams.dstleft">dstleft</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int <a href="#bvtileparams.dsttop">dsttop</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvtileparams.srcwidth">srcwidth</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvtileparams.srcheight">srcheight</a>;<br />
-};</p>
-<p class="Code_Header_2"><a name="bvtileparams.structsize">bvtileparams.structsize</a></p>
-<p class="code_block">unsigned int structsize;</p>
-<p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
-<a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
-<p class="Code_Header_2"><a name="bvtileparams.flags">bvtileparams.flags</a></p>
-<p class="code_block">unsigned long flags;</p>
-<p>This member specifies some additional information for the tiling operation.&nbsp; It can be composed as the binary OR
-of one selection for each edge (left, top, right, and bottom) from the following flags:</p>
-<table style="" class="indent">
- <tr>
- <td><span class="inline_code"><a name="BVTILE_LEFT_REPEAT">BVTILE_LEFT_REPEAT</a></span></td>
- <td>indicates that the tile is repeated to the left of the destination alignment location.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVTILE_TOP_REPEAT">BVTILE_TOP_REPEAT</a></span></td>
- <td>indicates that the tile is repeated above the destination alignment location.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVTILE_RIGHT_REPEAT">BVTILE_RIGHT_REPEAT</a></span></td>
- <td>indicates that the tile is repeated to the right of the destination alignment location.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVTILE_BOTTOM_REPEAT">BVTILE_BOTTOM_REPEAT</a></span></td>
- <td>indicates that the tile is repeated below the destination alignment location.</td>
- </tr>
- <tr>
- <td><a name="BVTILE_LEFT_MIRROR" class="inline_code">BVTILE_LEFT_MIRROR</a></td>
- <td>indicates that the tile is mirrored to the left of the destination alignment location.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVTILE_TOP_MIRROR">BVTILE_TOP_MIRROR</a></span></td>
- <td>indicates that the tile is mirrored above the destination alignment location.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVTILE_RIGHT_MIRROR">BVTILE_RIGHT_MIRROR</a></span></td>
- <td>indicates that the tile is mirrored to the right of the destination alignment location.</td>
- </tr>
- <tr>
- <td><span class="inline_code"><a name="BVTILE_BOTTOM_MIRROR">BVTILE_BOTTOM_MIRROR</a></span></td>
- <td>indicates that the tile is mirrored below the destination alignment location.</td>
- </tr>
-</table>
-<p class="Code_Header_2"><a name="bvtileparams.virtaddr">bvtileparams.virtaddr</a></p>
-<p class="code_block">void *virtaddr;</p>
-<p>This member is used to indicate the CPU virtual address of the start of the buffer.</p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Note that this is always the beginning of the buffer.&nbsp; This means that if the <span class="inline_code">
-<a href="#bvsurfgeom.virtaddr">bvsurfgeom.virtstride</a></span> is negative, or the <a href="#bvsurfgeom.orientation">bvsurfgeom.orientation</a>
-does not normalize to 0º&nbsp; (i.e. <span class="inline_code">orientation % 360 != 0</span>), implementations may need
-to use a modified version of <span class="inline_code">virtaddr</span> internally to operate correctly.</p>
-<p class="Code_Header_2"><a name="bvtileparams.dstleft">bvtileparams.dstleft</a></p>
-<p class="code_block">int dstleft;</p>
-<p>This member is used to designate the left edge of the location of the tile in the destination for alignment purposes
-(alignment location).&nbsp; Note that the <span class="inline_code"><a href="#bvrect">bvrect</a></span> of the destination
-specifies the region which is filled by the tile.</p>
-<p class="Code_Header_2"><a name="bvtileparams.dsttop">bvtileparams.dsttop</a></p>
-<p class="code_block">int dsttop;</p>
-<p>This member is used to designate the top edge of the location of the tile in the destination for alignment purposes (alignment
-location).&nbsp; Note that the <span class="inline_code"><a href="#bvrect">bvrect</a></span> of the destination specifies
-the region which is filled by the tile.</p>
-<p class="Code_Header_2"><a name="bvtileparams.srcwidth">bvtileparams.srcwidth</a></p>
-<p class="code_block">unsigned int srcwidth;</p>
-<p>This member is used to designate the width of the source for purposes of scaling.&nbsp; The relationship between this
-field and the <span class="inline_code"><a href="#bvrect.width">bvrect.width</a></span> of the associated source surface
-determines the horizontal scaling factor.</p>
-<p class="Code_Header_2"><a name="bvtileparams.srcheight">bvtileparams.srcheight</a></p>
-<p class="code_block">unsigned int srcheight;</p>
-<p>This member is used to designate the height of the source for purposes of scaling.&nbsp; The relationship between this
-field and the <span class="inline_code"><a href="#bvrect.height">bvrect.height</a></span> of the associated source surface
-determines the vertical scaling factor.</p>
-<hr />
-<p class="Code_Header"><a name="bvcallbackerror">bvcallbackerror</a></p>
-<p>This structure is used to provide error information to the client of a BLT that failed within an asynchronous operation.&nbsp;
-The errors will be limited to those that occur within the implementation.</p>
-<p class="note">NOTE:&nbsp; Parameter errors should never be returned in this structure.&nbsp; These should have been returned
-to the client before the BLT was ever initiated.</p>
-<p class="small_code_block">struct bvcallbackerror {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvcallbackerror.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bverror">enum bverror</a> <a href="#bvcallbackerror.error">error</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *<a href="#bvcallbackerror.errdesc">errdesc</a>;<br />
-};</p>
-<p class="Code_Header_2"><a name="bvcallbackerror.structsize">bvcallbackerror.structsize</a></p>
-<p class="code_block">unsigned int structsize;</p>
-<p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
-<a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
-<p class="Code_Header_2"><a name="bvcallbackerror.error">bvcallbackerror.error</a></p>
-<p class="code_block"><a href="#bverror">enum bverror</a> error;</p>
-<p>This member is used to indicate the error encountered.&nbsp; In general, these will be error like these:</p>
-<table class="indent">
- <tr>
- <td class="inline_code">BVERR_OP_FAILED</td>
- <td>The operation failed for unspecified reasons.&nbsp; The destination buffer was not modified.</td>
- </tr>
- <tr>
- <td class="inline_code">BVERR_OP_INCOMPLETE</td>
- <td>The operation only partially completed.&nbsp; The destination buffer is in an undefined state.</td>
- </tr>
- <tr>
- <td class="inline_code">BVERR_MEMORY_ERROR</td>
- <td>The operation resulted in a memory error, most likely due to an attempt to access invalid memory.&nbsp; The
- destination buffer is in an undefined state.</td>
- </tr>
-</table>
-<p class="Code_Header_2"><a name="bvcallbackerror.errdesc">bvcallbackerror.errdesc</a></p>
-<p class="code_block">char *errdesc;</p>
-<p><span class="inline_code">errdesc</span> is optionally used by implementations to pass a 0-terminated string with additional
-debugging information back to clients for debugging purposes.&nbsp; <span class="inline_code">errdesc</span> is not localized
-or otherwise meant to provide information that is displayed to users.</p>
-<hr />
-<p class="Header1">Batching<a name="batching"></a></p>
-<p>Batching is the single most powerful feature in BLTsville.&nbsp; It is used for two major purposes:</p>
-<ol>
- <li>To group similar BLTs which use most of the same parameters so that they can be handled more efficiently by the
- implementation.</li>
- <li>To group BLTs that should go together so that implementations can use special features that go beyond what seems
- to be expressed by the BLTsville API.</li>
-</ol>
-<p class="note">NOTE:&nbsp; It is important to realize that BLTs batched together may be done <span class="underline">in
-any order</span>, and in fact may not even be done in the way specified.&nbsp; This includes the BLTs being done as they
-are submitted, or no operations performed until the batch submission is completed with
-<a href="#BVFLAG_BATCH_END" class="inline_code">BVFLAG_BATCH_END</a>.&nbsp; This means the client must not rely on intermediate
-results within a batch.</p>
-<p class="note">NOTE:&nbsp; Because BLTs can be performed in a variety of ways, callbacks for individual BLTs would have
-no consistent meaning.&nbsp; So, when batching is mixed with <span class="inline_code"><a href="#BVFLAG_ASYNC">BVFLAG_ASYNC</a></span>,
-only the callback for the last BLT occurs.</p>
-<p class="note">NOTE:&nbsp; Since implementations can perform batched BLTs in a variety of ways, even synchronous batched
-BLTs can be effectively asynchronous.&nbsp; Therefore, only the last BLT determines the synchronicity of the entire batch.&nbsp;
-i.e. the <span class="inline_code"><a href="#BVFLAG_ASYNC">BVFLAG_ASYNC</a></span> flag is only heeded when combined with
-<span class="inline_code"><a href="#BVFLAG_BATCH_END">BVFLAG_BATCH_END</a>.</span></p>
-<p class="note">NOTE: Failure during the performance of a batch (different from an error on submission--indicated by the
-contents of the <a href="#bvcallbackerror" class="inline_code">bvcallbackerror</a> structure) will result in an unknown
-state for all destination buffers.&nbsp; Do not assume that a given implementation&#39;s state in this case represents the state
-which will be encountered for a different implementation.</p>
-<p class="note">NOTE: Because of the indeterminate nature of the execution of a batch of BLTs, a &quot;batch abort&quot; would not
-result in a known state either.&nbsp; As stated above, a given implementation may have already performed earlier BLTs in
-a batch as the batch is submitted.&nbsp; So errors encountered during the submission of a batch must be handled by the client,
-and then the batch must be terminated normally using <a href="#BVFLAG_BATCH_END" class="inline_code">BVFLAG_BATCH_END</a>.</p>
-<p class="Header2">Batches For Grouping Similar BLTs</p>
-<p>Often, groups of similar BLTs are performed, with changes to only a few parameters.&nbsp; Some implementations have the
-ability to re-use previous settings, coupled with these changes, to perform new BLTs.</p>
-<p>One good example of this in in rendering text, similar to that you are reading now.&nbsp; In most systems, a glyph cache
-is maintained to hold the characters of a given font, rasterized with the specific characteristics desired (e.g. bold, italics,
-etc.).&nbsp; Each font in the glyph cache is normally created using a font rasterization engine from a vector-based font,
-such as FreeType.&nbsp; This technology allows fonts to be described in terms of curves and lines instead of pixels, which
-means they can be created as needed, in any size desirable.</p>
-<table style="" class="glyph_cache">
- <tr>
- <td class="glyph_cache">&nbsp; !&quot;#$%&amp;&#39;()*+&#39;-./0123456789:;&lt;=&gt;?<br />
- @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_<br />
- `abcdefghijklmnopqrstuvwxyz{|}~</td>
- </tr>
-</table>
-<p>Then, when a character needs to be rendered, it is copied from the pre-rendered glyph cache.&nbsp; This is much more
-efficient than performing the font rasterization from the vector description each time a character is used.</p>
-<p>With some hardware implementations, the setup to trigger the copy of these characters from the glyph cache to the target
-surface can be quite significant, when compared to the number of pixels actually affected.&nbsp; For example, each character
-might consist of something on the order of&nbsp; 10 x 14, or about 140 pixels.&nbsp; Programming a typical hardware BLTer
-may require tens of commands for each character.</p>
-<p>But note that each of these BLTs differs by only a few parameters.&nbsp; Specifically, once the source and destination
-surfaces have been specified, and the operation described, only the source and destination rectangles change between BLTs.
-To alleviate much of this overhead, most implementations will allow the configuration of a previous BLT to be used again,
-with only those parameters which change provided for the subsequent BLTs.</p>
-<p>BLTsville provides access to this capability via the batch mechanism.</p>
-<p>For rendering a word using a monospaced font like this, the client might construct the batch like this:</p>
-<p class="small_code_block">struct bvbuffdesc screendesc = {sizeof(struct bvbuffdesc}, 0};<br />
-struct bvsurfgeom screengeom = {sizeof(struct bvsurfgeom), 0};<br />
-struct bvbuffdesc glyphcachedesc = {sizeof(struct bvbuffdesc), 0};<br />
-struct bvsurfgeom glyphcachegeom = {sizeof(struct bvsurfgeom), 0};<br />
-struct bvtileparams solidcolortileparams = {sizeof(struct bvtileparams), 0};<br />
-struct bvbuffgeom solidcolorgeom = {sizeof(struct bvsurfgeom), 0};<br />
-<br />
-struct bvbltparams bltparams = {sizeof(struct bvbltparams), 0};<br />
-<br />
-int charsperline = 32;<br />
-int fontwidth = 10;<br />
-int fontheight = 14;<br />
-int i = 0;<br />
-<br />
-screendesc.virtaddr = screenaddr;<br />
-screendesc.length = screenstride * screenheight;<br />
-screengeom.format = OCDFMT_RGB24;<br />
-screengeom.width = screenwidth;<br />
-screengeom.height = screenheight;<br />
-screengeom.virtstride = screenstride;<br />
-<br />
-glyphcachedesc.virtaddr = glyphcacheaddr;<br />
-glyphcachedesc.length = glyphcachestride * glyphcacheheight;<br />
-glyphcachegeom.format = OCDFMT_ALPHA8;<br />
-glyphcachegeom.width = glyphcachewidth;<br />
-glyphcachegeom.height = glyphcacheheight;<br />
-glyphcachegeom.virtstride = glyphstride;<br />
-<br />
-solidcolortileparams.virtaddr = &amp;solidcolor;<br />
-solidcolortileparams.srcwidth = 1;<br />
-solidcolortileparams.srcheight = 1;<br />
-solidcolorgeom.format = OCDFMT_RGB24;<br />
-<br />
-bltparams.flags = BVFLAG_BLEND | BVFLAG_SRC1_TILED | BVFLAG_BATCH_BEGIN;<br />
-bltparams.op.blend = BVBLEND_SRCOVER + BVBLENDDEF_REMOTE;<br />
-bltparams.dstdesc = &amp;screendesc;<br />
-bltparams.dstgeom = &amp;screengeom;<br />
-bltparams.src1.tileparams = &amp;solidcolortileparams;<br />
-bltparams.src1geom = &amp;solidcolorgeom;<br />
-bltparams.src2.desc = &amp;screendesc;<br />
-bltparams.src2geom = &amp;screengeom;<br />
-bltparams.mask.desc = &amp;glyphcachedesc;<br />
-bltparams.maskgeom = &amp;glyphcachegeom;<br />
-<br />
-bltparams.dstrect.left = bltparams.src2rect.left = screenrect.left;<br />
-bltparams.dstrect.top = bltparams.src2rect.top = screenrect.top;<br />
-<br />
-bltparams.maskrect.width = bltparams.dstrect.width = bltparams.src2rect.width = fontwidth;<br />
-bltparams.maskrect.height = bltparams.dstrect.height = bltparams.src2rect.height = fontheight;<br />
-<br />
-bltparams.maskrect.left = ((text[i] - &#39; &#39;) % charsperline) * fontwidth;<br />
-bltparams.maskrect.top = ((text[i] - &#39; &#39;) / charsperline) * fontheight;<br />
-<br />
-bv_blt(&amp;bltparams);<br />
-<br />
-i++;<br />
-if(i &lt; textlen)<br />
-{<br />
-&nbsp; bltparams.flags = (bltparams.flags &amp; ~BVFLAG_BATCH_MASK) | BVFLAG_BATCH_CONTINUE;<br />
-&nbsp; bltparams.batchflags = BVBATCH_DSTRECT_ORIGIN | BVBATCH_SRC2RECT_ORIGIN | BVBATCH_MASKRECT_ORIGIN;<br />
-<br />
-&nbsp; do<br />
-&nbsp; {<br />
-&nbsp;&nbsp;&nbsp; bltparams.dstrect.left += fontwidth;<br />
-&nbsp;&nbsp;&nbsp; bltparams.src2rect.left = bltparams.dstrect.left;<br />
-<br />
-&nbsp;&nbsp;&nbsp; bltparams.maskrect.left = ((text[i] - &#39; &#39;) % charsperline) * fontwidth;<br />
-&nbsp;&nbsp;&nbsp; bltparams.maskrect.top = ((text[i] - &#39; &#39;) / charsperline) * fontheight;<br />
-<br />
-&nbsp;&nbsp;&nbsp; bv_blt(&amp;bltparams);<br />
-<br />
-&nbsp;&nbsp;&nbsp; i++;<br />
-&nbsp; }while(i &lt; textlen);<br />
-}<br />
-<br />
-bltparams.flags = (bltparams.flags &amp; ~BVFLAG_BATCH_MASK) | BVFLAG_BATCH_END;<br />
-bltparams.batchflags = BVBATCH_ENDNOP;<br />
-<br />
-bv_blt(&amp;bltparams);</p>
-<p class="note">NOTE:&nbsp; bvbltparams.batchflags is just a hit.&nbsp; Not all implementations support deltas in
-batching, so clients must not change the values of members of <span class="inline_code"><a href="#bvbltparams">
-bvbltparams</a></span> (or structures it
-references) between BLTs.&nbsp; These values may be used.</p>
-<p class="Header2">Batches For Special Feature BLTs</p>
-<p>Enabling special features of some implementations is a special challenge.&nbsp; But BLTsville is up the task.</p>
-<p>For example, perhaps an implementation is capable of blending four layers at the same time.&nbsp; But BLTsville only allows
-blending to be specified using two layers at a time.&nbsp; How can this be accomplished?</p>
-<p>The most prevalent blending reference used is the <a href="http://dx.doi.org/10.1145/800031.808606">Porter-Duff
-whitepaper</a>, which specifies blending of two sources (A and B).&nbsp; So any N-source blend (N &gt; 2) would require the blends to be
-specified as a grouping of N - 1 two-source blends in order to utilize the
-Porter-Duff equations.&nbsp; That&#39;s how such a blend is specified in BLTsville:</p>
-<p class="small_code_block">bltparams.dstrect.width = bltparams.src1rect.width = bltparams.src2rect.width = dstgeom.width;<br />
-bltparams.dstrect.height = bltparams.src1rect.height = bltparams.src2rect.height = dstgeom.height; <br />
-<br />
-bltparams.flags = BVFLAG_BLEND | BVFLAG_BATCH_BEGIN;<br />
-bltparams.op.blend = BVBLEND_SRCOVER;<br />
-bltparams.dstdesc = &amp;dstdesc;<br />
-bltparams.dstgeom = &amp;dstgeom;<br />
-bltparams.src1.desc = &amp;src1desc;<br />
-bltparams.src1geom = &amp;src1geom;<br />
-bltparams.src2.desc = &amp;src2desc;<br />
-bltparams.src2geom = &amp;src2geom;<br />
-<br />
-bv_blt(&amp;bltparams);<br />
-<br />
-bltparams.src1.desc = &amp;src3desc;<br />
-bltparams.src1geom = &amp;src3geom;<br />
-bltparams.dstdesc = &amp;dstdesc;<br />
-bltparams.dstgeom = &amp;dstgeom;<br />
-<br />
-bltparams.flags = (bltparams.flags &amp; ~BVFLAG_BATCH_MASK) | BVFLAG_BATCH_CONTINUE;<br />
-bltparams.batch = BVBATCH_SRC1 | BVBATCH_SRC2;<br />
-<br />
-bv_blt(&amp;bltparams);<br />
-<br />
-bltparams.src1.desc = &amp;src4desc;<br />
-bltparams.src1geom = &amp;src4geom;<br />
-<br />
-bltparams.flags = (bltparams.flags &amp; ~BVFLAG_BATCH_MASK) | BVFLAG_BATCH_END;<br />
-bltparams.batch = BVBATCH_SRC1;<br />
-<br />
-bv_blt(&amp;bltparams);</p>
-<p>The driver for an implementation that can perform this pair of operations as one BLT would be tasked with recognizing
-that the batch contained BLTs which can be combined.</p>
-<p>The fantastic thing about this approach is that an implementation without the ability to blend N sources in one pass would perform
-the blends separately, but the result would be identical.&nbsp; Moreover, implementations with the ability to combine
-different numbers of operations would likewise produce the same results, even they they used a different number of
-internal steps.&nbsp; Here&#39;s an example:</p>
-<table align="center">
- <tr>
- <td>
-<table>
- <tr>
- <td class="ctr_thin_bord"><strong>Number of<br />
- Layers to<br />
- Blend</strong></td>
- <td class="ctr_thin_bord"><strong>BLTsville<br />
- Operations</strong></td>
- <td class="ctr_thin_bord"><strong>Implementation<br />
- Capable of<br />
- Blending One<br />
- Source with a<br />
- Destination</strong><br />
- (2 inputs)</td>
- <td class="ctr_thin_bord"><strong>Implementation<br />
- Capable of<br />
- Blending Two<br />
- Sources to a<br />
- Destination</strong><br />
- (2 inputs)</td>
- <td class="ctr_thin_bord"><strong>Implementation<br />
- Capable of<br />
- Blending Four<br />
- Sources to a<br />
- Destination</strong><br />
- (4 inputs)</td>
- <td class="ctr_thin_bord"><strong>Implementation<br />
- Capable of<br />
- Blending Eight<br />
- Sources with<br />
- a Destination</strong><br />
- (5 inputs)</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">2</td>
- <td class="nowrap">A over B =&gt; O</td>
- <td class="nowrap">B =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">A over B =&gt; O</td>
- <td class="nowrap">A over B =&gt; O</td>
- <td class="nowrap">A over B =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">3</td>
- <td class="nowrap">B over C =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">C =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">B over C =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">A over B over C =&gt; O</td>
- <td class="nowrap">A over B over C =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">4</td>
- <td class="nowrap">C over D =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">D =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap"> C over D =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap"> A over B over C over D =&gt; O</td>
- <td class="nowrap"> A over B over C over D =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">5</td>
- <td class="nowrap">D over E =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">E =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">D over E =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">D over E =&gt; O<br />
- A over B over C over O =&gt; O</td>
- <td class="nowrap">E =&gt; O<br />
- A over B over C over D over O =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">6</td>
- <td class="nowrap">E over F =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">F =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">E over F =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">D over E over F =&gt; O<br />
- A over B over C over O =&gt; O</td>
- <td class="nowrap">E over F =&gt; O<br />
- A over B over C over D over O =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">7</td>
- <td class="nowrap">F over G =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">G =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">F over G =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">D over E over F over G =&gt; O<br />
- A over B over C over O =&gt; O</td>
- <td class="nowrap">E over F over G =&gt; O<br />
- A over B over C over D over O =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">8</td>
- <td class="nowrap">G over H =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">H =&gt; O<br />
- G over O =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">G over H =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">G over H =&gt; O<br />
- D over E over F over O =&gt; O<br />
- A over B over C over O =&gt; O</td>
- <td class="nowrap">E over F over G over H =&gt; O<br />
- A over B over C over D over O =&gt; O</td>
- </tr>
- <tr>
- <td class="ctr_thin_bord">9</td>
- <td class="nowrap">H over I =&gt; O<br />
- G over O =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">I =&gt; O<br />
- H over O =&gt; O<br />
- G over O =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">H over I =&gt; O<br />
- G over O =&gt; O<br />
- F over O =&gt; O<br />
- E over O =&gt; O<br />
- D over O =&gt; O<br />
- C over O =&gt; O<br />
- B over O =&gt; O<br />
- A over O =&gt; O</td>
- <td class="nowrap">G over H over I =&gt; O<br />
- D over E over F over O =&gt; O<br />
- A over B over C over O =&gt; O</td>
- <td class="nowrap">I =&gt; O<br />
- E over F over G over H over O =&gt; O<br />
- A over B over C over D over O =&gt; O</td>
- </tr>
-</table>
-</td>
- </tr>
- <tr>
- <td class="ctr">Comparison of batched BLTsville calls with internal operations, based on implementation capabilities.
-</td>
- </tr>
-</table>
-<p class="note">NOTE: As mentioned above a batch of BLTs may be serviced in any number of ways.&nbsp; In this example, the
-destination buffer may be used for intermediate results, so it is important that this buffer not be used during the batch--i.e.
-as a displayed buffer.</p>
-<hr />
-<p class="Header1"><a name="start">Where to Start</a></p>
-<p><em>(Note that error checking is omitted in all the examples below for clarity.)</em> </p>
-<p>1.&nbsp; Clients begin by opening one or more BLTsville implementations dynamically.&nbsp; The specific method of doing
-this is dependent on the operating system.&nbsp; For example, Linux might do this like this:</p>
-<p class="small_code_block">struct bltsvillelib<br />
-{<br />
-&nbsp; char* name;<br />
-&nbsp; void* handle;<br />
-&nbsp; BVFN_MAP bv_map;<br />
-&nbsp; BVFN_BLT bv_blt;<br />
-&nbsp; BVFN_UNMAP bv_unmap;<br />
-}; <br />
-<br />
-struct bltsville bvlib[] =<br />
-{<br />
-&nbsp; { &quot;libbltsville_cpu.so&quot;, 0 },<br />
-&nbsp; { &quot;libbltsville_2d.so&quot;, 0 }<br />
-};<br />
-const int NUMBVLIBS = sizeof(bvlib) / sizeof(struct bltsvillelib);<br />
-<br />
-for(int i = 0; i &lt; NUMLIBS; i++)<br />
-{<br />
-&nbsp; bvlib[i].handle = dlopen(bvlib[i].name, RTLD_LOCAL | RTLD_LAZY);<br />
-&nbsp; bvlib[i].bv_map = (BVFN_MAP)dlsym(bvlib[i].handle, &quot;bv_map&quot;);<br />
-&nbsp; bvlib[i].bv_blt = (BVFN_BLT)dlsym(bvlib[i].handle, &quot;bv_blt&quot;);<br />
-&nbsp; bvlib[i].bv_unmap = (BVFN_BLT)dlsym(bvlib[i].handle, &quot;bv_unmap&quot;);<br />
-}<br />
-</p>
-<p>2.&nbsp; Clients then need to create a <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> object for
-each buffer to be accessed in BLTsville:</p>
-<table class="indent">
- <tr>
- <td valign="top">
- <p class="small_code_block_in_table">struct bvbuffdesc buff =<br />
-&nbsp; {sizeof(struct bvbuffdesc), 0};<br />
- <br />
- buff.virtaddr = buffptr;<br />
- buff.length = bufflength;</p>
- </td>
- <td class="ctr">&nbsp;or&nbsp</td>
- <td valign="top">
- <p class="inline_code"><span class="small_code_block_in_table">struct bvbuffdesc buff;<br />
- <br />
- memset(&amp;buff, 0, sizeof(buff));<br />
- buff.structsize = sizeof(buff);<br />
- buff.virtaddr = buffptr;<br />
- buff.length = bufflength;</span></p>
- </td>
- </tr>
-</table>
-<p class="strong_emphasis">Note that the client must ensure that the map element and any additional members in
-<span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span> are initialized to 0.</p>
-<p>3.&nbsp; Next the buffer can be mapped to give the hardware implementations a chance to associate any necessary resources
-with the buffer:</p>
-<table class="indent">
- <tr>
- <td valign="top">
- <p class="small_code_block_in_table">/* do nothing */ </p>
- </td>
- <td class="ctr">&nbsp;or&nbsp;</td>
- <td valign="top">
- <p class="small_code_block_in_table">bvlib[0].bv_map(&amp;buff); </p>
- </td>
- <td class="ctr">&nbsp;or&nbsp;</td>
- <td valign="top">
- <p class="small_code_block_in_table">for(int i = 0; i &lt; NUMLIBS; i++)<br />
- {<br />
-&nbsp; if(bvlib[i].bv_map)<br />
-&nbsp;&nbsp;&nbsp; bvlib[i].bv_map(&amp;buff);<br />
- }</p>
- </td>
- </tr>
-</table>
-<br />
-<table style="width: 100%">
- <tr>
- <td valign="top">a. </td>
- <td>This step is actually optional, as indicated above.&nbsp; However, if the client does not explicitly call
- <span class="inline_code"><a href="#bv_map">bv_map()</a></span>, the mapping must be done by the implementation
- to associate the necessary resources with the buffer.&nbsp; So this mapping must be done later, when
- <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> is called.&nbsp; Additionally, since the client
- did not call <span class="inline_code"><a href="#bv_map">bv_map()</a></span>, it is unlikely that the client will
- call <span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span> to allow the implementation to free the
- resources associated with the buffer.&nbsp; So the implementation will internally unmap the resources after completing
- the BLT.&nbsp; This means that the mapping and unmapping overhead will be encountered on every call to
- <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span>.<br />
- <em><br />
- In general, the CPU implementations have (almost) no overhead associated with mapping and unmapping.&nbsp; So opting
- not to make the <span class="inline_code"><a href="#bv_map">bv_map()</a></span> call for CPU implementations is
- likely to have negligible difference in <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> performance.<br />
- </em></td>
- </tr>
- <tr>
- <td valign="top">b. </td>
- <td>Calling <span class="inline_code"><a href="#bv_map">bv_map()</a></span> once for each buffer is enough to tell
- the implementations that the client can be trusted to call <span class="inline_code"><a href="#bv_unmap">bv_unmap()</a></span>
- when work with the buffer is complete, as indicated above.&nbsp; It does not matter which implementation&#39;s
- <span class="inline_code"><a href="#bv_map">bv_map()</a></span> is called.&nbsp; However, that implementation is
- the only one which will perform the mapping immediately.&nbsp; All other implementations will perform a <em>lazy
- mapping</em> only when their <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> call is invoked.<br />
- <br />
- This allows the client to avoid the overhead of mapping and unmapping the buffers on each
- <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span> call.&nbsp; It also avoids the associated mapping
- and unmapping overhead if a given implementation is never used.<br />
- <br />
- <em>As mentioned above, the CPU implementations have (almost) no overhead associated with mapping and unmapping,
- so they are a good choice to use for the call to <span class="inline_code"><a href="#bv_map">bv_map()</a></span>.<br />
- </em></td>
- </tr>
- <tr>
- <td valign="top">c. </td>
- <td>If the client wants direct control over the mapping and unmapping overhead, it can call the
- <span class="inline_code"><a href="#bv_map">bv_map()</a></span> function of each implementation, as indicated above.&nbsp;
- Each implementation will perform the mapping at that time, so that the overhead will not appear on subsequent calls
- to <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span>. </td>
- </tr>
-</table>
-<p>4.&nbsp; Next the client must create <span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> objects for
-each way in which a buffer will be accessed.&nbsp; Often, there is only one way in which a buffer is accessed, so there
-will be the same number of buffers, <span class="inline_code"><a href="#bvbuffdesc">bvbuffdesc</a></span>, and
-<span class="inline_code"><a href="#bvsurfgeom">bvsurfgeom</a></span> objects.&nbsp; If that&#39;s the case, it may be convenient
-for the client to combine them into a parent structure.&nbsp; It may even be possible to share a single bvbuffgeom structure
-among buffers.&nbsp; Or there will be times when it is necessary to treat a buffer in different ways for different BLTs.&nbsp;
-Having these two structures separated allows all of these combinations.</p>
-<table class="indent">
- <tr>
- <td valign="top">
- <p class="small_code_block_in_table">struct bvsurfgeom geom =<br />
-&nbsp; {sizeof(struct bvsurfgeom), 0};<br />
- <br />
- geom.format = OCDFMT_RGB24;<br />
- geom.width = width;<br />
- geom.height = height;<br />
- geom.virtstride = stride;</p>
- </td>
- <td class="ctr">&nbsp;or&nbsp;</td>
- <td valign="top">
- <p class="inline_code"><span class="small_code_block_in_table">struct bvsurfgeom geom;
- <br />
- memset(&amp;geom, 0, sizeof(geom));<br />
- geom.structsize = sizeof(geom);<br />
- geom.width = width;<br />
- geom.height = height;<br />
- geom.virtstride = stride;</span></p>
- </td>
- </tr>
-</table>
-<p class="strong_emphasis">Note that the client must ensure that any additional members in <span class="inline_code">
-<a href="#bvsurfgeom">bvsurfgeom</a></span> are initialized to 0 for future compatibility.</p>
-<p>5.&nbsp; Now the client is ready to fill in a bvbltparams structure to specify the type of BLT requested.&nbsp; Here
-is an example of a simple copy from the lower right corner of a surface to the upper left:</p>
-<p class="small_code_block">struct bvbltparams bltparams = {sizeof(struct bvbltparams), 0};<br />
-<br />
-bltparams.flags = BVFLAG_ROP;<br />
-bltparams.op.rop = 0xCCCC; /* SRCCOPY */<br />
-bltparams.dstdesc = &amp;buff;<br />
-bltparams.dstgeom = &amp;geom;<br />
-bltparams.dstrect.left = 0;<br />
-bltparams.dstrect.top = 0;<br />
-bltparams.dstwidth = width / 2;<br />
-bltparams.dstheight = height / 2;<br />
-bltparams.src1.desc = &amp;buff;<br />
-bltparams.src1geom = &amp;geom;<br />
-bltparams.src1rect.left = width / 2;<br />
-bltparams.src1rect.top = height / 2;<br />
-bltparams.src1rect.width = width / 2;<br />
-bltparams.src1rect.height = height / 2;</p>
-<p>6.&nbsp; And next the client can trigger the BLT by calling <span class="inline_code"><a href="#bv_blt">bv_blt()</a></span>:</p>
-<p class="small_code_block">bv_blt(&amp;bltparams); </p>
-<p><em>If the client cannot complete the requested BLT, it returns a </em><span class="inline_code"><a href="#bverror">
-<em>bverror</em></a></span><em> indicating the issue. </em></p>
-<p>7.&nbsp; Finally, the client should clean up:</p>
-<p class="small_code_block">bv_unmap(&amp;buff); </p>
-<hr />
-<p class="Header1"><a name="Kernel_Mode_Interface">Kernel Mode Interface</a></p>
-<p>The kernel mode interface differs only slightly from the user mode interface.&nbsp; Currently there are two differences
-in the general kernel interface, and one in the Linux/Android interface:</p>
-<p class="Code_Header_2">bvbuffdesc.auxtype/auxptr</p>
-<p><span class="inline_code"><a href="#bvbuffdesc.auxtype">bvbuffdesc.auxtype</a></span> is an <span class="inline_code">enum</span>,
-indicating the type of the
-<span class="inline_code"><a href="#bvbuffdesc.auxptr">bvbuffdesc.auxptr</a></span>.&nbsp; The enumeration values and
-the associated types are:</p>
-<table class="indent_thick_bord">
- <tr>
- <td class="thin_bord_dbl_botbord"><span class="inline_code"><a href="#bvbuffdesc.auxtype">bvbuffdesc.auxtype</a></span></td>
- <td class="thin_bord_dbl_botbord">
-<span class="inline_code"><a href="#bvbuffdesc.auxptr">bvbuffdesc.auxptr</a></span> type</td>
- <td class="thin_bord_dbl_botbord">Notes</td>
- </tr>
- <tr>
- <td class="thin_bord"><span class="inline_code"><a name="BVAT_PHYSDESC">BVAT_PHYSDESC</a></span></td>
- <td class="thin_bord">
-<a href="#bvphysdesc" class="inline_code">bvphysdesc</a></td>
- <td class="thin_bord">Used to specify the physical pages of a physically discontiguous buffer constructed using
- a single page size.&nbsp; This may be used with physically contiguous buffers as well, but
- <span class="inline_code"><a href="#BVAT_PHYSADDR">BVAT_PHYSADDR</a></span> is preferred.</td>
- </tr>
- <tr>
- <td class="thin_bord"><span class="inline_code"><a name="BVAT_PHYSADDR">BVAT_PHYSADDR</a></span></td>
- <td class="thin_bord">physical address</td>
- <td class="thin_bord">Used to specify the starting physical address of a physically contiguous buffer.</td>
- </tr>
-</table>
-<p>The methods of describing the buffer using physical addresses is not exposed in user mode for security reasons.</p>
-<hr />
-<p class="Code_Header"><a name="bvphysdesc">bvphysdesc</a></p>
-<p class="small_code_block">struct bvphysdesc {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvphysdesc.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#bvphysdesc.pagesize">pagesize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long *<a href="#bvphysdesc.pagearray">pagearray</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bvphysdesc.pagecount">pagecount</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned long <a href="#bvphysdesc.pageoffset">pageoffset</a>;<br />
-};</p>
-<p class="Code_Header_2"><a name="bvphysdesc.structsize">bvphysdesc.structsize</a></p>
-<p class="code_block">unsigned int structsize;</p>
-<p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
-<a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
-<p class="Code_Header_2"><a name="bvphysdesc.pagesize">bvphysdesc.pagesize</a></p>
-<p class="code_block">unsigned long pagesize;</p>
-<p>This member indicates the size of the physical pages containing the buffer.&nbsp; <span class="inline_code">BVAT_PHYSDESC</span>/<span class="inline_code">bvphysdesc
-</span>does not support buffers which reside in pages that are not all the same size.&nbsp; <span class="inline_code">
-bvphysdesc.pagesize</span> is used to indicate the length of the pages in the <span class="inline_code">
-<a href="#bvphysdesc.pagearray">bvphysdesc.pagearray</a></span> as well as the expected alignment of those pages.&nbsp; If this value is 0, the default
-page size of the system is assumed.</p>
-<p class="note">NOTE:&nbsp; When used with physically contiguous buffers, this member should be set to the length of the
-buffer, which is the same as the value in <span class="inline_code"><a href="#bvbuffdesc.length">bvbuffdesc.length</a></span>.</p>
-<p class="Code_Header_2"><a name="bvphysdesc.pagearray">bvphysdesc.pagearray</a></p>
-<p class="code_block">unsigned long *pagearray;</p>
-<p>This member is an array of <span class="inline_code">unsigned long</span>s holding the physical addresses of the pages
-holding the buffer.&nbsp; The array contains <span class="inline_code"><a href="#bvphysdesc.pagecount">pagecount</a></span>
-entries.&nbsp; The specific format of the physical addresses is O/S dependent.&nbsp; However, <span class="inline_code">
-BVAT_PHYSDESC</span>/<span class="inline_code">bvphysdesc</span> only supports 32-bit physical addresses.</p>
-<p>Addresses in this array must be aligned on <span class="inline_code"><a href="#bvphysdesc.pagesize">
-bvphysdesc.pagesize</a></span> boundaries.&nbsp; Use the <span class="inline_code"><a href="#bvphysdesc.pageoffset">
-bvphysdesc.pageoffset</a></span> member to indicate the offset from the start of the first page to the beginning of the
-buffer.</p>
-<p class="note">NOTE:&nbsp; When used with physically contiguous buffers, the first (only) address in this array should
-be aligned on the system default page boundary, and the <span class="inline_code"><a href="#bvphysdesc.pageoffset">
-bvphysdesc.pageoffset</a></span> member should be used to indicate the offset from that address to the beginning of the
-buffer.</p>
-<p class="Code_Header_2"><a name="bvphysdesc.pagecount">bvphysdesc.pagecount</a></p>
-<p class="code_block">unsigned int pagecount;</p>
-<p>This member indicates the number of pages in the array pointed to by <span class="inline_code">
-<a href="#bvphysdesc.pagearray">bvphysdesc.pagearray</a></span>.</p>
-<p class="note">NOTE:&nbsp; When used with physically contiguous buffers, this member should be set to 1.</p>
-<p class="Code_Header_2"><a name="bvphysdesc.pageoffset">bvphysdesc.pageoffset</a></p>
-<p class="code_block">unsigned long pageoffset;</p>
-<p>This member indicates the number of bytes from the start of the first page (<span class="inline_code">*pagearray</span>)
-to the start of the buffer.&nbsp; The value must be less than <span class="inline_code"><a href="#bvphysdesc.pagesize">
-bvphysdesc.pagesize</a></span>.</p>
-<p class="imponly"><strong>Implementations Only</strong><br />
-<br />
-Implementations should not ignore this member.</p>
-<hr />
-<p class="Header2">bventry</p>
-<p>Kernel mode entry cannot be the same as the user mode.&nbsp; The specific method of accessing the kernel interface is
-O/S specific.&nbsp; However, the following interface is currently defined for the specified O/Ss:</p>
-<table class="example">
- <tr>
- <td>
- <p class="Header4">Linux/Android</p>
- <p class="Code_Header"><a name="bventry">bventry</a></p>
- <p>This structure is used to obtain the pointers to the implementation&#39;s BLTsville calls.&nbsp; The client can call
- the default <span class="inline_code">bv2d_entry()</span> function to obtain the pointers to the implementation
- chosen by the system integrators, or it can call a specific function to get the pointers for a specific implementation
- (e.g. <span class="inline_code">gcbv_entry()</span>).</p>
- <p class="small_code_block">struct bventry {<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int <a href="#bventry.structsize">structsize</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bv_map">BVFN_MAP</a> <a href="#bventry.bv_map">bv_map</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bv_unmap">BVFN_UNMAP</a> <a href="#bventry.bv_unmap">bv_unmap</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bv_blt">BVFN_BLT</a> <a href="#bventry.bv_blt">bv_blt</a>;<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#bv_cache">BVFN_CACHE</a> <a href="#bventry.bv_cache">bv_cache</a>;<br />
- };</p>
- <p class="Code_Header_2"><a name="bventry.structsize">bventry.structsize</a></p>
- <p class="code_block">unsigned int structsize;</p>
- <p>This member is used for compatibility between BLTsville versions.&nbsp; (See <span class="inline_code">
- <a href="#bvbltparams.structsize">bvbltparams.structsize</a></span> for an explanation.) </p>
- <p class="Code_Header_2"><a name="bventry.bv_map">bventry.bv_map</a>/<a name="bventry.bv_unmap">bv_unmap</a>/<a name="bventry.bv_blt">bv_blt</a>/<a name="bventry.bv_cache">bv_cache</a></p>
- <p class="code_block">BVFN_MAP bv_map;<br />
- BVFN_UNMAP bv_unmap;<br />
- BVFN_BLT bv_blt;<br />
- BVFN_CACHE bv_cache;</p>
- <p>These members hold pointers to the functions for the specific implementation queried with a call to
- <span class="inline_code">*_entry()</span>.</p>
- <p class="note">NOTE:&nbsp; <span class="inline_code"><a href="#bv_cache">bv_cache()</a></span> is optional, so
- this pointer may be set to 0.</p>
- </td>
- </tr>
-</table>
-<br />
-<hr /><br />
-<p class="Header2">Linux/Android Deviation</p>
-<p>Although the linked list used in the <span class="inline_code"><a href="#bvbuffmap">bvbuffmap</a></span> structure is
-not complicated, there may be a requirement to use the standard Linux/Android kernel linked list in that environment.&nbsp;
-To facilitate this, the <span class="inline_code"><a href="#bvbuffmap.map">bvbuffmap.map</a></span> entry is replaced by
-the following entry for Linux/Android <span class="underline">kernel mode only</span>:</p>
-<p class="Code_Header"><a name="bvbuffmap.node" class="Code_Header_2">bvbuffmap.node</a></p>
-<p class="code_block">struct list_head node;</p>
-<p>This member is used to reference the containing linked list for the <span class="inline_code"><a href="#bvbuffmap">bvbuffmap</a></span>
-structures associated with the buffer.</p>
-
-</body>
-
-</html>
diff --git a/bltsville/bltsville/ocdtab.png b/bltsville/bltsville/ocdtab.png
deleted file mode 100644
index 239c9bb..0000000
--- a/bltsville/bltsville/ocdtab.png
+++ /dev/null
Binary files differ
diff --git a/bltsville/gcbv/Android.mk b/bltsville/gcbv/Android.mk
deleted file mode 100644
index 5676b76..0000000
--- a/bltsville/gcbv/Android.mk
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Copyright (c) 2012,
-# Texas Instruments, Inc. and Vivante Corporation.
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of Texas Instruments, Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL TEXAS INSTRUMENTS, INC. BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
- gcmain.c \
- mirror/gcbv.c \
- mirror/gcparser.c \
- mirror/gcmap.c \
- mirror/gcbuffer.c \
- mirror/gcfill.c \
- mirror/gcblit.c \
- mirror/gcfilter.c \
- mirror/gcdbglog.c
-
-LOCAL_CFLAGS :=
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/mirror \
- $(LOCAL_PATH)/mirror/include \
- $(LOCAL_PATH)/../bltsville/include \
- $(LOCAL_PATH)/../ocd/include
-
-VERSION_H := $(LOCAL_PATH)/version.h
-BV_VERSION := $(shell grep "VER_FILEVERSION_STR" $(VERSION_H) | sed "s,.*\"\([0-9.]*\)\\\0.*,\1,")
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := libbltsville_gc2d
-LOCAL_MODULE_SUFFIX := .$(BV_VERSION).so
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/../vendor/lib
-
-include $(BUILD_SHARED_LIBRARY)
-
-#Creating SymLinks
-#libbltsville_gc2d.so -> libbltsville_gc2d.VERSION.so
-#libbltsville_hw2d.so -> libbltsville_gc2d.so
-SYMLINKS := $(TARGET_OUT_VENDOR)/lib/libbltsville_gc2d.so
-$(SYMLINKS): GC2D_BINARY := ./$(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX)
-$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
- @echo "Symlink: $@ -> $(GC2D_BINARY)"
- @rm -rf $@
- $(hide) ln -fs $(GC2D_BINARY) $@
-
-SYMLINKS1 := $(TARGET_OUT_VENDOR)/lib/libbltsville_hw2d.so
-$(SYMLINKS1): LINK_BINARY := ./libbltsville_gc2d.so
-$(SYMLINKS1): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
- @echo "Symlink: $@ -> $(LINK_BINARY)"
- @rm -rf $@
- $(hide) ln -fs $(LINK_BINARY) $@
-
-ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS) $(SYMLINKS1)
-
-# for mm/mmm
-all_modules: $(SYMLINKS) $(SYMLINKS1)
-
diff --git a/bltsville/gcbv/gcmain.c b/bltsville/gcbv/gcmain.c
deleted file mode 100644
index 7d8b0bd..0000000
--- a/bltsville/gcbv/gcmain.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/*
- * Copyright (c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Texas Instruments, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL TEXAS INSTRUMENTS, INC. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcmain.h"
-#include "gcbv.h"
-#include <semaphore.h>
-
-#if ANDROID
-#include <cutils/log.h>
-#include <cutils/process_name.h>
-#endif
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_INIT (1 << 0)
-#define GCZONE_CALLBACK (1 << 1)
-
-GCDBG_FILTERDEF(gcmain, GCZONE_NONE,
- "init",
- "callback")
-
-
-static int g_handle;
-
-
-/*******************************************************************************
- * Callback manager.
- */
-enum gccallbackinfo_status {
- UNINIT,
- SUPPORTED,
- UNSUPPORTED
-};
-
-static const char * const g_statusNames[] = {
- "UNINIT",
- "SUPPORTED",
- "UNSUPPORTED"
-};
-
-struct gccallbackinfo {
- /* Callback status */
- enum gccallbackinfo_status status;
-
- /* Callback handle. */
- unsigned long handle;
-
- /* Termination semaphore. */
- sem_t stop;
-
- /* Callback thread handle. */
- pthread_t thread;
-
- /* Start/stop mutex */
- pthread_mutex_t mutex;
-};
-
-struct gccallbackinfo g_callbackinfo = {
- .status = UNINIT
-};
-
-static void *callbackthread(void *_gccallbackinfo)
-{
- struct gccallbackinfo *gccallbackinfo;
- struct gcicallbackwait gccmdcallbackwait;
- int result;
-
- /* Get callback info. */
- gccallbackinfo = (struct gccallbackinfo *) _gccallbackinfo;
-
- /* Initialize the command. */
- gccmdcallbackwait.handle = gccallbackinfo->handle;
- gccmdcallbackwait.timeoutms = 2000;
-
- /* Enter wait loop. */
- while (1) {
- /* Call the kernel to wait for callback event. */
- result = ioctl(g_handle, GCIOCTL_CALLBACK_WAIT,
- &gccmdcallbackwait);
- if (result == 0) {
- if (gccmdcallbackwait.gcerror == GCERR_NONE) {
- /* Work completed. */
- GCDBG(GCZONE_CALLBACK,
- "callback 0x%08X(0x%08X).\n",
- (unsigned int)
- gccmdcallbackwait.callback,
- (unsigned int)
- gccmdcallbackwait.callbackparam);
-
- /* Invoke the callback. */
- gccmdcallbackwait.callback(
- gccmdcallbackwait.callbackparam);
- } else if (gccmdcallbackwait.gcerror == GCERR_TIMEOUT) {
- /* Timeout. */
- GCDBG(GCZONE_CALLBACK,
- "callback wait timeout.\n");
- } else {
- /* Error occurred. */
- GCERR("callback wait failed (0x%08X).\n",
- gccmdcallbackwait.gcerror);
- break;
- }
- } else if (result != -EINTR) {
- GCERR("callback wait ioctl failed (%d).\n", result);
- break;
- }
-
- /* Stop requested? */
- if (sem_trywait(&gccallbackinfo->stop) == 0) {
- GCDBG(GCZONE_CALLBACK, "terminating.\n");
- break;
- }
- }
-
- return NULL;
-}
-
-static int callback_start(struct gccallbackinfo *gccallbackinfo)
-{
- int result = 0;
- struct gcicallback gccmdcallback;
-
- GCENTER(GCZONE_CALLBACK);
-
- pthread_mutex_lock(&gccallbackinfo->mutex);
-
- if (gccallbackinfo->status != UNINIT) {
- pthread_mutex_unlock(&gccallbackinfo->mutex);
- return 0;
- }
-
- gccmdcallback.handle = 0;
-
- gccallbackinfo->status =
-#if ANDROID
- /* The Android zygote process refuses to fork if there is
- * more than one thread present. */
- (strcmp(get_process_name(), "zygote") == 0) ? UNSUPPORTED :
-#endif
- SUPPORTED;
-
- GCDBG(GCZONE_CALLBACK, "callback status: %s\n",
- g_statusNames[gccallbackinfo->status]);
-
- if (gccallbackinfo->status == SUPPORTED) {
- /* Initialize callback. */
- result = ioctl(g_handle,
- GCIOCTL_CALLBACK_ALLOC,
- &gccmdcallback);
- if (result != 0) {
- GCERR("callback ioctl failed (%d).\n", result);
- goto fail;
- }
-
- if (gccmdcallback.gcerror != GCERR_NONE) {
- GCERR("failed to initialize callback "
- "mechanism (0x%08X).\n",
- gccmdcallback.gcerror);
- goto fail;
- }
-
- gccallbackinfo->handle = gccmdcallback.handle;
-
- /* Initialize the termination semaphore. */
- result = sem_init(&gccallbackinfo->stop, 0, 0);
- if (result != 0) {
- GCERR("callback semaphore init failed (%d).\n", result);
- goto fail;
- }
-
- /* Start the thread. */
- result = pthread_create(&gccallbackinfo->thread, NULL,
- callbackthread, gccallbackinfo);
- if (result != 0) {
- GCERR("failed to start callback thread.\n");
- goto fail;
- }
-
- gccmdcallback.handle = 0;
- }
-
-fail:
- if (gccmdcallback.handle != 0) {
- ioctl(g_handle, GCIOCTL_CALLBACK_FREE, &gccmdcallback);
- gccallbackinfo->handle = 0;
- }
-
- pthread_mutex_unlock(&gccallbackinfo->mutex);
-
- GCEXITARG(GCZONE_CALLBACK, "result=%d", result);
- return result;
-}
-
-static void callback_stop(struct gccallbackinfo *gccallbackinfo)
-{
- struct gcicallback gccmdcallback;
-
- GCENTER(GCZONE_CALLBACK);
-
- pthread_mutex_lock(&gccallbackinfo->mutex);
-
- if (gccallbackinfo->status == SUPPORTED) {
- if (gccallbackinfo->thread) {
- sem_post(&gccallbackinfo->stop);
- pthread_kill(gccallbackinfo->thread, SIGINT);
-
- GCDBG(GCZONE_CALLBACK,
- "waiting to join callback thread...\n");
-
- pthread_join(gccallbackinfo->thread, NULL);
- gccallbackinfo->thread = 0;
- }
-
- /* Free kernel resources. */
- gccmdcallback.handle = gccallbackinfo->handle;
- ioctl(g_handle, GCIOCTL_CALLBACK_FREE, &gccmdcallback);
- gccallbackinfo->handle = 0;
- }
-
- gccallbackinfo->status == UNINIT;
-
- pthread_mutex_unlock(&gccallbackinfo->mutex);
-
- GCEXIT(GCZONE_CALLBACK);
-}
-
-
-/*******************************************************************************
- * IOCTL wrappers.
- */
-
-#if GCDEBUG_ENABLE && 0
-#define GCPRINTDELAY() sleep(1)
-#else
-#define GCPRINTDELAY()
-#endif
-
-void gc_getcaps_wrapper(struct gcicaps *gcicaps)
-{
- int result;
-
- GCPRINTDELAY();
-
- result = ioctl(g_handle, GCIOCTL_GETCAPS, gcicaps);
- if (result != 0) {
- GCERR("ioctl failed (%d).\n", result);
- gcicaps->gcerror = GCERR_IOCTL;
- }
-}
-
-void gc_map_wrapper(struct gcimap *gcmap)
-{
- int result;
-
- GCPRINTDELAY();
- result = ioctl(g_handle, GCIOCTL_MAP, gcmap);
-
- if (result != 0) {
- GCERR("ioctl failed (%d).\n", result);
- gcmap->gcerror = GCERR_IOCTL;
- }
-}
-
-void gc_unmap_wrapper(struct gcimap *gcmap)
-{
- int result;
-
- GCPRINTDELAY();
- result = ioctl(g_handle, GCIOCTL_UNMAP, gcmap);
-
- if (result != 0) {
- GCERR("ioctl failed (%d).\n", result);
- gcmap->gcerror = GCERR_IOCTL;
- }
-}
-
-void gc_commit_wrapper(struct gcicommit *gccommit)
-{
- int result;
-
- GCPRINTDELAY();
-
- /* Callback start is delayed until needed to handle a case
- * where it's unsupported on Android. */
- if (gccommit->callback)
- callback_start(&g_callbackinfo);
-
- gccommit->handle = g_callbackinfo.handle;
- result = ioctl(g_handle, GCIOCTL_COMMIT, gccommit);
-
- if (result != 0) {
- GCERR("ioctl failed (%d).\n", result);
- gccommit->gcerror = GCERR_IOCTL;
- }
-}
-
-void gc_callback_wrapper(struct gcicallbackarm *gcicallbackarm)
-{
- int result;
-
- GCPRINTDELAY();
-
- callback_start(&g_callbackinfo);
-
- gcicallbackarm->handle = g_callbackinfo.handle;
- result = ioctl(g_handle, GCIOCTL_CALLBACK_ARM, gcicallbackarm);
- if (result != 0) {
- GCERR("ioctl failed (%d).\n", result);
- gcicallbackarm->gcerror = GCERR_IOCTL;
- }
-}
-
-
-/*******************************************************************************
- * Convert floating point in 0..1 range to an 8-bit value in range 0..255.
- */
-
-union gcfp {
- struct {
- unsigned int mantissa:23;
- unsigned int exponent:8;
- unsigned int sign:1;
- } comp;
-
- float value;
-};
-
-unsigned char gcfp2norm8(float value)
-{
- union gcfp gcfp;
- int exponent;
- unsigned int mantissa;
- int shift;
-
- /* Get access to components. */
- gcfp.value = value;
-
- /* Clamp negatives. */
- if (gcfp.comp.sign)
- return 0;
-
- /* Get unbiased exponent. */
- exponent = (int) gcfp.comp.exponent - 127;
-
- /* Clamp if too large. */
- if (exponent >= 0)
- return 255;
-
- /* Clamp if too small. */
- if (exponent < -8)
- return 0;
-
- /* Determine the shift value. */
- shift = (23 - 8) - exponent;
-
- /* Compute the mantissa. */
- mantissa = (gcfp.comp.mantissa | 0x00800000) >> shift;
-
- /* Normalize. */
- mantissa = (mantissa * 255) >> 8;
-
- return (unsigned char) mantissa;
-}
-
-
-/*******************************************************************************
- * Surface allocation.
- */
-
-enum bverror allocate_surface(struct bvbuffdesc **bvbuffdesc,
- void **buffer,
- unsigned int size)
-{
- enum bverror bverror = BVERR_NONE;
- struct bvbuffdesc *tempbuffdesc = NULL;
- void *tempbuff = NULL;
- unsigned long base;
-
- /* Allocate surface buffer descriptor. */
- tempbuffdesc = gcalloc(struct bvbuffdesc, sizeof(struct bvbuffdesc));
- if (tempbuffdesc == NULL) {
- BVSETERROR(BVERR_OOM, "failed to allocate surface");
- goto exit;
- }
-
- /* Initialize buffer descriptor. */
- tempbuffdesc->structsize = sizeof(struct bvbuffdesc);
- tempbuffdesc->virtaddr = NULL;
- tempbuffdesc->length = size;
- tempbuffdesc->map = NULL;
- tempbuffdesc->auxtype = BVAT_NONE;
- tempbuffdesc->auxptr = NULL;
-
- /* Allocate the surface. */
- tempbuff = gcalloc(void, size + GC_MAX_BASE_ALIGN);
- if (tempbuff == NULL) {
- BVSETERROR(BVERR_OOM, "failed to allocate surface");
- goto exit;
- }
-
- /* Align the base address. */
- tempbuffdesc->virtaddr
- = (void *) (((unsigned long) tempbuff + GC_MAX_BASE_ALIGN - 1)
- & ~(GC_MAX_BASE_ALIGN - 1));
-
- /* Set return pointers. */
- *bvbuffdesc = tempbuffdesc;
- *buffer = tempbuff;
- return BVERR_NONE;
-
-exit:
- free_surface(tempbuffdesc, tempbuff);
- return bverror;
-}
-
-void free_surface(struct bvbuffdesc *bvbuffdesc,
- void *buffer)
-{
- gcfree(buffer);
- gcfree(bvbuffdesc);
-}
-
-
-/*******************************************************************************
- * Cache operation wrapper.
- */
-
-enum bverror gcbvcacheop(int count, struct c2dmrgn rgn[],
- enum bvcacheop cacheop)
-{
- int result;
- struct gcicache xfer;
-
- if ((count < 0) || (count > 3))
- return BVERR_CACHEOP;
-
- xfer.count = count;
- xfer.dir = cacheop;
- memcpy(xfer.rgn, rgn, count * sizeof(struct c2dmrgn));
-
- GCPRINTDELAY();
- result = ioctl(g_handle, GCIOCTL_CACHE, &xfer);
-
- if (result != 0)
- GCERR("ioctl failed (%d).\n", result);
-
- return BVERR_NONE;
-}
-
-
-/*******************************************************************************
- * Device init/cleanup.
- */
-
-void __attribute__((constructor)) dev_init(void)
-{
- char *env;
-
- env = getenv("GCBV_DEBUG");
- if (env && (atol(env) != 0))
- GCDBG_ENABLEDUMP();
-
- GCDBG_INIT();
- GCDBG_REGISTER(gcmain);
-
- GCENTER(GCZONE_INIT);
-
- g_handle = open("/dev/gcioctl", O_RDWR);
- if (g_handle == -1) {
- GCERR("failed to open device (%d).\n", errno);
- goto fail;
- }
-
- bv_init();
-
- pthread_mutex_init(&g_callbackinfo.mutex, 0);
-
- GCEXIT(GCZONE_INIT);
- return;
-
-fail:
- if (g_handle > 0) {
- close(g_handle);
- g_handle = 0;
- }
-
- GCEXIT(GCZONE_INIT);
-}
-
-void __attribute__((destructor)) dev_exit(void)
-{
- GCENTER(GCZONE_INIT);
-
- bv_exit();
- callback_stop(&g_callbackinfo);
-
- if (g_handle != 0) {
- close(g_handle);
- g_handle = 0;
- }
-
- GCEXIT(GCZONE_INIT);
- GCDBG_EXIT();
-}
-
diff --git a/bltsville/gcbv/gcmain.h b/bltsville/gcbv/gcmain.h
deleted file mode 100644
index 6d6489c..0000000
--- a/bltsville/gcbv/gcmain.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Texas Instruments, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL TEXAS INSTRUMENTS, INC. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCMAIN_H
-#define GCMAIN_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <gcx.h>
-#include <gcioctl.h>
-#include <bltsville.h>
-#include <bvinternal.h>
-#include <bverror.h>
-
-#define GC_DEV_NAME "gc2duser"
-
-
-/*******************************************************************************
- * Miscellaneous macros.
- */
-
-/* Not present in userspace bltsville headers */
-#define BVAT_PHYSDESC 0xDEADBEEF
-
-#define gcalloc(type, size) \
- (type *) malloc(size)
-
-#define gcfree(ptr) \
- free(ptr)
-
-#define max(x, y) (x > y ? x : y)
-#define min(x, y) (x < y ? x : y)
-
-#define EXPORT_SYMBOL(sym)
-
-#define gc_debug_blt(...)
-
-typedef int64_t s64;
-typedef uint64_t u64;
-
-#define div_u64(x, y) ((x) / (y))
-#define div_s64(x, y) ((x) / (y))
-#define div64_u64(x, y) ((x) / (y))
-#define div64_s64(x, y) ((x) / (y))
-
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-
-/*******************************************************************************
- * Not defined in bltsville userspace headers.
- */
-
-struct bvphysdesc {
- unsigned int structsize; /* used to identify struct version */
- unsigned long pagesize; /* page size in bytes */
- unsigned long *pagearray; /* array of physical pages */
- unsigned int pagecount; /* number of pages in the pagearray */
- unsigned long pageoffset; /* page offset in bytes */
-};
-
-
-/*******************************************************************************
- * IOCTL wrappers.
- */
-
-void gc_getcaps_wrapper(struct gcicaps *gcicaps);
-void gc_map_wrapper(struct gcimap *gcimap);
-void gc_unmap_wrapper(struct gcimap *gcimap);
-void gc_commit_wrapper(struct gcicommit *gcicommit);
-void gc_callback_wrapper(struct gcicallbackarm *gcicallbackarm);
-
-
-/*******************************************************************************
- * Surface allocation.
- */
-enum bverror allocate_surface(struct bvbuffdesc **bvbuffdesc,
- void **buffer,
- unsigned int size);
-
-void free_surface(struct bvbuffdesc *bvbuffdesc,
- void *buffer);
-
-
-/*******************************************************************************
- * Floating point conversions.
- */
-
-unsigned char gcfp2norm8(float value);
-
-
-/*******************************************************************************
- * Cache operation wrapper.
- */
-
-enum bverror gcbvcacheop(int count, struct c2dmrgn rgn[],
- enum bvcacheop cacheop);
-
-
-/*******************************************************************************
- * BLTsville API.
- */
-
-void bv_init(void);
-void bv_exit(void);
-
-enum bverror bv_map(struct bvbuffdesc *buffdesc);
-enum bverror bv_unmap(struct bvbuffdesc *buffdesc);
-enum bverror bv_blt(struct bvbltparams *bltparams);
-enum bverror bv_cache(struct bvcopparams *copparams);
-
-#endif
diff --git a/bltsville/gcbv/mirror/gcblit.c b/bltsville/gcbv/mirror/gcblit.c
deleted file mode 100644
index 5dae273..0000000
--- a/bltsville/gcbv/mirror/gcblit.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_BLEND (1 << 0)
-#define GCZONE_SURF (1 << 1)
-#define GCZONE_BLIT (1 << 3)
-
-GCDBG_FILTERDEF(blit, GCZONE_NONE,
- "blend",
- "surf",
- "blit")
-
-
-static enum bverror do_blit_end(struct bvbltparams *bvbltparams,
- struct gcbatch *batch)
-{
- enum bverror bverror;
- struct gcblit *gcblit;
- struct gcmobltconfig *gcmobltconfig;
- struct gcmostartde *gcmostartde;
-
- GCENTER(GCZONE_BLIT);
-
- /* Get a shortcut to the operation specific data. */
- gcblit = &batch->op.blit;
-
- GCDBG(GCZONE_BLIT, "finalizing the blit, scrcount = %d\n",
- gcblit->srccount);
-
- /***********************************************************************
- * Configure the operation.
- */
-
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmobltconfig),
- (void **) &gcmobltconfig);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Configure multi-source control. */
- gcmobltconfig->multisource_ldst = gcmobltconfig_multisource_ldst;
- gcmobltconfig->multisource.raw = 0;
- gcmobltconfig->multisource.reg.srccount = gcblit->srccount - 1;
-
- GCDBG(GCZONE_BLIT, "blockenable = %d\n", gcblit->blockenable);
- if (gcblit->blockenable) {
- gcmobltconfig->multisource.reg.horblock
- = GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL16;
- gcmobltconfig->multisource.reg.verblock
- = GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE64;
- } else {
- gcmobltconfig->multisource.reg.horblock
- = GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL128;
- gcmobltconfig->multisource.reg.verblock
- = GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE1;
- }
-
- /* Set destination configuration. */
- GCDBG(GCZONE_BLIT, " swizzle code = %d\n", gcblit->swizzle);
- GCDBG(GCZONE_BLIT, " format code = %d\n", gcblit->format);
-
- gcmobltconfig->dstconfig_ldst = gcmobltconfig_dstconfig_ldst;
- gcmobltconfig->dstconfig.raw = 0;
- gcmobltconfig->dstconfig.reg.swizzle = gcblit->swizzle;
- gcmobltconfig->dstconfig.reg.format = gcblit->format;
- gcmobltconfig->dstconfig.reg.command = gcblit->multisrc
- ? GCREG_DEST_CONFIG_COMMAND_MULTI_SOURCE_BLT
- : GCREG_DEST_CONFIG_COMMAND_BIT_BLT;
-
- /***********************************************************************
- * Start the operation.
- */
-
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmostartde),
- (void **) &gcmostartde);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set START_DE command. */
- gcmostartde->startde.cmd.fld = gcfldstartde;
-
- /* Set destination rectangle. */
- gcmostartde->rect.left = gcblit->dstrect.left;
- gcmostartde->rect.top = gcblit->dstrect.top;
- gcmostartde->rect.right = gcblit->dstrect.right;
- gcmostartde->rect.bottom = gcblit->dstrect.bottom;
-
- GCDBG(GCZONE_BLIT, "dstrect = (%d,%d)-(%d,%d)\n",
- gcmostartde->rect.left, gcmostartde->rect.top,
- gcmostartde->rect.right, gcmostartde->rect.bottom);
-
- /* Reset the finalizer. */
- batch->batchend = do_end;
-
- gc_debug_blt(gcblit->srccount,
- abs(gcblit->dstrect.right - gcblit->dstrect.left),
- abs(gcblit->dstrect.bottom - gcblit->dstrect.top));
-
-exit:
- GCEXITARG(GCZONE_BLIT, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror do_blit(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo)
-{
- enum bverror bverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
-
- struct gcmosrc0 *gcmosrc0;
- struct gcmosrc *gcmosrc;
- struct gcblit *gcblit;
-
- unsigned int index;
- struct bvbuffmap *dstmap = NULL;
- struct bvbuffmap *srcmap = NULL;
-
- struct surfaceinfo *dstinfo;
- int dstshiftX, dstshiftY;
- int dstpixalign, dstbyteshift;
- int dstoffsetX, dstoffsetY;
-
- int srcshiftX, srcshiftY, srctopedge;
- struct gcrect srcclipped;
- int srcsurfwidth, srcsurfheight;
- unsigned int physwidth, physheight;
- int orthogonal;
- int multisrc;
-
- GCENTER(GCZONE_BLIT);
-
- /* 3-plane source not supported. */
- if ((srcinfo->format.type == BVFMT_YUV) &&
- (srcinfo->format.cs.yuv.planecount == 3)) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1GEOM_FORMAT
- : BVERR_SRC2GEOM_FORMAT,
- "unsupported source%d format.",
- srcinfo->index + 1);
- goto exit;
- }
-
- /* Get a shortcut to the destination surface. */
- dstinfo = &batch->dstinfo;
-
- /* Parse destination parameters. */
- bverror = parse_destination(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Setup rotation. */
- process_dest_rotation(bvbltparams, batch);
-
-
- /***********************************************************************
- * Determine source surface alignment offset.
- */
-
- /* Determine whether the source and the destination are orthogonal
- * to each other. */
- orthogonal = (srcinfo->angle % 2) != (dstinfo->angle % 2);
-
- /* Compute clipped source rectangle. */
- srcclipped.left = srcinfo->rect.left + batch->clipdelta.left;
- srcclipped.top = srcinfo->rect.top + batch->clipdelta.top;
- srcclipped.right = srcinfo->rect.right + batch->clipdelta.right;
- srcclipped.bottom = srcinfo->rect.bottom + batch->clipdelta.bottom;
- GCPRINT_RECT(GCZONE_SURF, "clipped source", &srcclipped);
-
- /* Validate the source rectangle. */
- if (!valid_rect(srcinfo->geom, &srcclipped)) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1RECT
- : BVERR_SRC2RECT,
- "invalid source rectangle.");
- goto exit;
- }
-
- /* Compute the source surface shift. */
- switch (srcinfo->angle) {
- case ROT_ANGLE_0:
- srctopedge = srcclipped.top;
- srcshiftX = srcclipped.left - batch->dstadjusted.left;
- srcshiftY = srctopedge - batch->dstadjusted.top;
- break;
-
- case ROT_ANGLE_90:
- srctopedge = srcinfo->geom->width - srcclipped.left;
- srcshiftX = srcclipped.top - batch->dstadjusted.top;
- srcshiftY = srctopedge
- - (batch->dstwidth - batch->dstadjusted.left);
- srctopedge += 1;
- break;
-
- case ROT_ANGLE_180:
- srctopedge = srcinfo->geom->height - srcclipped.top;
- srcshiftX = (srcinfo->geom->width - srcclipped.left)
- - (batch->dstwidth - batch->dstadjusted.left);
- srcshiftY = srctopedge
- - (batch->dstheight - batch->dstadjusted.top);
- srctopedge += 1;
- break;
-
- case ROT_ANGLE_270:
- srctopedge = srcclipped.left;
- srcshiftX = (srcinfo->geom->height - srcclipped.top)
- - (batch->dstheight - batch->dstadjusted.top);
- srcshiftY = srctopedge - batch->dstadjusted.left;
- break;
-
- default:
- srctopedge = 0;
- srcshiftX = 0;
- srcshiftY = 0;
- }
-
- /* We cannot be in the middle of a sample, currently only YUV formats
- * can have subsamples. Adjust vertical position as necessary.
- * Horizontal position will be adjusted based on the byte offset and
- * base address alignment requirement. This assumes that if we are
- * aligned on the base address, then we are also aligned at the
- * beginning of a sample. */
- if (srcinfo->format.type == BVFMT_YUV) {
- int mody = (srctopedge + srcshiftY)
- % srcinfo->format.cs.yuv.ysample;
-
- if (mody < 0)
- mody = srcinfo->format.cs.yuv.ysample + mody;
-
- srcshiftY -= mody;
- srcinfo->ypixalign = -mody;
- } else {
- srcinfo->ypixalign = 0;
- }
-
- /* Compute the source surface offset in bytes. */
- srcinfo->bytealign = srcshiftY * (int) srcinfo->geom->virtstride
- + srcshiftX * (int) srcinfo->format.bitspp / 8;
-
- /* Compute the source offset in pixels needed to compensate
- * for the surface base address misalignment if any. */
- srcinfo->xpixalign = get_pixel_offset(srcinfo, srcinfo->bytealign);
-
- GCDBG(GCZONE_SURF, "source surface %d:\n", srcinfo->index + 1);
- GCDBG(GCZONE_SURF, " surface offset (pixels) = %d,%d\n",
- srcshiftX, srcshiftY);
- GCDBG(GCZONE_SURF, " surface offset (bytes) = 0x%08X\n",
- srcinfo->bytealign);
- GCDBG(GCZONE_SURF, " srcpixalign = %d,%d\n",
- srcinfo->xpixalign, srcinfo->ypixalign);
-
- /* Apply the source alignment. */
- srcinfo->bytealign += srcinfo->xpixalign
- * (int) srcinfo->format.bitspp / 8;
- srcshiftX += srcinfo->xpixalign;
-
- /* NOTE: at this point the source is ready to be presented,
- * srcinfo->xpixalign and srcinfo->ypixalign represent additional
- * adjustments for the DESTINATION. */
-
- GCDBG(GCZONE_SURF, " adjusted surface offset (pixels) = %d,%d\n",
- srcshiftX, srcshiftY);
- GCDBG(GCZONE_SURF, " adjusted surface offset (bytes) = 0x%08X\n",
- srcinfo->bytealign);
-
- /* Compute U/V plane offsets. */
- if ((srcinfo->format.type == BVFMT_YUV) &&
- (srcinfo->format.cs.yuv.planecount > 1))
- set_computeyuv(srcinfo, srcshiftX, srcshiftY);
-
- /* Set precomputed destination adjustments based on the destination
- * base address misalignment only. */
- dstshiftX = dstinfo->xpixalign;
- dstshiftY = dstinfo->ypixalign;
-
- /* Apply source adjustemnts. */
- if (srcinfo->angle == dstinfo->angle) {
- dstshiftX += srcinfo->xpixalign;
- dstshiftY += srcinfo->ypixalign;
- } else if (((srcinfo->angle + 3) % 4) == dstinfo->angle) {
- dstshiftY += srcinfo->xpixalign;
- } else if (((srcinfo->angle + 1) % 4) == dstinfo->angle) {
- dstshiftX += srcinfo->ypixalign;
- }
-
- /* Compute the destination surface offset in bytes. */
- dstbyteshift = dstshiftY * (int) dstinfo->geom->virtstride
- + dstshiftX * (int) dstinfo->format.bitspp / 8;
-
- /* Compute the destination offset in pixels needed to compensate
- * for the surface base address misalignment if any. If dstpixalign
- * comes out anything other than zero, multisource blit cannot be
- * performed. */
- dstpixalign = get_pixel_offset(dstinfo, dstbyteshift);
-
- GCDBG(GCZONE_SURF, "destination surface:\n");
- GCDBG(GCZONE_SURF, " surface offset (pixels) = %d,%d\n",
- dstshiftX, dstshiftY);
- GCDBG(GCZONE_SURF, " surface offset (bytes) = 0x%08X\n",
- dstbyteshift);
- GCDBG(GCZONE_SURF, " realignment = %d\n",
- dstpixalign);
-
- if ((dstpixalign != 0) ||
- ((srcinfo->xpixalign != 0) && (srcinfo->angle == dstinfo->angle))) {
- /* Adjust the destination to match the source geometry. */
- switch (srcinfo->angle) {
- case ROT_ANGLE_0:
- /* Adjust coordinates. */
- srcclipped.left -= srcshiftX;
- srcclipped.top -= srcshiftY;
-
- /* Determine source size. */
- srcsurfwidth = srcinfo->geom->width
- - srcinfo->xpixalign;
- srcsurfheight = srcinfo->geom->height;
- break;
-
- case ROT_ANGLE_90:
- /* Adjust top coordinate. */
- srcclipped.top -= srcshiftX;
-
- /* Determine source size. */
- srcsurfwidth = srcinfo->geom->height
- - srcinfo->xpixalign;
- srcsurfheight = srcinfo->geom->width;
- break;
-
- case ROT_ANGLE_180:
- /* Determine source size. */
- srcsurfwidth = srcinfo->geom->width
- - srcinfo->xpixalign;
- srcsurfheight = srcinfo->geom->height;
- break;
-
- case ROT_ANGLE_270:
- /* Adjust coordinates. */
- srcclipped.left -= srcshiftY;
-
- /* Determine source size. */
- srcsurfwidth = srcinfo->geom->height
- - srcinfo->xpixalign;
- srcsurfheight = srcinfo->geom->width;
- break;
-
- default:
- srcsurfwidth = 0;
- srcsurfheight = 0;
- }
-
- GCDBG(GCZONE_SURF, "srcrect origin = %d,%d\n",
- srcclipped.left, srcclipped.top);
- GCDBG(GCZONE_SURF, "source physical size = %dx%d\n",
- srcsurfwidth, srcsurfheight);
-
- /* Overwrite destination byte offset. */
- dstbyteshift = dstinfo->bytealign;
-
- /* No adjustment necessary for single-source. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- /* Set the physical destination size. */
- physwidth = dstinfo->physwidth;
- physheight = dstinfo->physheight;
-
- /* Disable multi source for the cases where the destination
- * and the source address alignments do not match. */
- multisrc = 0;
- GCDBG(GCZONE_SURF, "multi-source disabled.\n");
- } else {
- /* Source origin is not used in multi-source setup. */
- srcclipped.left = 0;
- srcclipped.top = 0;
-
- /* Adjust the destination to match the source geometry. */
- switch (srcinfo->angle) {
- case ROT_ANGLE_0:
- /* Adjust the destination horizontally. */
- dstoffsetX = srcinfo->xpixalign;
- dstoffsetY = srcinfo->ypixalign;
-
- /* Apply the source alignment. */
- if ((dstinfo->angle % 2) == 0) {
- physwidth = dstinfo->physwidth
- - srcinfo->xpixalign;
- physheight = dstinfo->physheight
- - srcinfo->ypixalign;
- } else {
- physwidth = dstinfo->physwidth
- - srcinfo->ypixalign;
- physheight = dstinfo->physheight
- - srcinfo->xpixalign;
- }
- break;
-
- case ROT_ANGLE_90:
- /* Adjust the destination vertically. */
- dstoffsetX = srcinfo->ypixalign;
- dstoffsetY = srcinfo->xpixalign;
-
- /* Apply the source alignment. */
- if ((dstinfo->angle % 2) == 0) {
- physwidth = dstinfo->physwidth
- - srcinfo->ypixalign;
- physheight = dstinfo->physheight
- - srcinfo->xpixalign;
- } else {
- physwidth = dstinfo->physwidth
- - srcinfo->xpixalign;
- physheight = dstinfo->physheight
- - srcinfo->ypixalign;
- }
- break;
-
- case ROT_ANGLE_180:
- /* No adjustment necessary. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- /* Apply the source alignment. */
- if ((dstinfo->angle % 2) == 0) {
- physwidth = dstinfo->physwidth
- - srcinfo->xpixalign;
- physheight = dstinfo->physheight
- - srcinfo->ypixalign;
- } else {
- physwidth = dstinfo->physwidth
- - srcinfo->ypixalign;
- physheight = dstinfo->physheight
- - srcinfo->xpixalign;
- }
- break;
-
- case ROT_ANGLE_270:
- /* No adjustment necessary. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- /* Apply the source alignment. */
- if ((dstinfo->angle % 2) == 0) {
- physwidth = dstinfo->physwidth
- - srcinfo->ypixalign;
- physheight = dstinfo->physheight
- - srcinfo->xpixalign;
- } else {
- physwidth = dstinfo->physwidth
- - srcinfo->xpixalign;
- physheight = dstinfo->physheight
- - srcinfo->ypixalign;
- }
- break;
-
- default:
- physwidth = 0;
- physheight = 0;
- dstoffsetX = 0;
- dstoffsetY = 0;
- }
-
- /* Source geometry is now the same as the destination. */
- if (orthogonal) {
- srcsurfwidth = physheight;
- srcsurfheight = physwidth;
- } else {
- srcsurfwidth = physwidth;
- srcsurfheight = physheight;
- }
-
- /* Enable multi-source. */
- multisrc = 1;
- GCDBG(GCZONE_SURF, "multi-source enabled.\n");
- }
-
- /* Misaligned source may cause the destination parameters
- * to change, verify whether this has happened. */
- if ((batch->dstbyteshift != dstbyteshift) ||
- (batch->dstphyswidth != physwidth) ||
- (batch->dstphysheight != physheight) ||
- (batch->dstoffsetX != dstoffsetX) ||
- (batch->dstoffsetY != dstoffsetY)) {
- /* Set new values. */
- batch->dstbyteshift = dstbyteshift;
- batch->dstphyswidth = physwidth;
- batch->dstphysheight = physheight;
- batch->dstoffsetX = dstoffsetX;
- batch->dstoffsetY = dstoffsetY;
-
- /* Now we need to end the current batch and program
- * the hardware with the new destination. */
- batch->batchflags |= BVBATCH_DST;
- }
-
- /* Check if we need to finalize existing batch. */
- if ((batch->batchend != do_blit_end) ||
- (batch->op.blit.srccount == 4) ||
- (batch->op.blit.multisrc == 0) ||
- (multisrc == 0) ||
- ((batch->batchflags & (BVBATCH_DST |
- BVBATCH_CLIPRECT |
- BVBATCH_DESTRECT)) != 0)) {
- /* Finalize existing batch if any. */
- bverror = batch->batchend(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Blit batch. */
- batch->batchend = do_blit_end;
-
- /* Initialize the new batch. */
- gcblit = &batch->op.blit;
- gcblit->blockenable = 0;
- gcblit->srccount = 0;
- gcblit->multisrc = multisrc;
-
- /* Set the destination format. */
- gcblit->format = dstinfo->format.format;
- gcblit->swizzle = dstinfo->format.swizzle;
-
- /* Set the destination coordinates. */
- gcblit->dstrect.left = batch->dstadjusted.left - dstoffsetX;
- gcblit->dstrect.top = batch->dstadjusted.top - dstoffsetY;
- gcblit->dstrect.right = batch->dstadjusted.right - dstoffsetX;
- gcblit->dstrect.bottom = batch->dstadjusted.bottom - dstoffsetY;
-
- /* Map the destination. */
- bverror = do_map(dstinfo->buf.desc, batch, &dstmap);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- /* Set the new destination. */
- bverror = set_dst(bvbltparams, batch, dstmap);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Reset the modified flag. */
- batch->batchflags &= ~(BVBATCH_DST |
- BVBATCH_CLIPRECT |
- BVBATCH_DESTRECT);
- }
-
- /* Map the source. */
- bverror = do_map(srcinfo->buf.desc, batch, &srcmap);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- /***********************************************************************
- ** Configure source.
- */
-
- /* We need to walk in blocks if the source and the destination
- * surfaces are orthogonal to each other. */
- batch->op.blit.blockenable |= orthogonal;
-
- /* Shortcut to the register index. */
- index = batch->op.blit.srccount;
-
- /* Set surface parameters. */
- if (index == 0) {
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmosrc0),
- (void **) &gcmosrc0);
- if (bverror != BVERR_NONE)
- goto exit;
-
- add_fixup(bvbltparams, batch, &gcmosrc0->address,
- srcinfo->bytealign);
-
- gcmosrc0->config_ldst = gcmosrc0_config_ldst;
- gcmosrc0->address = GET_MAP_HANDLE(srcmap);
- gcmosrc0->stride = srcinfo->geom->virtstride;
- gcmosrc0->rotation.raw = 0;
- gcmosrc0->rotation.reg.surf_width = srcsurfwidth;
- gcmosrc0->config.raw = 0;
- gcmosrc0->config.reg.swizzle = srcinfo->format.swizzle;
- gcmosrc0->config.reg.format = srcinfo->format.format;
- gcmosrc0->origin.reg.x = srcclipped.left;
- gcmosrc0->origin.reg.y = srcclipped.top;
- gcmosrc0->size.reg = gcregsrcsize_max;
-
- gcmosrc0->rotation_ldst = gcmosrc0_rotation_ldst;
- gcmosrc0->rotationheight.reg.height = srcsurfheight;
- gcmosrc0->rotationangle.raw = 0;
- gcmosrc0->rotationangle.reg.src = rotencoding[srcinfo->angle];
- gcmosrc0->rotationangle.reg.dst = rotencoding[dstinfo->angle];
- gcmosrc0->rotationangle.reg.src_mirror = srcinfo->mirror;
- gcmosrc0->rotationangle.reg.dst_mirror = GCREG_MIRROR_NONE;
-
- gcmosrc0->rop_ldst = gcmosrc0_rop_ldst;
- gcmosrc0->rop.raw = 0;
- gcmosrc0->rop.reg.type = GCREG_ROP_TYPE_ROP3;
- gcmosrc0->rop.reg.fg = (unsigned char) srcinfo->rop;
-
- gcmosrc0->mult_ldst = gcmosrc0_mult_ldst;
- gcmosrc0->mult.raw = 0;
- gcmosrc0->mult.reg.srcglobalpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_DISABLE;
-
- if (srcinfo->format.premultiplied)
- gcmosrc0->mult.reg.srcpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE;
- else
- gcmosrc0->mult.reg.srcpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE;
-
- if (dstinfo->format.premultiplied) {
- gcmosrc0->mult.reg.dstpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE;
-
- gcmosrc0->mult.reg.dstdemul
- = GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_DISABLE;
- } else {
- gcmosrc0->mult.reg.dstpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE;
-
- gcmosrc0->mult.reg.dstdemul
- = GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_ENABLE;
- }
-
- /* Program blending. */
- bverror = set_blending(bvbltparams, batch, srcinfo);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Program YUV source. */
- if (srcinfo->format.type == BVFMT_YUV) {
- bverror = set_yuvsrc(bvbltparams, batch,
- srcinfo, srcmap);
- if (bverror != BVERR_NONE)
- goto exit;
- }
- } else {
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmosrc),
- (void **) &gcmosrc);
- if (bverror != BVERR_NONE)
- goto exit;
-
- add_fixup(bvbltparams, batch, &gcmosrc->address,
- srcinfo->bytealign);
-
- gcmosrc->address_ldst = gcmosrc_address_ldst[index];
- gcmosrc->address = GET_MAP_HANDLE(srcmap);
- gcmosrc->stride_ldst = gcmosrc_stride_ldst[index];
- gcmosrc->stride = srcinfo->geom->virtstride;
-
- gcmosrc->rotation_ldst = gcmosrc_rotation_ldst[index];
- gcmosrc->rotation.raw = 0;
- gcmosrc->rotation.reg.surf_width = srcsurfwidth;
-
- gcmosrc->config_ldst = gcmosrc_config_ldst[index];
- gcmosrc->config.raw = 0;
- gcmosrc->config.reg.swizzle = srcinfo->format.swizzle;
- gcmosrc->config.reg.format = srcinfo->format.format;
-
- gcmosrc->origin_ldst = gcmosrc_origin_ldst[index];
- gcmosrc->origin.reg.x = srcclipped.left;
- gcmosrc->origin.reg.y = srcclipped.top;
-
- gcmosrc->size_ldst = gcmosrc_size_ldst[index];
- gcmosrc->size.reg = gcregsrcsize_max;
-
- gcmosrc->rotationheight_ldst
- = gcmosrc_rotationheight_ldst[index];
- gcmosrc->rotationheight.reg.height = srcsurfheight;
-
- gcmosrc->rotationangle_ldst
- = gcmosrc_rotationangle_ldst[index];
- gcmosrc->rotationangle.raw = 0;
- gcmosrc->rotationangle.reg.src = rotencoding[srcinfo->angle];
- gcmosrc->rotationangle.reg.dst = rotencoding[dstinfo->angle];
- gcmosrc->rotationangle.reg.src_mirror = srcinfo->mirror;
- gcmosrc->rotationangle.reg.dst_mirror = GCREG_MIRROR_NONE;
-
- gcmosrc->rop_ldst = gcmosrc_rop_ldst[index];
- gcmosrc->rop.raw = 0;
- gcmosrc->rop.reg.type = GCREG_ROP_TYPE_ROP3;
- gcmosrc->rop.reg.fg = (unsigned char) srcinfo->rop;
-
- gcmosrc->mult_ldst = gcmosrc_mult_ldst[index];
- gcmosrc->mult.raw = 0;
- gcmosrc->mult.reg.srcglobalpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_DISABLE;
-
- if (srcinfo->format.premultiplied)
- gcmosrc->mult.reg.srcpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE;
- else
- gcmosrc->mult.reg.srcpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE;
-
- if (dstinfo->format.premultiplied) {
- gcmosrc->mult.reg.dstpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE;
-
- gcmosrc->mult.reg.dstdemul
- = GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_DISABLE;
- } else {
- gcmosrc->mult.reg.dstpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE;
-
- gcmosrc->mult.reg.dstdemul
- = GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_ENABLE;
- }
-
- /* Program blending. */
- bverror = set_blending_index(bvbltparams, batch,
- srcinfo, index);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Program YUV source. */
- if (srcinfo->format.type == BVFMT_YUV) {
- bverror = set_yuvsrc_index(bvbltparams, batch,
- srcinfo, srcmap, index);
- if (bverror != BVERR_NONE)
- goto exit;
- }
- }
-
- batch->op.blit.srccount += 1;
-
-exit:
- GCEXITARG(GCZONE_BLIT, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
diff --git a/bltsville/gcbv/mirror/gcbuffer.c b/bltsville/gcbv/mirror/gcbuffer.c
deleted file mode 100644
index 7c77d4a..0000000
--- a/bltsville/gcbv/mirror/gcbuffer.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_BATCH_ALLOC (1 << 0)
-#define GCZONE_BUFFER_ALLOC (1 << 1)
-#define GCZONE_FIXUP_ALLOC (1 << 2)
-#define GCZONE_FIXUP (1 << 3)
-
-GCDBG_FILTERDEF(buffer, GCZONE_NONE,
- "batchalloc",
- "bufferalloc"
- "fixupalloc",
- "fixup")
-
-
-/*******************************************************************************
-** Miscellaneous defines and macros.
-*/
-
-#define GC_BUFFER_INIT_SIZE \
-( \
- GC_BUFFER_SIZE - max(sizeof(struct gcbuffer), GC_BUFFER_RESERVE) \
-)
-
-#define GC_BUFFER_RESERVE \
-( \
- sizeof(struct gcmopipesel) + \
- sizeof(struct gcmommumaster) + \
- sizeof(struct gcmommuflush) + \
- sizeof(struct gcmosignal) + \
- sizeof(struct gccmdend) \
-)
-
-
-/*******************************************************************************
- * Batch/command buffer management.
- */
-
-enum bverror do_end(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch)
-{
- return BVERR_NONE;
-}
-
-enum bverror allocate_batch(struct bvbltparams *bvbltparams,
- struct gcbatch **gcbatch)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct gcbatch *temp;
- struct gcbuffer *gcbuffer;
-
- GCENTER(GCZONE_BATCH_ALLOC);
-
- /* Lock access to batch management. */
- GCLOCK(&gccontext->batchlock);
-
- if (list_empty(&gccontext->batchvac)) {
- temp = gcalloc(struct gcbatch, sizeof(struct gcbatch));
- if (temp == NULL) {
- BVSETBLTERROR(BVERR_OOM,
- "batch header allocation failed");
- goto exit;
- }
-
- GCDBG(GCZONE_BATCH_ALLOC, "allocated new batch = 0x%08X\n",
- (unsigned int) temp);
- } else {
- struct list_head *head;
- head = gccontext->batchvac.next;
- temp = list_entry(head, struct gcbatch, link);
- list_del(head);
-
- GCDBG(GCZONE_BATCH_ALLOC, "reusing batch = 0x%08X\n",
- (unsigned int) temp);
- }
-
- memset(temp, 0, sizeof(struct gcbatch));
- temp->structsize = sizeof(struct gcbatch);
- temp->batchend = do_end;
- INIT_LIST_HEAD(&temp->buffer);
- INIT_LIST_HEAD(&temp->unmap);
- INIT_LIST_HEAD(&temp->link);
-
- bverror = append_buffer(bvbltparams, temp, &gcbuffer);
- if (bverror != BVERR_NONE) {
- free_batch(temp);
- goto exit;
- }
-
- *gcbatch = temp;
-
- GCDBG(GCZONE_BATCH_ALLOC, "batch allocated = 0x%08X\n",
- (unsigned int) temp);
-
-exit:
- /* Unlock access to batch management. */
- GCUNLOCK(&gccontext->batchlock);
-
- GCEXITARG(GCZONE_BATCH_ALLOC, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-void free_batch(struct gcbatch *gcbatch)
-{
- struct list_head *head;
- struct gccontext *gccontext = get_context();
- struct gcbuffer *gcbuffer;
-
- GCENTERARG(GCZONE_BATCH_ALLOC, "batch = 0x%08X\n",
- (unsigned int) gcbatch);
-
- /* Lock access. */
- GCLOCK(&gccontext->batchlock);
- GCLOCK(&gccontext->bufferlock);
- GCLOCK(&gccontext->fixuplock);
- GCLOCK(&gccontext->maplock);
-
- /* Free implicit unmappings. */
- list_splice_init(&gcbatch->unmap, &gccontext->unmapvac);
-
- /* Free command buffers. */
- while (!list_empty(&gcbatch->buffer)) {
- head = gcbatch->buffer.next;
- gcbuffer = list_entry(head, struct gcbuffer, link);
-
- /* Free fixups. */
- list_splice_init(&gcbuffer->fixup, &gccontext->fixupvac);
-
- /* Free the command buffer. */
- list_move(&gcbuffer->link, &gccontext->buffervac);
- }
-
- /* Free the batch. */
- list_add(&gcbatch->link, &gccontext->batchvac);
-
- /* Unlock access. */
- GCUNLOCK(&gccontext->maplock);
- GCUNLOCK(&gccontext->fixuplock);
- GCUNLOCK(&gccontext->bufferlock);
- GCUNLOCK(&gccontext->batchlock);
-
- GCEXIT(GCZONE_BATCH_ALLOC);
-}
-
-enum bverror append_buffer(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- struct gcbuffer **gcbuffer)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct gcbuffer *temp;
-
- GCENTERARG(GCZONE_BUFFER_ALLOC, "batch = 0x%08X\n",
- (unsigned int) gcbatch);
-
- /* Lock access to buffer management. */
- GCLOCK(&gccontext->bufferlock);
-
- if (list_empty(&gccontext->buffervac)) {
- temp = gcalloc(struct gcbuffer, GC_BUFFER_SIZE);
- if (temp == NULL) {
- BVSETBLTERROR(BVERR_OOM,
- "command buffer allocation failed");
- goto exit;
- }
-
- list_add_tail(&temp->link, &gcbatch->buffer);
-
- GCDBG(GCZONE_BUFFER_ALLOC, "allocated new buffer = 0x%08X\n",
- (unsigned int) temp);
- } else {
- struct list_head *head;
- head = gccontext->buffervac.next;
- temp = list_entry(head, struct gcbuffer, link);
-
- list_move_tail(&temp->link, &gcbatch->buffer);
-
- GCDBG(GCZONE_BUFFER_ALLOC, "reusing buffer = 0x%08X\n",
- (unsigned int) temp);
- }
-
- INIT_LIST_HEAD(&temp->fixup);
- temp->pixelcount = 0;
- temp->head = temp->tail = (unsigned int *) (temp + 1);
- temp->available = GC_BUFFER_INIT_SIZE;
-
- GCDBG(GCZONE_BUFFER_ALLOC, "new buffer appended = 0x%08X\n",
- (unsigned int) temp);
-
- *gcbuffer = temp;
- bverror = BVERR_NONE;
-
-exit:
- /* Unlock access to buffer management. */
- GCUNLOCK(&gccontext->bufferlock);
-
- GCEXITARG(GCZONE_BUFFER_ALLOC, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-static enum bverror allocate_fixup(struct bvbltparams *bvbltparams,
- struct gcbuffer *gcbuffer,
- struct gcfixup **gcfixup)
-{
- enum bverror bverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
- struct gcfixup *temp;
-
- if (list_empty(&gccontext->fixupvac)) {
- temp = gcalloc(struct gcfixup, sizeof(struct gcfixup));
- if (temp == NULL) {
- BVSETBLTERROR(BVERR_OOM, "fixup allocation failed");
- goto exit;
- }
-
- list_add_tail(&temp->link, &gcbuffer->fixup);
-
- GCDBG(GCZONE_FIXUP_ALLOC,
- "new fixup struct allocated = 0x%08X\n",
- (unsigned int) temp);
- } else {
- struct list_head *head;
- head = gccontext->fixupvac.next;
- temp = list_entry(head, struct gcfixup, link);
-
- list_move_tail(&temp->link, &gcbuffer->fixup);
-
- GCDBG(GCZONE_FIXUP_ALLOC, "fixup struct reused = 0x%08X\n",
- (unsigned int) temp);
- }
-
- temp->count = 0;
- *gcfixup = temp;
-
-exit:
- return bverror;
-}
-
-enum bverror add_fixup(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- unsigned int *ptr,
- unsigned int surfoffset)
-{
- enum bverror bverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
- struct list_head *head;
- struct gcbuffer *buffer;
- struct gcfixup *gcfixup;
-
- GCENTERARG(GCZONE_FIXUP, "batch = 0x%08X, fixup ptr = 0x%08X\n",
- (unsigned int) gcbatch, (unsigned int) ptr);
-
- /* Lock access to fixup management. */
- GCLOCK(&gccontext->fixuplock);
-
- /* Get the current command buffer. */
- if (list_empty(&gcbatch->buffer)) {
- GCERR("no command buffers are allocated");
- goto exit;
- }
- head = gcbatch->buffer.prev;
- buffer = list_entry(head, struct gcbuffer, link);
-
- /* No fixups? Allocate one. */
- if (list_empty(&buffer->fixup)) {
- GCDBG(GCZONE_FIXUP_ALLOC, "no fixups allocated.\n");
- bverror = allocate_fixup(bvbltparams, buffer, &gcfixup);
- if (bverror != BVERR_NONE)
- goto exit;
- } else {
- /* Get the current fixup. */
- head = buffer->fixup.prev;
- gcfixup = list_entry(head, struct gcfixup, link);
-
- /* No more room? */
- if (gcfixup->count == GC_FIXUP_MAX) {
- GCDBG(GCZONE_FIXUP_ALLOC,
- "out of room, allocating new.\n");
- bverror = allocate_fixup(bvbltparams, buffer, &gcfixup);
- if (bverror != BVERR_NONE)
- goto exit;
- }
- }
-
- GCDBG(GCZONE_FIXUP, "buffer = 0x%08X, fixup struct = 0x%08X\n",
- (unsigned int) buffer, (unsigned int) gcfixup);
-
- gcfixup->fixup[gcfixup->count].dataoffset = ptr - buffer->head;
- gcfixup->fixup[gcfixup->count].surfoffset = surfoffset;
- gcfixup->count += 1;
-
- GCDBG(GCZONE_FIXUP, "fixup offset = 0x%08X\n", ptr - buffer->head);
- GCDBG(GCZONE_FIXUP, "surface offset = 0x%08X\n", surfoffset);
-
-exit:
- /* Unlock access to fixup management. */
- GCUNLOCK(&gccontext->fixuplock);
-
- GCEXITARG(GCZONE_FIXUP, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror claim_buffer(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- unsigned int size,
- void **buffer)
-{
- enum bverror bverror;
- struct list_head *head;
- struct gcbuffer *gcbuffer;
-
- GCENTERARG(GCZONE_BUFFER_ALLOC, "batch = 0x%08X, size = %d\n",
- (unsigned int) gcbatch, size);
-
- if (size > GC_BUFFER_INIT_SIZE) {
- GCERR("requested size is too big.\n");
- BVSETBLTERROR(BVERR_OOM,
- "command buffer allocation failed");
- goto exit;
- }
-
- /* Get the current command buffer. */
- head = gcbatch->buffer.prev;
- gcbuffer = list_entry(head, struct gcbuffer, link);
-
- GCDBG(GCZONE_BUFFER_ALLOC, "buffer = 0x%08X, available = %d\n",
- (unsigned int) gcbuffer, gcbuffer->available);
-
- if (gcbuffer->available < size) {
- bverror = append_buffer(bvbltparams, gcbatch, &gcbuffer);
- if (bverror != BVERR_NONE)
- goto exit;
- }
-
- *buffer = gcbuffer->tail;
- gcbuffer->tail = (unsigned int *)
- ((unsigned char *) gcbuffer->tail + size);
- gcbuffer->available -= size;
- gcbatch->size += size;
- bverror = BVERR_NONE;
-
-exit:
- GCEXITARG(GCZONE_BUFFER_ALLOC, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
diff --git a/bltsville/gcbv/mirror/gcbv.c b/bltsville/gcbv/mirror/gcbv.c
deleted file mode 100644
index 86d656e..0000000
--- a/bltsville/gcbv/mirror/gcbv.c
+++ /dev/null
@@ -1,2008 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_MAPPING (1 << 0)
-#define GCZONE_BUFFER (1 << 1)
-#define GCZONE_DEST (1 << 2)
-#define GCZONE_SRC (1 << 3)
-#define GCZONE_MASK (1 << 4)
-#define GCZONE_BATCH (1 << 5)
-#define GCZONE_BLIT (1 << 6)
-#define GCZONE_CACHE (1 << 7)
-#define GCZONE_CALLBACK (1 << 8)
-#define GCZONE_TEMP (1 << 9)
-#define GCZONE_BLEND (1 << 10)
-
-GCDBG_FILTERDEF(bv, GCZONE_NONE,
- "mapping",
- "buffer",
- "dest",
- "source",
- "mask",
- "batch",
- "blit",
- "cache",
- "callback",
- "tempbuffer",
- "blending")
-
-
-/*******************************************************************************
-** Global driver data access.
-*/
-
-struct gccontext *get_context(void)
-{
- static struct gccontext gccontext;
- return &gccontext;
-}
-
-
-/*******************************************************************************
- * Debugging.
- */
-
-#if GCDEBUG_ENABLE
-#define GCDUMPBATCH(batch) \
- dumpbatch(batch)
-
-#define GCVERIFYBATCH(changeflags, prevrect, currrect) \
- verify_batch(changeflags, prevrect, currrect)
-
-static void dumpbatch(struct gcbatch *gcbatch)
-{
- struct list_head *gcbufferhead;
- struct gcbuffer *gcbuffer;
- struct list_head *gcfixuphead;
- struct gcfixup *gcfixup;
- unsigned int i, size;
-
- if ((GCDBGFILTER.zone & (GCZONE_BUFFER)) == 0)
- return;
-
- GCDBG(GCZONE_BUFFER, "BATCH DUMP (0x%08X)\n",
- (unsigned int) gcbatch);
-
- list_for_each(gcbufferhead, &gcbatch->buffer) {
- gcbuffer = list_entry(gcbufferhead, struct gcbuffer, link);
-
- list_for_each(gcfixuphead, &gcbuffer->fixup) {
- gcfixup = list_entry(gcfixuphead, struct gcfixup, link);
-
- GCDBG(GCZONE_BUFFER,
- " Fixup table @ 0x%08X, count = %d:\n",
- (unsigned int) gcfixup, gcfixup->count);
-
- for (i = 0; i < gcfixup->count; i += 1) {
- GCDBG(GCZONE_BUFFER, " [%02d]"
- " buffer offset = 0x%08X,"
- " surface offset = 0x%08X\n",
- i,
- gcfixup->fixup[i].dataoffset * 4,
- gcfixup->fixup[i].surfoffset);
- }
- }
-
- size = (unsigned char *) gcbuffer->tail
- - (unsigned char *) gcbuffer->head;
- GCDUMPBUFFER(GCZONE_BUFFER, gcbuffer->head, 0, size);
- }
-}
-
-static void verify_batch(unsigned int changeflags,
- struct bvrect *prevrect,
- struct bvrect *currrect)
-{
- if ((changeflags & 1) == 0) {
- /* Origin did not change. */
- if ((prevrect->left != currrect->left) ||
- (prevrect->top != currrect->top)) {
- GCERR("origin changed\n");
- GCERR(" previous = %d,%d\n",
- prevrect->left, prevrect->top);
- GCERR(" current = %d,%d\n",
- currrect->left, currrect->top);
- }
- }
-
- if ((changeflags & 2) == 0) {
- /* Size did not change. */
- if ((prevrect->width != currrect->width) ||
- (prevrect->height != currrect->height)) {
- GCERR("size changed\n");
- GCERR(" previous = %dx%d\n",
- prevrect->width, prevrect->height);
- GCERR(" current = %dx%d\n",
- currrect->width, currrect->height);
- }
- }
-
- prevrect->left = currrect->left;
- prevrect->top = currrect->top;
- prevrect->width = currrect->width;
- prevrect->height = currrect->height;
-}
-#else
-#define GCDUMPBATCH(...)
-#define GCVERIFYBATCH(...)
-#endif
-
-
-/*******************************************************************************
- * Error handling.
- */
-
-#define BVSETBLTSURFERROR(errorid, errordesc) \
-do { \
- struct gccontext *tmpcontext = get_context(); \
- snprintf(tmpcontext->bverrorstr, sizeof(tmpcontext->bverrorstr), \
- g_surferr[errorid].message, errordesc.id); \
- GCDUMPSTRING("%s(%d): [ERROR] %s\n", __func__, __LINE__, \
- tmpcontext->bverrorstr); \
- bverror = errordesc.base + g_surferr[errorid].offset; \
- bvbltparams->errdesc = tmpcontext->bverrorstr; \
-} while (0)
-
-#define GCBVERR_DESC 0
-#define GCBVERR_DESC_VERS 1
-#define GCBVERR_DESC_VIRTADDR 2
-#define GCBVERR_TILE 3
-#define GCBVERR_TILE_VERS 4
-#define GCBVERR_TILE_VIRTADDR 5
-#define GCBVERR_GEOM 6
-#define GCBVERR_GEOM_VERS 7
-#define GCBVERR_GEOM_FORMAT 8
-
-struct bvsurferrorid {
- char *id;
- enum bverror base;
-};
-
-struct bvsurferror {
- unsigned int offset;
- char *message;
-};
-
-static struct bvsurferror g_surferr[] = {
- /* GCBVERR_DESC */
- { 0, "%s desc structure is not set" },
-
- /* GCBVERR_DESC_VERS */
- { 100, "%s desc structure has invalid size" },
-
- /* GCBVERR_DESC_VIRTADDR */
- { 200, "%s desc virtual pointer is not set" },
-
- /* GCBVERR_TILE: FIXME/TODO define error code */
- { 0, "%s tileparams structure is not set" },
-
- /* GCBVERR_TILE_VERS */
- { 3000, "%s tileparams structure has invalid size" },
-
- /* GCBVERR_TILE_VIRTADDR: FIXME/TODO define error code */
- { 200, "%s tileparams virtual pointer is not set" },
-
- /* GCBVERR_GEOM */
- { 1000, "%s geom structure is not set" },
-
- /* GCBVERR_GEOM_VERS */
- { 1100, "%s geom structure has invalid size" },
-
- /* GCBVERR_GEOM_FORMAT */
- { 1200, "%s invalid format specified" },
-};
-
-static struct bvsurferrorid g_destsurferr = { "dst", BVERR_DSTDESC };
-static struct bvsurferrorid g_src1surferr = { "src1", BVERR_SRC1DESC };
-static struct bvsurferrorid g_src2surferr = { "src2", BVERR_SRC2DESC };
-static struct bvsurferrorid g_masksurferr = { "mask", BVERR_MASKDESC };
-
-
-/*******************************************************************************
- * Callback info management.
- */
-
-/* BLTsville callback function. */
-struct gccallbackbltsville {
- /* Function pointer. */
- void (*fn) (struct bvcallbackerror *err, unsigned long callbackdata);
-
- /* Callback data. */
- unsigned long data;
-};
-
-/* Information for freeing a surface. */
-struct gccallbackfreesurface {
- /* Pointer to the buffer descriptor. */
- struct bvbuffdesc *desc;
-
- /* Pointer to the buffer. */
- void *ptr;
-};
-
-/* Callback information. */
-struct gccallbackinfo {
- union {
- /* BLTsville callback function. */
- struct gccallbackbltsville callback;
-
- /* Information for freeing a surface. */
- struct gccallbackfreesurface freesurface;
- } info;
-
- /* Previous/next callback information. */
- struct list_head link;
-};
-
-static enum bverror get_callbackinfo(struct gccallbackinfo **gccallbackinfo)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct gccallbackinfo *temp;
-
- /* Lock access to callback info lists. */
- GCLOCK(&gccontext->callbacklock);
-
- if (list_empty(&gccontext->callbackvac)) {
- temp = gcalloc(struct gccallbackinfo,
- sizeof(struct gccallbackinfo));
- if (temp == NULL) {
- bverror = BVERR_OOM;
- goto exit;
- }
- list_add(&temp->link, &gccontext->callbacklist);
- } else {
- struct list_head *head;
- head = gccontext->callbackvac.next;
- temp = list_entry(head, struct gccallbackinfo, link);
- list_move(head, &gccontext->callbacklist);
- }
-
- *gccallbackinfo = temp;
- bverror = BVERR_NONE;
-
-exit:
- /* Unlock access to callback info lists. */
- GCUNLOCK(&gccontext->callbacklock);
-
- return bverror;
-}
-
-static void free_callback(struct gccallbackinfo *gccallbackinfo)
-{
- struct gccontext *gccontext = get_context();
-
- /* Lock access to callback info lists. */
- GCLOCK(&gccontext->callbacklock);
-
- list_move(&gccallbackinfo->link, &gccontext->callbackvac);
-
- /* Unlock access to callback info lists. */
- GCUNLOCK(&gccontext->callbacklock);
-}
-
-void callbackbltsville(void *callbackinfo)
-{
- struct gccallbackinfo *gccallbackinfo;
-
- GCENTER(GCZONE_CALLBACK);
-
- gccallbackinfo = (struct gccallbackinfo *) callbackinfo;
- GCDBG(GCZONE_CALLBACK, "bltsville_callback = 0x%08X\n",
- (unsigned int) gccallbackinfo->info.callback.fn);
- GCDBG(GCZONE_CALLBACK, "bltsville_param = 0x%08X\n",
- (unsigned int) gccallbackinfo->info.callback.data);
-
- gccallbackinfo->info.callback.fn(NULL,
- gccallbackinfo->info.callback.data);
- free_callback(gccallbackinfo);
-
- GCEXIT(GCZONE_CALLBACK);
-}
-
-void callbackfreesurface(void *callbackinfo)
-{
- struct gccallbackinfo *gccallbackinfo;
-
- GCENTER(GCZONE_CALLBACK);
-
- gccallbackinfo = (struct gccallbackinfo *) callbackinfo;
- GCDBG(GCZONE_CALLBACK, "freeing descriptir @ 0x%08X\n",
- (unsigned int) gccallbackinfo->info.freesurface.desc);
- GCDBG(GCZONE_CALLBACK, "freeing memory @ 0x%08X\n",
- (unsigned int) gccallbackinfo->info.freesurface.ptr);
-
- free_surface(gccallbackinfo->info.freesurface.desc,
- gccallbackinfo->info.freesurface.ptr);
- free_callback(gccallbackinfo);
-
- GCEXIT(GCZONE_CALLBACK);
-}
-
-
-/*******************************************************************************
- * Temporary buffer management.
- */
-
-enum bverror allocate_temp(struct bvbltparams *bvbltparams,
- unsigned int size)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
-
- GCENTER(GCZONE_TEMP);
-
- /* Existing buffer too small? */
- if ((gccontext->tmpbuffdesc != NULL) &&
- (gccontext->tmpbuffdesc->length < size)) {
- GCDBG(GCZONE_TEMP, "freeing current buffer.\n");
- bverror = free_temp(true);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
- }
-
- /* Allocate new buffer if necessary. */
- if ((size > 0) && (gccontext->tmpbuffdesc == NULL)) {
- /* Allocate temporary surface. */
- bverror = allocate_surface(&gccontext->tmpbuffdesc,
- &gccontext->tmpbuff,
- size);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- GCDBG(GCZONE_TEMP, "buffdesc @ 0x%08X\n",
- gccontext->tmpbuffdesc);
- GCDBG(GCZONE_TEMP, "allocated @ 0x%08X\n",
- gccontext->tmpbuff);
- GCDBG(GCZONE_TEMP, "size = %d\n",
- size);
-
- /* Map the buffer explicitly. */
- bverror = bv_map(gccontext->tmpbuffdesc);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
- }
-
- /* Success. */
- bverror = BVERR_NONE;
-
-exit:
- GCEXIT(GCZONE_TEMP);
- return bverror;
-}
-
-enum bverror free_temp(bool schedule)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct gccallbackinfo *gccallbackinfo;
- struct gcicallbackarm gcicallbackarm;
-
- /* Is the buffer allocated? */
- if (gccontext->tmpbuffdesc == NULL) {
- bverror = BVERR_NONE;
- goto exit;
- }
-
- /* Unmap the buffer. */
- bverror = bv_unmap(gccontext->tmpbuffdesc);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Cannot be mapped. */
- if (gccontext->tmpbuffdesc->map != NULL) {
- BVSETERROR(BVERR_OOM, "temporary buffer is still mapped");
- goto exit;
- }
-
- /* Free the buffer. */
- if (schedule) {
- bverror = get_callbackinfo(&gccallbackinfo);
- if (bverror != BVERR_NONE) {
- BVSETERROR(BVERR_OOM,
- "callback allocation failed");
- goto exit;
- }
-
- gccallbackinfo->info.freesurface.desc = gccontext->tmpbuffdesc;
- gccallbackinfo->info.freesurface.ptr = gccontext->tmpbuff;
- gcicallbackarm.callback = callbackfreesurface;
- gcicallbackarm.callbackparam = gccallbackinfo;
-
- /* Schedule to free the buffer. */
- gc_callback_wrapper(&gcicallbackarm);
-
- /* Error? */
- if (gcicallbackarm.gcerror != GCERR_NONE) {
- BVSETERROR(BVERR_OOM, "unable to schedule callback");
- goto exit;
- }
- } else {
- /* Free the buffer immediately. */
- free_surface(gccontext->tmpbuffdesc, gccontext->tmpbuff);
- }
-
- /* Reset the buffer descriptor. */
- gccontext->tmpbuffdesc = NULL;
- gccontext->tmpbuff = NULL;
-
-exit:
- return bverror;
-}
-
-
-/*******************************************************************************
- * Program the destination.
- */
-
-enum bverror set_dst(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct bvbuffmap *dstmap)
-{
- enum bverror bverror = BVERR_NONE;
- struct gcmodst *gcmodst;
-
- GCENTER(GCZONE_DEST);
-
- /* Did destination surface change? */
- if ((batch->batchflags & BVBATCH_DST) != 0) {
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmodst),
- (void **) &gcmodst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Add the address fixup. */
- add_fixup(bvbltparams, batch, &gcmodst->address,
- batch->dstbyteshift);
-
- /* Set surface parameters. */
- gcmodst->config_ldst = gcmodst_config_ldst;
- gcmodst->address = GET_MAP_HANDLE(dstmap);
- gcmodst->stride = bvbltparams->dstgeom->virtstride;
-
- /* Set surface width and height. */
- gcmodst->rotation.raw = 0;
- gcmodst->rotation.reg.surf_width = batch->dstphyswidth;
- gcmodst->rotationheight_ldst = gcmodst_rotationheight_ldst;
- gcmodst->rotationheight.raw = 0;
- gcmodst->rotationheight.reg.height = batch->dstphysheight;
-
- /* Disable hardware clipping. */
- gcmodst->clip_ldst = gcmodst_clip_ldst;
- gcmodst->cliplt.raw = 0;
- gcmodst->cliprb.raw = 0;
- gcmodst->cliprb.reg.right = GC_CLIP_RESET_RIGHT;
- gcmodst->cliprb.reg.bottom = GC_CLIP_RESET_BOTTOM;
- }
-
-exit:
- GCEXITARG(GCZONE_DEST, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-/*******************************************************************************
- * Program blending.
- */
-
-enum bverror set_blending(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo)
-{
- enum bverror bverror = BVERR_NONE;
- struct gcmoalphaoff *gcmoalphaoff;
- struct gcmoalpha *gcmoalpha;
- struct gcmoglobal *gcmoglobal;
- struct gcalpha *gca;
-
- GCENTER(GCZONE_BLEND);
-
- gca = srcinfo->gca;
- if (gca == NULL) {
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoalphaoff),
- (void **) &gcmoalphaoff);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmoalphaoff->control_ldst = gcmoalphaoff_control_ldst[0];
- gcmoalphaoff->control.reg = gcregalpha_off;
-
- GCDBG(GCZONE_BLEND, "blending disabled.\n");
- } else {
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoalpha),
- (void **) &gcmoalpha);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmoalpha->config_ldst = gcmoalpha_config_ldst;
- gcmoalpha->control.reg = gcregalpha_on;
-
- gcmoalpha->mode.raw = 0;
- gcmoalpha->mode.reg.src_global_alpha_mode
- = gca->src_global_alpha_mode;
- gcmoalpha->mode.reg.dst_global_alpha_mode
- = gca->dst_global_alpha_mode;
-
- gcmoalpha->mode.reg.src_blend
- = gca->srcconfig->factor_mode;
- gcmoalpha->mode.reg.src_color_reverse
- = gca->srcconfig->color_reverse;
-
- gcmoalpha->mode.reg.dst_blend
- = gca->dstconfig->factor_mode;
- gcmoalpha->mode.reg.dst_color_reverse
- = gca->dstconfig->color_reverse;
-
- GCDBG(GCZONE_BLEND, "dst blend:\n");
- GCDBG(GCZONE_BLEND, " factor = %d\n",
- gcmoalpha->mode.reg.dst_blend);
- GCDBG(GCZONE_BLEND, " inverse = %d\n",
- gcmoalpha->mode.reg.dst_color_reverse);
-
- GCDBG(GCZONE_BLEND, "src blend:\n");
- GCDBG(GCZONE_BLEND, " factor = %d\n",
- gcmoalpha->mode.reg.src_blend);
- GCDBG(GCZONE_BLEND, " inverse = %d\n",
- gcmoalpha->mode.reg.src_color_reverse);
-
- if ((gca->src_global_alpha_mode
- != GCREG_GLOBAL_ALPHA_MODE_NORMAL) ||
- (gca->dst_global_alpha_mode
- != GCREG_GLOBAL_ALPHA_MODE_NORMAL)) {
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoglobal),
- (void **) &gcmoglobal);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmoglobal->color_ldst = gcmoglobal_color_ldst;
- gcmoglobal->srcglobal.raw = gca->src_global_color;
- gcmoglobal->dstglobal.raw = gca->dst_global_color;
- }
- }
-
-exit:
- GCEXITARG(GCZONE_BLEND, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror set_blending_index(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- unsigned int index)
-{
- enum bverror bverror = BVERR_NONE;
- struct gcmoalphaoff *gcmoalphaoff;
- struct gcmoxsrcalpha *gcmoxsrcalpha;
- struct gcmoxsrcglobal *gcmoxsrcglobal;
- struct gcalpha *gca;
-
- GCENTER(GCZONE_BLEND);
-
- gca = srcinfo->gca;
- if (gca == NULL) {
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoalphaoff),
- (void **) &gcmoalphaoff);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmoalphaoff->control_ldst = gcmoalphaoff_control_ldst[index];
- gcmoalphaoff->control.reg = gcregalpha_off;
-
- GCDBG(GCZONE_BLEND, "blending disabled.\n");
- } else {
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoxsrcalpha),
- (void **) &gcmoxsrcalpha);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmoxsrcalpha->control_ldst = gcmoxsrcalpha_control_ldst[index];
- gcmoxsrcalpha->control.reg = gcregalpha_on;
-
- gcmoxsrcalpha->mode_ldst = gcmoxsrcalpha_mode_ldst[index];
- gcmoxsrcalpha->mode.raw = 0;
- gcmoxsrcalpha->mode.reg.src_global_alpha_mode
- = gca->src_global_alpha_mode;
- gcmoxsrcalpha->mode.reg.dst_global_alpha_mode
- = gca->dst_global_alpha_mode;
-
- gcmoxsrcalpha->mode.reg.src_blend
- = gca->srcconfig->factor_mode;
- gcmoxsrcalpha->mode.reg.src_color_reverse
- = gca->srcconfig->color_reverse;
-
- gcmoxsrcalpha->mode.reg.dst_blend
- = gca->dstconfig->factor_mode;
- gcmoxsrcalpha->mode.reg.dst_color_reverse
- = gca->dstconfig->color_reverse;
-
- GCDBG(GCZONE_BLEND, "dst blend:\n");
- GCDBG(GCZONE_BLEND, " factor = %d\n",
- gcmoxsrcalpha->mode.reg.dst_blend);
- GCDBG(GCZONE_BLEND, " inverse = %d\n",
- gcmoxsrcalpha->mode.reg.dst_color_reverse);
-
- GCDBG(GCZONE_BLEND, "src blend:\n");
- GCDBG(GCZONE_BLEND, " factor = %d\n",
- gcmoxsrcalpha->mode.reg.src_blend);
- GCDBG(GCZONE_BLEND, " inverse = %d\n",
- gcmoxsrcalpha->mode.reg.src_color_reverse);
-
- if ((gca->src_global_alpha_mode
- != GCREG_GLOBAL_ALPHA_MODE_NORMAL) ||
- (gca->dst_global_alpha_mode
- != GCREG_GLOBAL_ALPHA_MODE_NORMAL)) {
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoxsrcglobal),
- (void **) &gcmoxsrcglobal);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmoxsrcglobal->srcglobal_ldst
- = gcmoxsrcglobal_srcglobal_ldst[index];
- gcmoxsrcglobal->srcglobal.raw = gca->src_global_color;
-
- gcmoxsrcglobal->dstglobal_ldst
- = gcmoxsrcglobal_dstglobal_ldst[index];
- gcmoxsrcglobal->dstglobal.raw = gca->dst_global_color;
- }
- }
-
-exit:
- GCEXITARG(GCZONE_BLEND, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-/*******************************************************************************
- * Program YUV source.
- */
-
-void set_computeyuv(struct surfaceinfo *srcinfo, int x, int y)
-{
- int pixalign, bytealign;
- unsigned int height1, size1;
- unsigned int height2, size2;
- unsigned int origin;
- int ssX, ssY;
-
- GCENTER(GCZONE_SRC);
-
- /* Compute base address alignment. */
- pixalign = get_pixel_offset(srcinfo, 0);
- bytealign = (pixalign * (int) srcinfo->format.bitspp) / 8;
-
- /* Determine the physical height of the first plane. */
- height1 = ((srcinfo->angle % 2) == 0)
- ? srcinfo->geom->height
- : srcinfo->geom->width;
-
- /* Determine the size of the first plane. */
- size1 = srcinfo->geom->virtstride * height1;
-
- /* Determine the stride of the second plane. */
- srcinfo->stride2 = srcinfo->geom->virtstride
- / srcinfo->format.cs.yuv.xsample;
-
- /* Determine subsample pixel position. */
- ssX = x / srcinfo->format.cs.yuv.xsample;
- ssY = y / srcinfo->format.cs.yuv.ysample;
-
- switch (srcinfo->format.cs.yuv.planecount) {
- case 2:
- /* U and V are interleaved in one plane. */
- ssX *= 2;
- srcinfo->stride2 *= 2;
-
- /* Determnine the origin offset. */
- origin = ssY * srcinfo->stride2 + ssX;
-
- /* Compute the alignment of the second plane. */
- srcinfo->bytealign2 = bytealign + size1 + origin;
-
- GCDBG(GCZONE_SRC, "plane2 offset (bytes) = 0x%08X\n",
- srcinfo->bytealign2);
- GCDBG(GCZONE_SRC, "plane2 stride = %d\n",
- srcinfo->stride2);
- break;
-
- case 3:
- /* Determine the physical height of the U/V planes. */
- height2 = height1 / srcinfo->format.cs.yuv.ysample;
-
- /* Determine the size of the U/V planes. */
- size2 = srcinfo->stride2 * height2;
-
- /* Determnine the origin offset. */
- origin = ssY * srcinfo->stride2 + ssX;
-
- /* Compute the alignment of the U/V planes. */
- srcinfo->bytealign2 = bytealign + size1 + origin;
- srcinfo->bytealign3 = bytealign + size1 + size2 + origin;
-
- /* Determine the stride of the U/V planes. */
- srcinfo->stride3 = srcinfo->stride2;
-
- GCDBG(GCZONE_SRC, "plane2 offset (bytes) = 0x%08X\n",
- srcinfo->bytealign2);
- GCDBG(GCZONE_SRC, "plane2 stride = %d\n",
- srcinfo->stride2);
- GCDBG(GCZONE_SRC, "plane3 offset (bytes) = 0x%08X\n",
- srcinfo->bytealign3);
- GCDBG(GCZONE_SRC, "plane3 stride = %d\n",
- srcinfo->stride3);
- break;
- }
-
- GCEXIT(GCZONE_SRC);
-}
-
-enum bverror set_yuvsrc(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- struct bvbuffmap *srcmap)
-{
- enum bverror bverror = BVERR_NONE;
- struct gcmoyuv1 *gcmoyuv1;
- struct gcmoyuv2 *gcmoyuv2;
- struct gcmoyuv3 *gcmoyuv3;
-
- GCENTER(GCZONE_SRC);
-
- GCDBG(GCZONE_SRC, "plane count %d.\n",
- srcinfo->format.cs.yuv.planecount);
-
- switch (srcinfo->format.cs.yuv.planecount) {
- case 1:
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoyuv1),
- (void **) &gcmoyuv1);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set YUV parameters. */
- gcmoyuv1->pectrl_ldst = gcmoyuv_pectrl_ldst;
- gcmoyuv1->pectrl.raw = 0;
- gcmoyuv1->pectrl.reg.standard
- = srcinfo->format.cs.yuv.std;
- gcmoyuv1->pectrl.reg.swizzle
- = srcinfo->format.swizzle;
- gcmoyuv1->pectrl.reg.convert
- = GCREG_PE_CONTROL_YUVRGB_DISABLED;
- break;
-
- case 2:
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoyuv2),
- (void **) &gcmoyuv2);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set YUV parameters. */
- gcmoyuv2->pectrl_ldst = gcmoyuv_pectrl_ldst;
- gcmoyuv2->pectrl.raw = 0;
- gcmoyuv2->pectrl.reg.standard
- = srcinfo->format.cs.yuv.std;
- gcmoyuv2->pectrl.reg.swizzle
- = srcinfo->format.swizzle;
- gcmoyuv2->pectrl.reg.convert
- = GCREG_PE_CONTROL_YUVRGB_DISABLED;
-
- /* Program U/V plane. */
- add_fixup(bvbltparams, batch, &gcmoyuv2->uplaneaddress,
- srcinfo->bytealign2);
- gcmoyuv2->plane_ldst = gcmoyuv2_plane_ldst;
- gcmoyuv2->uplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoyuv2->uplanestride = srcinfo->stride2;
- break;
-
- case 3:
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoyuv3),
- (void **) &gcmoyuv3);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set YUV parameters. */
- gcmoyuv3->pectrl_ldst = gcmoyuv_pectrl_ldst;
- gcmoyuv3->pectrl.raw = 0;
- gcmoyuv3->pectrl.reg.standard
- = srcinfo->format.cs.yuv.std;
- gcmoyuv3->pectrl.reg.swizzle
- = srcinfo->format.swizzle;
- gcmoyuv3->pectrl.reg.convert
- = GCREG_PE_CONTROL_YUVRGB_DISABLED;
-
- /* Program U/V planes. */
- add_fixup(bvbltparams, batch, &gcmoyuv3->uplaneaddress,
- srcinfo->bytealign2);
- add_fixup(bvbltparams, batch, &gcmoyuv3->vplaneaddress,
- srcinfo->bytealign3);
- gcmoyuv3->plane_ldst = gcmoyuv3_plane_ldst;
- gcmoyuv3->uplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoyuv3->uplanestride = srcinfo->stride2;
- gcmoyuv3->vplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoyuv3->vplanestride = srcinfo->stride3;
- break;
-
- default:
- GCERR("invlaid plane count %d.\n",
- srcinfo->format.cs.yuv.planecount);
- }
-
-exit:
- GCEXITARG(GCZONE_SRC, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror set_yuvsrc_index(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- struct bvbuffmap *srcmap,
- unsigned int index)
-{
- enum bverror bverror = BVERR_NONE;
- struct gcmoxsrcyuv1 *gcmoxsrcyuv1;
- struct gcmoxsrcyuv2 *gcmoxsrcyuv2;
- struct gcmoxsrcyuv3 *gcmoxsrcyuv3;
-
- GCENTER(GCZONE_SRC);
-
- GCDBG(GCZONE_SRC, "plane count %d.\n",
- srcinfo->format.cs.yuv.planecount);
-
- switch (srcinfo->format.cs.yuv.planecount) {
- case 1:
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoxsrcyuv1),
- (void **) &gcmoxsrcyuv1);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set YUV parameters. */
- gcmoxsrcyuv1->pectrl_ldst
- = gcmoxsrcyuv_pectrl_ldst[index];
- gcmoxsrcyuv1->pectrl.raw = 0;
- gcmoxsrcyuv1->pectrl.reg.standard
- = srcinfo->format.cs.yuv.std;
- gcmoxsrcyuv1->pectrl.reg.swizzle
- = srcinfo->format.swizzle;
- gcmoxsrcyuv1->pectrl.reg.convert
- = GCREG_PE_CONTROL_YUVRGB_DISABLED;
- break;
-
- case 2:
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoxsrcyuv2),
- (void **) &gcmoxsrcyuv2);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set YUV parameters. */
- gcmoxsrcyuv2->pectrl_ldst
- = gcmoxsrcyuv_pectrl_ldst[index];
- gcmoxsrcyuv2->pectrl.raw = 0;
- gcmoxsrcyuv2->pectrl.reg.standard
- = srcinfo->format.cs.yuv.std;
- gcmoxsrcyuv2->pectrl.reg.swizzle
- = srcinfo->format.swizzle;
- gcmoxsrcyuv2->pectrl.reg.convert
- = GCREG_PE_CONTROL_YUVRGB_DISABLED;
-
- /* Program U/V plane. */
- add_fixup(bvbltparams, batch, &gcmoxsrcyuv2->uplaneaddress,
- srcinfo->bytealign2);
- gcmoxsrcyuv2->uplaneaddress_ldst
- = gcmoxsrcyuv_uplaneaddress_ldst[index];
- gcmoxsrcyuv2->uplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoxsrcyuv2->uplanestride_ldst
- = gcmoxsrcyuv_uplanestride_ldst[index];
- gcmoxsrcyuv2->uplanestride = srcinfo->stride2;
- break;
-
- case 3:
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmoxsrcyuv3),
- (void **) &gcmoxsrcyuv3);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Set YUV parameters. */
- gcmoxsrcyuv3->pectrl_ldst
- = gcmoxsrcyuv_pectrl_ldst[index];
- gcmoxsrcyuv3->pectrl.raw = 0;
- gcmoxsrcyuv3->pectrl.reg.standard
- = srcinfo->format.cs.yuv.std;
- gcmoxsrcyuv3->pectrl.reg.swizzle
- = srcinfo->format.swizzle;
- gcmoxsrcyuv3->pectrl.reg.convert
- = GCREG_PE_CONTROL_YUVRGB_DISABLED;
-
- /* Program U/V planes. */
- add_fixup(bvbltparams, batch, &gcmoxsrcyuv3->uplaneaddress,
- srcinfo->bytealign2);
- add_fixup(bvbltparams, batch, &gcmoxsrcyuv3->vplaneaddress,
- srcinfo->bytealign3);
- gcmoxsrcyuv3->uplaneaddress_ldst
- = gcmoxsrcyuv_uplaneaddress_ldst[index];
- gcmoxsrcyuv3->uplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoxsrcyuv3->uplanestride_ldst
- = gcmoxsrcyuv_uplanestride_ldst[index];
- gcmoxsrcyuv3->uplanestride = srcinfo->stride2;
- gcmoxsrcyuv3->vplaneaddress_ldst
- = gcmoxsrcyuv_vplaneaddress_ldst[index];
- gcmoxsrcyuv3->vplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoxsrcyuv3->vplanestride_ldst
- = gcmoxsrcyuv_vplanestride_ldst[index];
- gcmoxsrcyuv3->vplanestride = srcinfo->stride3;
- break;
-
- default:
- GCERR("invlaid plane count %d.\n",
- srcinfo->format.cs.yuv.planecount);
- }
-
-exit:
- GCEXITARG(GCZONE_SRC, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-/*******************************************************************************
- * Surface compare and validation.
- */
-
-static inline bool equal_rects(struct bvrect *rect1, struct bvrect *rect2)
-{
- if (rect1->left != rect2->left)
- return false;
-
- if (rect1->top != rect2->top)
- return false;
-
- if (rect1->width != rect2->width)
- return false;
-
- if (rect1->height != rect2->height)
- return false;
-
- return true;
-}
-
-/* The function verifies whether the two buffer descriptors and rectangles
- define the same physical area. */
-static bool same_phys_area(struct bvbuffdesc *surf1, struct bvrect *rect1,
- struct bvbuffdesc *surf2, struct bvrect *rect2)
-{
- struct bvphysdesc *physdesc1;
- struct bvphysdesc *physdesc2;
-
- /* If pointers are the same, things are much easier. */
- if (surf1 == surf2)
- /* Compare the rectangles. For simplicity we don't consider
- cases with partially overlapping rectangles at this time. */
- return equal_rects(rect1, rect2);
-
- /* Assume diffrent areas if the types are different. */
- if (surf1->auxtype != surf2->auxtype)
- return false;
-
- if (surf1->auxtype == BVAT_PHYSDESC) {
- physdesc1 = (struct bvphysdesc *) surf1->auxptr;
- physdesc2 = (struct bvphysdesc *) surf2->auxptr;
-
- /* Same physical descriptor? */
- if (physdesc1 == physdesc2)
- return equal_rects(rect1, rect2);
-
- /* Same page array? */
- if (physdesc1->pagearray == physdesc2->pagearray)
- return equal_rects(rect1, rect2);
-
- /* Pageoffsets must match since different buffers
- * can share the same first page (eg nv12).
- */
- if (physdesc1->pageoffset != physdesc2->pageoffset)
- return false;
-
- /* Assume the same surface if first pages match. */
- if (physdesc1->pagearray[0] == physdesc2->pagearray[0])
- return equal_rects(rect1, rect2);
-
- } else {
- if (surf1->virtaddr == surf2->virtaddr)
- return equal_rects(rect1, rect2);
- }
-
- return false;
-}
-
-static int verify_surface(unsigned int tile,
- union bvinbuff *surf,
- struct bvsurfgeom *geom)
-{
- if (tile) {
- if (surf->tileparams == NULL)
- return GCBVERR_TILE;
-
- if (surf->tileparams->structsize <
- STRUCTSIZE(surf->tileparams, srcheight))
- return GCBVERR_TILE_VERS;
-
- /* FIXME/TODO */
- return GCBVERR_TILE;
- } else {
- if (surf->desc == NULL)
- return GCBVERR_DESC;
-
- if (surf->desc->structsize < STRUCTSIZE(surf->desc, map))
- return GCBVERR_DESC_VERS;
- }
-
- if (geom == NULL)
- return GCBVERR_GEOM;
-
- if (geom->structsize < STRUCTSIZE(geom, palette))
- return GCBVERR_GEOM_VERS;
-
- /* Validation successful. */
- return -1;
-}
-
-
-/*******************************************************************************
- * Library constructor and destructor.
- */
-
-void bv_init(void)
-{
- struct gccontext *gccontext = get_context();
- struct gcicaps gcicaps;
- unsigned i, j;
-
- GCDBG_REGISTER(bv);
- GCDBG_REGISTER(parser);
- GCDBG_REGISTER(map);
- GCDBG_REGISTER(buffer);
- GCDBG_REGISTER(fill);
- GCDBG_REGISTER(blit);
- GCDBG_REGISTER(filter);
-
- GCLOCK_INIT(&gccontext->batchlock);
- GCLOCK_INIT(&gccontext->bufferlock);
- GCLOCK_INIT(&gccontext->fixuplock);
- GCLOCK_INIT(&gccontext->maplock);
- GCLOCK_INIT(&gccontext->callbacklock);
-
- INIT_LIST_HEAD(&gccontext->unmapvac);
- INIT_LIST_HEAD(&gccontext->buffervac);
- INIT_LIST_HEAD(&gccontext->fixupvac);
- INIT_LIST_HEAD(&gccontext->batchvac);
- INIT_LIST_HEAD(&gccontext->callbacklist);
- INIT_LIST_HEAD(&gccontext->callbackvac);
-
- /* Initialize the filter cache. */
- for (i = 0; i < GC_FILTER_COUNT; i += 1)
- for (j = 0; j < GC_TAP_COUNT; j += 1)
- INIT_LIST_HEAD(&gccontext->filtercache[i][j].list);
-
- /* Query hardware caps. */
- gc_getcaps_wrapper(&gcicaps);
- if (gcicaps.gcerror == GCERR_NONE) {
- gccontext->gcmodel = gcicaps.gcmodel;
- gccontext->gcrevision = gcicaps.gcrevision;
- gccontext->gcdate = gcicaps.gcdate;
- gccontext->gctime = gcicaps.gctime;
- gccontext->gcfeatures = gcicaps.gcfeatures;
- gccontext->gcfeatures0 = gcicaps.gcfeatures0;
- gccontext->gcfeatures1 = gcicaps.gcfeatures1;
- gccontext->gcfeatures2 = gcicaps.gcfeatures2;
- gccontext->gcfeatures3 = gcicaps.gcfeatures3;
- }
-}
-
-void bv_exit(void)
-{
- struct gccontext *gccontext = get_context();
- struct bvbuffmap *bvbuffmap;
- struct list_head *head;
- struct gcschedunmap *gcschedunmap;
- struct gcbuffer *gcbuffer;
- struct gcfixup *gcfixup;
- struct gcbatch *gcbatch;
- struct gccallbackinfo *gccallbackinfo;
-
- while (gccontext->buffmapvac != NULL) {
- bvbuffmap = gccontext->buffmapvac;
- gccontext->buffmapvac = bvbuffmap->nextmap;
- gcfree(bvbuffmap);
- }
-
- while (!list_empty(&gccontext->unmapvac)) {
- head = gccontext->unmapvac.next;
- gcschedunmap = list_entry(head, struct gcschedunmap, link);
- list_del(head);
- gcfree(gcschedunmap);
- }
-
- while (!list_empty(&gccontext->buffervac)) {
- head = gccontext->buffervac.next;
- gcbuffer = list_entry(head, struct gcbuffer, link);
- list_del(head);
- gcfree(gcbuffer);
- }
-
- while (!list_empty(&gccontext->fixupvac)) {
- head = gccontext->fixupvac.next;
- gcfixup = list_entry(head, struct gcfixup, link);
- list_del(head);
- gcfree(gcfixup);
- }
-
- while (!list_empty(&gccontext->batchvac)) {
- head = gccontext->batchvac.next;
- gcbatch = list_entry(head, struct gcbatch, link);
- list_del(head);
- gcfree(gcbatch);
- }
-
- while (!list_empty(&gccontext->callbacklist)) {
- head = gccontext->callbacklist.next;
- list_move(head, &gccontext->callbackvac);
- }
-
- while (!list_empty(&gccontext->callbackvac)) {
- head = gccontext->callbackvac.next;
- gccallbackinfo = list_entry(head, struct gccallbackinfo, link);
- list_del(head);
- gcfree(gccallbackinfo);
- }
-
- free_temp(false);
-}
-
-
-/*******************************************************************************
- * Library API.
- */
-
-enum bverror bv_map(struct bvbuffdesc *bvbuffdesc)
-{
- enum bverror bverror;
- struct bvbuffmap *bvbuffmap;
-
- GCENTERARG(GCZONE_MAPPING, "bvbuffdesc = 0x%08X\n",
- (unsigned int) bvbuffdesc);
-
- if (bvbuffdesc == NULL) {
- BVSETERROR(BVERR_BUFFERDESC, "bvbuffdesc is NULL");
- goto exit;
- }
-
- if (bvbuffdesc->structsize < STRUCTSIZE(bvbuffdesc, map)) {
- BVSETERROR(BVERR_BUFFERDESC_VERS, "argument has invalid size");
- goto exit;
- }
-
- bverror = do_map(bvbuffdesc, NULL, &bvbuffmap);
-
-exit:
- GCEXITARG(GCZONE_MAPPING, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror bv_unmap(struct bvbuffdesc *bvbuffdesc)
-{
- enum bverror bverror = BVERR_NONE;
- enum bverror otherbverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
- struct bvbuffmap *prev = NULL;
- struct bvbuffmap *bvbuffmap;
- struct bvbuffmapinfo *bvbuffmapinfo;
- struct gcimap gcimap;
-
- GCENTERARG(GCZONE_MAPPING, "bvbuffdesc = 0x%08X\n",
- (unsigned int) bvbuffdesc);
-
- /* Lock access to the mapping list. */
- GCLOCK(&gccontext->maplock);
-
- if (bvbuffdesc == NULL) {
- BVSETERROR(BVERR_BUFFERDESC, "bvbuffdesc is NULL");
- goto exit;
- }
-
- if (bvbuffdesc->structsize < STRUCTSIZE(bvbuffdesc, map)) {
- BVSETERROR(BVERR_BUFFERDESC_VERS, "argument has invalid size");
- goto exit;
- }
-
- /* Is the buffer mapped? */
- bvbuffmap = bvbuffdesc->map;
- if (bvbuffmap == NULL) {
- GCDBG(GCZONE_MAPPING, "buffer isn't mapped.\n");
- goto exit;
- }
-
- /* Try to find our mapping. */
- while (bvbuffmap != NULL) {
- if (bvbuffmap->bv_unmap == bv_unmap)
- break;
- prev = bvbuffmap;
- bvbuffmap = bvbuffmap->nextmap;
- }
-
- /* Are there other implementations? */
- if ((prev != NULL) || (bvbuffmap->nextmap != NULL)) {
- GCDBG(GCZONE_MAPPING,
- "have mappings from other implementations.\n");
-
- /* Was our mapping found? */
- if (bvbuffmap == NULL) {
- GCDBG(GCZONE_MAPPING,
- "no mapping from our implementation.\n");
-
- /* No, call other implementations. */
- bverror = bvbuffdesc->map->bv_unmap(bvbuffdesc);
- goto exit;
- }
-
- if (bvbuffmap->structsize
- < STRUCTSIZE(bvbuffmap, nextmap)) {
- BVSETERROR(BVERR_BUFFERDESC_VERS,
- "unsupported bvbuffdesc version");
- goto exit;
- }
-
- /* Remove our mapping. */
- if (prev == NULL)
- bvbuffdesc->map = bvbuffmap->nextmap;
- else
- prev->nextmap = bvbuffmap->nextmap;
-
- /* Call other implementation. */
- otherbverror = bvbuffdesc->map->bv_unmap(bvbuffdesc);
-
- /* Add our mapping back. */
- bvbuffmap->nextmap = bvbuffdesc->map;
- bvbuffdesc->map = bvbuffmap;
- prev = NULL;
- } else {
- GCDBG(GCZONE_MAPPING,
- "no mappings from other implementations.\n");
- }
-
- /* Get the info structure. */
- bvbuffmapinfo = (struct bvbuffmapinfo *) bvbuffmap->handle;
-
- GCDBG(GCZONE_MAPPING, "bvbuffmap = 0x%08X\n", (unsigned int) bvbuffmap);
- GCDBG(GCZONE_MAPPING, "handle = 0x%08X\n", bvbuffmapinfo->handle);
-
- /* Explicit unmapping. */
- if (bvbuffmapinfo->usermap == 0)
- GCERR("explicit count is already zero.\n");
- bvbuffmapinfo->usermap = 0;
-
- GCDBG(GCZONE_MAPPING, "explicit count = %d\n",
- bvbuffmapinfo->usermap);
- GCDBG(GCZONE_MAPPING, "implicit count = %d\n",
- bvbuffmapinfo->automap);
-
- /* Do we have implicit mappings? */
- if (bvbuffmapinfo->automap > 0) {
- GCDBG(GCZONE_MAPPING, "have implicit unmappings.\n");
- goto exit;
- }
-
- /* Unmap the buffer. */
- memset(&gcimap, 0, sizeof(gcimap));
- gcimap.handle = bvbuffmapinfo->handle;
- gc_unmap_wrapper(&gcimap);
- if (gcimap.gcerror != GCERR_NONE) {
- BVSETERROR(BVERR_OOM, "unable to free gccore memory");
- goto exit;
- }
-
- /* Remove from the buffer descriptor list. */
- if (prev == NULL)
- bvbuffdesc->map = bvbuffmap->nextmap;
- else
- prev->nextmap = bvbuffmap->nextmap;
-
- /* Invalidate the record. */
- bvbuffmap->structsize = 0;
-
- /* Add to the vacant list. */
- bvbuffmap->nextmap = gccontext->buffmapvac;
- gccontext->buffmapvac = bvbuffmap;
-
-exit:
- /* Unlock access to the mapping list. */
- GCUNLOCK(&gccontext->maplock);
-
- GCEXITARG(GCZONE_MAPPING, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror bv_blt(struct bvbltparams *bvbltparams)
-{
- enum bverror bverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
- struct gcalpha *gca = NULL;
- struct gcalpha _gca;
- unsigned int op, type, blend, format;
- unsigned int batchexec = 0;
- bool nop = false;
- struct gcbatch *gcbatch;
- struct bvrect *dstrect;
- int src1used, src2used, maskused;
- struct surfaceinfo srcinfo[2];
- struct bvrect *srcrect[2];
- unsigned short rop;
- struct gcicommit gcicommit;
- int i, srccount, res;
-
- GCENTERARG(GCZONE_BLIT, "bvbltparams = 0x%08X\n",
- (unsigned int) bvbltparams);
-
- /* Verify blt parameters structure. */
- if (bvbltparams == NULL) {
- BVSETERROR(BVERR_BLTPARAMS_VERS, "bvbltparams is NULL");
- goto exit;
- }
-
- if (bvbltparams->structsize < STRUCTSIZE(bvbltparams, callbackdata)) {
- BVSETERROR(BVERR_BLTPARAMS_VERS, "argument has invalid size");
- goto exit;
- }
-
- /* Reset the error message. */
- bvbltparams->errdesc = NULL;
-
- /* Verify the destination parameters structure. */
- res = verify_surface(0, (union bvinbuff *) &bvbltparams->dstdesc,
- bvbltparams->dstgeom);
- if (res != -1) {
- BVSETBLTSURFERROR(res, g_destsurferr);
- goto exit;
- }
-
- /* Extract the operation flags. */
- op = (bvbltparams->flags & BVFLAG_OP_MASK) >> BVFLAG_OP_SHIFT;
- type = (bvbltparams->flags & BVFLAG_BATCH_MASK) >> BVFLAG_BATCH_SHIFT;
- GCDBG(GCZONE_BLIT, "op = %d\n", op);
- GCDBG(GCZONE_BLIT, "type = %d\n", type);
-
- switch (type) {
- case (BVFLAG_BATCH_NONE >> BVFLAG_BATCH_SHIFT):
- bverror = allocate_batch(bvbltparams, &gcbatch);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- batchexec = 1;
- gcbatch->batchflags = 0x7FFFFFFF;
-
- GCDBG(GCZONE_BATCH, "BVFLAG_BATCH_NONE(0x%08X)\n",
- (unsigned int) gcbatch);
- break;
-
- case (BVFLAG_BATCH_BEGIN >> BVFLAG_BATCH_SHIFT):
- bverror = allocate_batch(bvbltparams, &gcbatch);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- bvbltparams->batch = (struct bvbatch *) gcbatch;
-
- batchexec = 0;
- bvbltparams->batchflags =
- gcbatch->batchflags = 0x7FFFFFFF;
-
- GCDBG(GCZONE_BATCH, "BVFLAG_BATCH_BEGIN(0x%08X)\n",
- (unsigned int) gcbatch);
- break;
-
- case (BVFLAG_BATCH_CONTINUE >> BVFLAG_BATCH_SHIFT):
- gcbatch = (struct gcbatch *) bvbltparams->batch;
- if (gcbatch == NULL) {
- BVSETBLTERROR(BVERR_BATCH, "batch is not initialized");
- goto exit;
- }
-
- if (gcbatch->structsize < STRUCTSIZE(gcbatch, unmap)) {
- BVSETBLTERROR(BVERR_BATCH, "invalid batch");
- goto exit;
- }
-
- batchexec = 0;
- gcbatch->batchflags = bvbltparams->batchflags;
-
- GCDBG(GCZONE_BATCH, "BVFLAG_BATCH_CONTINUE(0x%08X)\n",
- (unsigned int) gcbatch);
- break;
-
- case (BVFLAG_BATCH_END >> BVFLAG_BATCH_SHIFT):
- gcbatch = (struct gcbatch *) bvbltparams->batch;
- if (gcbatch == NULL) {
- BVSETBLTERROR(BVERR_BATCH, "batch is not initialized");
- goto exit;
- }
-
- if (gcbatch->structsize < STRUCTSIZE(gcbatch, unmap)) {
- BVSETBLTERROR(BVERR_BATCH, "invalid batch");
- goto exit;
- }
-
- batchexec = 1;
- nop = (bvbltparams->batchflags & BVBATCH_ENDNOP) != 0;
- gcbatch->batchflags = bvbltparams->batchflags;
-
- GCDBG(GCZONE_BATCH, "BVFLAG_BATCH_END(0x%08X)\n",
- (unsigned int) gcbatch);
- break;
-
- default:
- BVSETBLTERROR(BVERR_BATCH, "unrecognized batch type");
- goto exit;
- }
-
- GCDBG(GCZONE_BATCH, "batchflags=0x%08X\n",
- (unsigned int) gcbatch->batchflags);
-
- if (!nop) {
- /* Get a shortcut to the destination rectangle. */
- dstrect = &bvbltparams->dstrect;
-
- /* Verify the batch change flags. */
- GCVERIFYBATCH(gcbatch->batchflags >> 12,
- &gcbatch->prevdstrect, dstrect);
-
- switch (op) {
- case (BVFLAG_ROP >> BVFLAG_OP_SHIFT):
- GCDBG(GCZONE_BLIT, "BVFLAG_ROP\n");
-
- rop = bvbltparams->op.rop;
- src1used = ((rop & 0xCCCC) >> 2)
- ^ (rop & 0x3333);
- src2used = ((rop & 0xF0F0) >> 4)
- ^ (rop & 0x0F0F);
- maskused = ((rop & 0xFF00) >> 8)
- ^ (rop & 0x00FF);
- break;
-
- case (BVFLAG_BLEND >> BVFLAG_OP_SHIFT):
- GCDBG(GCZONE_BLIT, "BVFLAG_BLEND\n");
-
- blend = bvbltparams->op.blend;
- format = (blend & BVBLENDDEF_FORMAT_MASK)
- >> BVBLENDDEF_FORMAT_SHIFT;
-
- bverror = parse_blend(bvbltparams, blend, &_gca);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gca = &_gca;
-
- switch (format) {
- case (BVBLENDDEF_FORMAT_CLASSIC
- >> BVBLENDDEF_FORMAT_SHIFT):
- src1used = gca->src1used;
- src2used = gca->src2used;
- maskused = blend & BVBLENDDEF_REMOTE;
- break;
-
- default:
- BVSETBLTERROR(BVERR_BLEND,
- "unrecognized blend format");
- goto exit;
- }
- break;
-
- case (BVFLAG_FILTER >> BVFLAG_OP_SHIFT):
- GCDBG(GCZONE_BLIT, "BVFLAG_FILTER\n");
- BVSETBLTERROR(BVERR_OP,
- "filter operation not supported");
- goto exit;
-
- default:
- BVSETBLTERROR(BVERR_OP, "unrecognized operation");
- goto exit;
- }
-
- /* Reset the number of sources. */
- srccount = 0;
-
- /* Verify the src1 parameters structure. */
- if (src1used) {
- GCDBG(GCZONE_SRC, "source #1: used\n");
- res = verify_surface(
- bvbltparams->flags & BVBATCH_TILE_SRC1,
- &bvbltparams->src1, bvbltparams->src1geom);
- if (res != -1) {
- BVSETBLTSURFERROR(res, g_src1surferr);
- goto exit;
- }
-
- /* Verify the batch change flags. */
- GCVERIFYBATCH(gcbatch->batchflags >> 14,
- &gcbatch->prevsrc1rect,
- &bvbltparams->src1rect);
-
- /* Same as the destination? */
- if (same_phys_area(bvbltparams->src1.desc,
- &bvbltparams->src1rect,
- bvbltparams->dstdesc,
- dstrect)) {
- GCDBG(GCZONE_BLIT, " same as destination\n");
- } else {
- srcinfo[srccount].index = 0;
- srcinfo[srccount].buf = bvbltparams->src1;
- srcinfo[srccount].geom = bvbltparams->src1geom;
- srcinfo[srccount].newgeom
- = gcbatch->batchflags
- & BVBATCH_SRC1;
- srcinfo[srccount].newrect
- = gcbatch->batchflags
- & (BVBATCH_SRC1RECT_ORIGIN |
- BVBATCH_SRC1RECT_SIZE);
- srcrect[srccount] = &bvbltparams->src1rect;
-
- bverror = parse_source(bvbltparams, gcbatch,
- &bvbltparams->src1rect,
- &srcinfo[srccount]);
- if (bverror != BVERR_NONE)
- goto exit;
-
- srccount += 1;
- }
- }
-
- /* Verify the src2 parameters structure. */
- if (src2used) {
- GCDBG(GCZONE_SRC, "source #2: used\n");
- res = verify_surface(
- bvbltparams->flags & BVBATCH_TILE_SRC2,
- &bvbltparams->src2, bvbltparams->src2geom);
- if (res != -1) {
- BVSETBLTSURFERROR(res, g_src2surferr);
- goto exit;
- }
-
- /* Verify the batch change flags. */
- GCVERIFYBATCH(gcbatch->batchflags >> 16,
- &gcbatch->prevsrc2rect,
- &bvbltparams->src2rect);
-
- /* Same as the destination? */
- if (same_phys_area(bvbltparams->src2.desc,
- &bvbltparams->src2rect,
- bvbltparams->dstdesc,
- dstrect)) {
- GCDBG(GCZONE_BLIT, " same as destination\n");
- } else {
- srcinfo[srccount].index = 1;
- srcinfo[srccount].buf = bvbltparams->src2;
- srcinfo[srccount].geom = bvbltparams->src2geom;
- srcinfo[srccount].newgeom
- = gcbatch->batchflags
- & BVBATCH_SRC2;
- srcinfo[srccount].newrect
- = gcbatch->batchflags
- & (BVBATCH_SRC2RECT_ORIGIN |
- BVBATCH_SRC2RECT_SIZE);
- srcrect[srccount] = &bvbltparams->src2rect;
-
- bverror = parse_source(bvbltparams, gcbatch,
- &bvbltparams->src2rect,
- &srcinfo[srccount]);
- if (bverror != BVERR_NONE)
- goto exit;
-
- srccount += 1;
- }
- }
-
- /* Verify the mask parameters structure. */
- if (maskused) {
- GCDBG(GCZONE_MASK, "mask: used\n");
- res = verify_surface(
- bvbltparams->flags & BVBATCH_TILE_MASK,
- &bvbltparams->mask, bvbltparams->maskgeom);
- if (res != -1) {
- BVSETBLTSURFERROR(res, g_masksurferr);
- goto exit;
- }
-
- /* Verify the batch change flags. */
- GCVERIFYBATCH(gcbatch->batchflags >> 18,
- &gcbatch->prevmaskrect,
- &bvbltparams->maskrect);
-
- BVSETBLTERROR(BVERR_OP,
- "operation with mask not supported");
- goto exit;
- }
-
- GCDBG(GCZONE_BLIT, "srccount = %d\n", srccount);
-
- if (srccount == 0) {
- BVSETBLTERROR(BVERR_OP,
- "operation not supported");
- goto exit;
- } else {
- for (i = 0; i < srccount; i += 1) {
- int srcw, srch;
- GCDBG(GCZONE_BLIT,
- "processing source %d.\n",
- srcinfo[i].index + 1);
-
- if (gca == NULL) {
- GCDBG(GCZONE_BLIT,
- " blending disabled.\n");
- srcinfo[i].rop = bvbltparams->op.rop;
- srcinfo[i].gca = NULL;
- } else if ((i + 1) != srccount) {
- GCDBG(GCZONE_BLIT,
- " disabling blending for "
- "the first source.\n");
- srcinfo[i].rop = 0xCC;
- srcinfo[i].gca = NULL;
- } else {
- GCDBG(GCZONE_BLIT,
- " enabling blending.\n");
- srcinfo[i].rop = 0xCC;
- srcinfo[i].gca = gca;
-
- if (srccount == 1) {
- gca->srcconfig = gca->k1;
- gca->dstconfig = gca->k2;
- } else {
- gca->srcconfig = gca->k2;
- gca->dstconfig = gca->k1;
- }
- }
-
- GCDBG(GCZONE_BLIT, " srcsize %dx%d.\n",
- srcrect[i]->width, srcrect[i]->height);
- GCDBG(GCZONE_BLIT, " dstsize %dx%d.\n",
- dstrect->width, dstrect->height);
-
- srcw = srcrect[i]->width;
- srch = srcrect[i]->height;
- if ((srcw == 1) && (srch == 1) &&
- (bvbltparams->src1.desc->virtaddr)) {
- GCDBG(GCZONE_BLIT, " op: fill.\n");
- bverror = do_fill(bvbltparams,
- gcbatch,
- &srcinfo[i]);
- } else if ((srcw == dstrect->width) &&
- (srch == dstrect->height)) {
- GCDBG(GCZONE_BLIT, " op: bitblit.\n");
- bverror = do_blit(bvbltparams,
- gcbatch,
- &srcinfo[i]);
- } else {
- GCDBG(GCZONE_BLIT, " op: filter.\n");
- bverror = do_filter(bvbltparams,
- gcbatch,
- &srcinfo[i]);
- }
-
- if (bverror != BVERR_NONE)
- goto exit;
- }
- }
- }
-
- if (batchexec) {
- struct gcmoflush *flush;
-
- GCDBG(GCZONE_BLIT, "preparing to submit the batch.\n");
-
- /* Finalize the current operation. */
- bverror = gcbatch->batchend(bvbltparams, gcbatch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Add PE flush. */
- GCDBG(GCZONE_BLIT, "appending the flush.\n");
- bverror = claim_buffer(bvbltparams, gcbatch,
- sizeof(struct gcmoflush),
- (void **) &flush);
- if (bverror != BVERR_NONE)
- goto exit;
-
- flush->flush_ldst = gcmoflush_flush_ldst;
- flush->flush.reg = gcregflush_pe2D;
-
- /* Process asynchronous operation. */
- if ((bvbltparams->flags & BVFLAG_ASYNC) == 0) {
- GCDBG(GCZONE_BLIT, "synchronous batch.\n");
- gcicommit.callback = NULL;
- gcicommit.callbackparam = NULL;
- gcicommit.asynchronous = false;
- } else {
- struct gccallbackinfo *gccallbackinfo;
-
- GCDBG(GCZONE_BLIT, "asynchronous batch (0x%08X):\n",
- bvbltparams->flags);
-
- if (bvbltparams->callbackfn == NULL) {
- GCDBG(GCZONE_BLIT, "no callback given.\n");
- gcicommit.callback = NULL;
- gcicommit.callbackparam = NULL;
- } else {
- bverror = get_callbackinfo(&gccallbackinfo);
- if (bverror != BVERR_NONE) {
- BVSETBLTERROR(BVERR_OOM,
- "callback allocation "
- "failed");
- goto exit;
- }
-
- gccallbackinfo->info.callback.fn
- = bvbltparams->callbackfn;
- gccallbackinfo->info.callback.data
- = bvbltparams->callbackdata;
-
- gcicommit.callback = callbackbltsville;
- gcicommit.callbackparam = gccallbackinfo;
-
- GCDBG(GCZONE_BLIT,
- "gcbv_callback = 0x%08X\n",
- (unsigned int) gcicommit.callback);
- GCDBG(GCZONE_BLIT,
- "gcbv_param = 0x%08X\n",
- (unsigned int) gcicommit.callbackparam);
- GCDBG(GCZONE_BLIT,
- "bltsville_callback = 0x%08X\n",
- (unsigned int)
- gccallbackinfo->info.callback.fn);
- GCDBG(GCZONE_BLIT,
- "bltsville_param = 0x%08X\n",
- (unsigned int)
- gccallbackinfo->info.callback.data);
- }
-
- gcicommit.asynchronous = true;
- }
-
- /* Process scheduled unmappings. */
- do_unmap_implicit(gcbatch);
-
- INIT_LIST_HEAD(&gcicommit.unmap);
- list_splice_init(&gcbatch->unmap, &gcicommit.unmap);
-
- /* Pass the batch for execution. */
- GCDUMPBATCH(gcbatch);
-
- gcicommit.gcerror = GCERR_NONE;
- gcicommit.entrypipe = GCPIPE_2D;
- gcicommit.exitpipe = GCPIPE_2D;
-
- INIT_LIST_HEAD(&gcicommit.buffer);
- list_splice_init(&gcbatch->buffer, &gcicommit.buffer);
-
- GCDBG(GCZONE_BLIT, "submitting the batch.\n");
- gc_commit_wrapper(&gcicommit);
-
- /* Move the lists back to the batch. */
- list_splice_init(&gcicommit.buffer, &gcbatch->buffer);
- list_splice_init(&gcicommit.unmap, &gcbatch->unmap);
-
- /* Error? */
- if (gcicommit.gcerror != GCERR_NONE) {
- switch (gcicommit.gcerror) {
- case GCERR_OODM:
- case GCERR_CTX_ALLOC:
- BVSETBLTERROR(BVERR_OOM,
- "unable to allocate gccore "
- "memory");
- goto exit;
- default:
- BVSETBLTERROR(BVERR_RSRC,
- "gccore error");
-
- goto exit;
- }
- }
-
- GCDBG(GCZONE_BLIT, "batch is submitted.\n");
- }
-
-exit:
- if ((gcbatch != NULL) && batchexec) {
- free_batch(gcbatch);
- bvbltparams->batch = NULL;
- }
-
- GCEXITARG(GCZONE_BLIT, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-enum bverror bv_cache(struct bvcopparams *copparams)
-{
- enum bverror bverror = BVERR_NONE;
- unsigned int bytespp = 0; /* bytes per pixel */
- unsigned long vert_offset, horiz_offset;
- unsigned int true_width, true_height;
-
- struct c2dmrgn rgn[3];
- int container_size = 0;
-
- unsigned long subsample;
- unsigned long vendor;
- unsigned long layout;
- unsigned long size;
- unsigned long container;
-
- subsample = copparams->geom->format & OCDFMTDEF_SUBSAMPLE_MASK;
- vendor = copparams->geom->format & OCDFMTDEF_VENDOR_MASK;
- layout = copparams->geom->format & OCDFMTDEF_LAYOUT_MASK;
- size = copparams->geom->format & OCDFMTDEF_COMPONENTSIZEMINUS1_MASK;
- container = copparams->geom->format & OCDFMTDEF_CONTAINER_MASK;
-
- if (vendor != OCDFMTDEF_VENDOR_ALL) {
- bverror = BVERR_FORMAT;
- goto exit;
- }
-
- if (copparams->geom->orientation % 180 != 0) {
- true_width = copparams->rect->height;
- true_height = copparams->rect->width;
- } else {
- true_width = copparams->rect->width;
- true_height = copparams->rect->height;
- }
-
- switch (container) {
- case OCDFMTDEF_CONTAINER_8BIT:
- container_size = 8;
- break;
-
- case OCDFMTDEF_CONTAINER_16BIT:
- container_size = 16;
- break;
-
- case OCDFMTDEF_CONTAINER_24BIT:
- container_size = 24;
- break;
-
- case OCDFMTDEF_CONTAINER_32BIT:
- container_size = 32;
- break;
-
- case OCDFMTDEF_CONTAINER_48BIT:
- container_size = 48;
- break;
-
- case OCDFMTDEF_CONTAINER_64BIT:
- container_size = 64;
- break;
- }
-
- switch (layout) {
- case OCDFMTDEF_PACKED:
- switch (subsample) {
- case OCDFMTDEF_SUBSAMPLE_NONE:
- if (size >= 8) {
- bytespp = container_size / 8;
- } else {
- GCERR("format not supported.\n");
- bverror = BVERR_FORMAT;
- goto exit;
- }
- break;
-
- case OCDFMTDEF_SUBSAMPLE_422_YCbCr:
- bytespp = (container_size / 2) / 8;
- break;
-
- default:
- bverror = BVERR_FORMAT;
- goto exit;
- }
-
- rgn[0].span = true_width * bytespp;
- rgn[0].lines = true_height;
- rgn[0].stride = copparams->geom->virtstride;
- horiz_offset = copparams->rect->left * bytespp;
- vert_offset = copparams->rect->top;
-
- rgn[0].start = (void *) ((unsigned long)
- copparams->desc->virtaddr +
- vert_offset * rgn[0].stride +
- horiz_offset);
-
- gcbvcacheop(1, rgn, copparams->cacheop);
- break;
-
- case OCDFMTDEF_2_PLANE_YCbCr:
- /* 1 byte per pixel */
- rgn[0].span = true_width;
- rgn[0].lines = true_height;
- rgn[0].stride = copparams->geom->virtstride;
- rgn[0].start = (void *)
- ((unsigned long) copparams->desc->virtaddr +
- copparams->rect->top * rgn[0].stride +
- copparams->rect->left);
-
- rgn[1].span = true_width;
- rgn[1].lines = true_height / 2;
- rgn[1].stride = copparams->geom->virtstride;
- rgn[1].start = rgn[0].start +
- copparams->geom->height * rgn[0].stride;
-
- GCDBG(GCZONE_CACHE,
- "virtaddr %p start[0] 0x%08x start[1] 0x%08x\n",
- copparams->desc->virtaddr, rgn[0].start, rgn[1].start);
-
- gcbvcacheop(2, rgn, copparams->cacheop);
- break;
-
- default:
- GCERR("format 0x%x (%d) not supported.\n",
- copparams->geom->format, copparams->geom->format);
- bverror = BVERR_FORMAT;
- break;
- }
-
-exit:
- if (bverror != BVERR_NONE)
- GCERR("bverror = %d\n", bverror);
-
- return bverror;
-}
diff --git a/bltsville/gcbv/mirror/gcbv.h b/bltsville/gcbv/mirror/gcbv.h
deleted file mode 100644
index 6392d4f..0000000
--- a/bltsville/gcbv/mirror/gcbv.h
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCBV_H
-#define GCBV_H
-
-#include "gcmain.h"
-
-/*******************************************************************************
- * Miscellaneous defines and macros.
- */
-
-#define GC_MAX_BASE_ALIGN 64
-
-#if !defined(BVBATCH_DESTRECT)
-#define BVBATCH_DESTRECT (BVBATCH_DSTRECT_ORIGIN | BVBATCH_DSTRECT_SIZE)
-#endif
-
-#if !defined(BVBATCH_SRC1RECT)
-#define BVBATCH_SRC1RECT (BVBATCH_SRC1RECT_ORIGIN | BVBATCH_SRC1RECT_SIZE)
-#endif
-
-#if !defined(BVBATCH_SRC2RECT)
-#define BVBATCH_SRC2RECT (BVBATCH_SRC2RECT_ORIGIN | BVBATCH_SRC2RECT_SIZE)
-#endif
-
-#define STRUCTSIZE(structptr, lastmember) \
-( \
- (size_t) &structptr->lastmember + \
- sizeof(structptr->lastmember) - \
- (size_t) structptr \
-)
-
-#define GET_MAP_HANDLE(map) \
-( \
- ((struct bvbuffmapinfo *) map->handle)->handle \
-)
-
-#define GC_CLIP_RESET_LEFT ((unsigned short) 0)
-#define GC_CLIP_RESET_TOP ((unsigned short) 0)
-#define GC_CLIP_RESET_RIGHT ((unsigned short) ((1 << 15) - 1))
-#define GC_CLIP_RESET_BOTTOM ((unsigned short) ((1 << 15) - 1))
-
-#define BVSETERROR(error, message, ...) \
-do { \
- struct gccontext *tmpcontext = get_context(); \
- snprintf(tmpcontext->bverrorstr, sizeof(tmpcontext->bverrorstr), \
- message, ##__VA_ARGS__); \
- GCDUMPSTRING("%s(%d): [ERROR] %s\n", __func__, __LINE__, \
- tmpcontext->bverrorstr); \
- bverror = error; \
-} while (0)
-
-#define BVSETBLTERROR(error, message, ...) \
-do { \
- struct gccontext *tmpcontext = get_context(); \
- snprintf(tmpcontext->bverrorstr, sizeof(tmpcontext->bverrorstr), \
- message, ##__VA_ARGS__); \
- GCDUMPSTRING("%s(%d): [ERROR] %s\n", __func__, __LINE__, \
- tmpcontext->bverrorstr); \
- bvbltparams->errdesc = tmpcontext->bverrorstr; \
- bverror = error; \
-} while (0)
-
-#define GCPRINT_RECT(zone, name, rect) \
-{ \
- GCDBG(zone, \
- name " = (%d,%d)-(%d,%d), %dx%d\n", \
- (rect)->left, (rect)->top, \
- (rect)->right, (rect)->bottom, \
- (rect)->right - (rect)->left, \
- (rect)->bottom - (rect)->top); \
-}
-
-
-/*******************************************************************************
- * Kernel table definitions.
- */
-
-#define GC_TAP_COUNT 9
-#define GC_PHASE_BITS 5
-#define GC_PHASE_MAX_COUNT (1 << GC_PHASE_BITS)
-#define GC_PHASE_LOAD_COUNT (GC_PHASE_MAX_COUNT / 2 + 1)
-#define GC_COEFFICIENT_COUNT (GC_PHASE_LOAD_COUNT * GC_TAP_COUNT)
-#define GC_FILTER_CACHE_MAX 10
-
-enum gcfiltertype {
- GC_FILTER_SYNC,
- GC_FILTER_BLUR,
-
- /* Number of supported filter types. */
- GC_FILTER_COUNT
-};
-
-struct gcfilterkernel {
- enum gcfiltertype type;
- unsigned int kernelsize;
- unsigned int srcsize;
- unsigned int dstsize;
- unsigned int scalefactor;
- short kernelarray[GC_COEFFICIENT_COUNT];
- struct list_head link;
-};
-
-struct gcfiltercache {
- unsigned int count;
- struct list_head list; /* gcfilterkernel */
-};
-
-
-/*******************************************************************************
- * Global data structure.
- */
-
-struct gccontext {
- /* Last generated error message. */
- char bverrorstr[128];
-
- /* Capabilities and characteristics. */
- unsigned int gcmodel;
- unsigned int gcrevision;
- unsigned int gcdate;
- unsigned int gctime;
- union gcfeatures gcfeatures;
- union gcfeatures0 gcfeatures0;
- union gcfeatures1 gcfeatures1;
- union gcfeatures2 gcfeatures2;
- union gcfeatures3 gcfeatures3;
-
- /* Dynamically allocated structure cache. */
- struct bvbuffmap *buffmapvac; /* bvbuffmap */
- struct list_head unmapvac; /* gcschedunmap */
- struct list_head buffervac; /* gcbuffer */
- struct list_head fixupvac; /* gcfixup */
- struct list_head batchvac; /* gcbatch */
-
- /* Callback lists. */
- struct list_head callbacklist; /* gccallbackinfo */
- struct list_head callbackvac; /* gccallbackinfo */
-
- /* Access locks. */
- GCLOCK_TYPE batchlock;
- GCLOCK_TYPE bufferlock;
- GCLOCK_TYPE fixuplock;
- GCLOCK_TYPE maplock;
- GCLOCK_TYPE callbacklock;
-
- /* Kernel table cache. */
- struct gcfilterkernel *loadedfilter; /* gcfilterkernel */
- struct gcfiltercache filtercache[GC_FILTER_COUNT][GC_TAP_COUNT];
-
- /* Temporary buffer descriptor. */
- struct bvbuffdesc *tmpbuffdesc;
- void *tmpbuff;
-};
-
-
-/*******************************************************************************
- * Mapping structures.
- */
-
-/* bvbuffmap struct attachment. */
-struct bvbuffmapinfo {
- /* Mapped handle for the buffer. */
- unsigned long handle;
-
- /* Number of times the client explicitly mapped this buffer. */
- int usermap;
-
- /* Number of times implicit mapping happened. */
- int automap;
-};
-
-
-/*******************************************************************************
- * Color format.
- */
-
-#define BVFMT_RGB 1
-#define BVFMT_YUV 2
-
-struct bvcomponent {
- unsigned int shift;
- unsigned int size;
- unsigned int mask;
-};
-
-struct bvcsrgb {
- struct bvcomponent r;
- struct bvcomponent g;
- struct bvcomponent b;
- struct bvcomponent a;
-};
-
-struct bvformatxlate {
- unsigned int type;
- unsigned int bitspp;
- unsigned int allocbitspp;
- unsigned int format;
- unsigned int swizzle;
- bool premultiplied;
-
- union {
- struct {
- const struct bvcsrgb *comp;
- } rgb;
-
- struct {
- unsigned int std;
- unsigned int planecount;
- unsigned int xsample;
- unsigned int ysample;
- } yuv;
- } cs;
-};
-
-
-/*******************************************************************************
- * Alpha blending.
- */
-
-/* Alpha blending hardware configuration. */
-struct gcblendconfig {
- unsigned char factor_mode;
- unsigned char color_reverse;
-
- bool src1used;
- bool src2used;
-};
-
-/* Alpha blending descriptor. */
-struct gcalpha {
- unsigned int src_global_color;
- unsigned int dst_global_color;
-
- unsigned char src_global_alpha_mode;
- unsigned char dst_global_alpha_mode;
-
- struct gcblendconfig *k1;
- struct gcblendconfig *k2;
-
- struct gcblendconfig *srcconfig;
- struct gcblendconfig *dstconfig;
-
- bool src1used;
- bool src2used;
-};
-
-
-/*******************************************************************************
- * Rotation and mirror defines.
- */
-
-#define GCREG_ROT_ANGLE_ROT0 0x0
-#define GCREG_ROT_ANGLE_ROT90 0x4
-#define GCREG_ROT_ANGLE_ROT180 0x5
-#define GCREG_ROT_ANGLE_ROT270 0x6
-
-#define ROT_ANGLE_INVALID -1
-#define ROT_ANGLE_0 0
-#define ROT_ANGLE_90 1
-#define ROT_ANGLE_180 2
-#define ROT_ANGLE_270 3
-
-#define GCREG_MIRROR_NONE 0x0
-#define GCREG_MIRROR_X 0x1
-#define GCREG_MIRROR_Y 0x2
-#define GCREG_MIRROR_XY 0x3
-
-extern const unsigned int rotencoding[];
-
-
-/*******************************************************************************
- * Surface descriptor.
- */
-
-struct surfaceinfo {
- /* BLTsville source index (-1 for dst, 0 for src1 and 1 for src2). */
- int index;
-
- /* Surface buffer descriptor. */
- union bvinbuff buf;
-
- /* Surface geometry. */
- struct bvsurfgeom *geom;
- bool newgeom;
-
- /* Rectangle to source from/render to. */
- struct gcrect rect;
- bool newrect;
-
- /* Surface format. */
- struct bvformatxlate format;
-
- /* Physical size of the surface (accounted for rotation). */
- unsigned int physwidth;
- unsigned int physheight;
-
- /* Base address alignment. */
- int xpixalign;
- int ypixalign;
- int bytealign;
- int bytealign2;
- int bytealign3;
- int stride2;
- int stride3;
-
- /* Rotation angle. */
- int angle;
-
- /* Mirror setting. */
- unsigned int mirror;
-
- /* ROP. */
- unsigned short rop;
-
- /* Blending info. */
- struct gcalpha *gca;
-};
-
-
-/*******************************************************************************
- * Batch structures.
- */
-
-/* Operation finalization call. */
-struct gcbatch;
-typedef enum bverror (*gcbatchend) (struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch);
-
-/* Blit states. */
-struct gcblit {
- /* Number of sources in the operation. */
- unsigned int srccount;
-
- /* Multi source enable flag. */
- unsigned int multisrc;
-
- /* Computed destination rectangle coordinates; in multi-source
- * setup can be modified to match new destination and source
- * geometry. */
- struct gcrect dstrect;
-
- /* Block walker enable. */
- int blockenable;
-
- /* Destination format and swizzle */
- unsigned int format;
- unsigned int swizzle;
-};
-
-/* Filter states. */
-struct gcfilter {
- /* Kernel size. */
- unsigned int horkernelsize;
- unsigned int verkernelsize;
-
- /* Scale factors. */
- unsigned int horscalefactor;
- unsigned int verscalefactor;
-
- /* Destination angle. */
- bool angleoverride;
- int dstangle;
-
- /* Geometry size that follows angle adjustments. */
- struct bvsurfgeom dstgeom;
-
- /* Original source and destination rectangles adjusted
- * by the source angle. */
- struct gcrect dstrect;
- struct gcrect dstrectaux;
-
- /* Clipped destination rectangle adjusted by the source angle. */
- struct gcrect dstclipped;
- struct gcrect dstclippedaux;
-
- /* Destination rectangles that were clipped, adjusted for
- * the surface misalignment and the source angle. */
- struct gcrect dstadjusted;
- struct gcrect dstadjustedaux;
-};
-
-/* Batch header. */
-struct gcbatch {
- /* Used to ID structure version. */
- unsigned int structsize;
-
- /* Batch change flags. */
- unsigned long batchflags;
-
- /* Pointer to the function to finalize the current operation. */
- gcbatchend batchend;
-
- /* State of the current operation. */
- struct {
- struct gcblit blit;
- struct gcfilter filter;
- } op;
-
- /* Destination surface. */
- struct surfaceinfo dstinfo;
-
- /* Aux rectangle present. */
- bool haveaux;
- struct gcrect dstrectaux;
-
- /* Clipped destination rectangle coordinates. */
- struct gcrect dstclipped;
- struct gcrect dstclippedaux;
-
- /* Destination rectangles that were clipped and adjusted for
- * surface misalignment if any. */
- struct gcrect dstadjusted;
- struct gcrect dstadjustedaux;
-
- /* Clipping deltas; used to correct the source coordinates for
- * single source blits. */
- struct gcrect clipdelta;
-
- /* Adjusted geometry size of the destination surface. */
- unsigned int dstwidth;
- unsigned int dstheight;
-
- /* Physical size of the source and destination surfaces. */
- unsigned int srcphyswidth;
- unsigned int srcphysheight;
- unsigned int dstphyswidth;
- unsigned int dstphysheight;
-
- /* Alignment byte offset for the destination surface; in multi-
- * source setup can be modified to match new destination and source
- * geometry. */
- int dstbyteshift;
-
- /* Destination rectangle adjustment offsets. */
- int dstoffsetX;
- int dstoffsetY;
-
-#if GCDEBUG_ENABLE
- /* Rectangle validation storage. */
- struct bvrect prevdstrect;
- struct bvrect prevsrc1rect;
- struct bvrect prevsrc2rect;
- struct bvrect prevmaskrect;
-#endif
-
- /* Total size of the command buffer. */
- unsigned int size;
-
- /* Command buffer list (gcbuffer). */
- struct list_head buffer;
-
- /* Scheduled implicit unmappings (gcschedunmap). */
- struct list_head unmap;
-
- /* Batch linked list (gcbatch). */
- struct list_head link;
-};
-
-
-/*******************************************************************************
- * Internal API entries.
- */
-
-/* Get the pointer to the context. */
-struct gccontext *get_context(void);
-
-/* Validation. */
-bool valid_rect(struct bvsurfgeom *bvsurfgeom, struct gcrect *gcrect);
-
-/* Parsers. */
-enum bverror parse_format(struct bvbltparams *bvbltparams,
- struct surfaceinfo *surfaceinfo);
-enum bverror parse_blend(struct bvbltparams *bvbltparams,
- enum bvblend blend,
- struct gcalpha *gca);
-enum bverror parse_destination(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch);
-enum bverror parse_source(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- struct bvrect *srcrect,
- struct surfaceinfo *srcinfo);
-enum bverror parse_scalemode(struct bvbltparams *bvbltparams,
- struct gcbatch *batch);
-
-/* Setup destination rotation parameters. */
-void process_dest_rotation(struct bvbltparams *bvbltparams,
- struct gcbatch *batch);
-
-/* Return surface alignment offset. */
-int get_pixel_offset(struct surfaceinfo *surfaceinfo, int offset);
-
-/* Buffer mapping. */
-enum bverror do_map(struct bvbuffdesc *bvbuffdesc,
- struct gcbatch *gcbatch,
- struct bvbuffmap **map);
-void do_unmap_implicit(struct gcbatch *gcbatch);
-
-/* Batch/command buffer management. */
-enum bverror do_end(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch);
-enum bverror allocate_batch(struct bvbltparams *bvbltparams,
- struct gcbatch **gcbatch);
-void free_batch(struct gcbatch *gcbatch);
-enum bverror append_buffer(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- struct gcbuffer **gcbuffer);
-
-enum bverror add_fixup(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- unsigned int *fixup,
- unsigned int surfoffset);
-enum bverror claim_buffer(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- unsigned int size,
- void **buffer);
-
-/* Temporary buffer management. */
-enum bverror allocate_temp(struct bvbltparams *bvbltparams,
- unsigned int size);
-enum bverror free_temp(bool schedule);
-
-/* Program the destination. */
-enum bverror set_dst(struct bvbltparams *bltparams,
- struct gcbatch *batch,
- struct bvbuffmap *dstmap);
-
-/* Program blending. */
-enum bverror set_blending(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo);
-enum bverror set_blending_index(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- unsigned int index);
-
-/* Program YUV source. */
-void set_computeyuv(struct surfaceinfo *srcinfo, int x, int y);
-enum bverror set_yuvsrc(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- struct bvbuffmap *srcmap);
-enum bverror set_yuvsrc_index(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- struct bvbuffmap *srcmap,
- unsigned int index);
-
-/* Rendering entry points. */
-enum bverror do_fill(struct bvbltparams *bltparams,
- struct gcbatch *gcbatch,
- struct surfaceinfo *srcinfo);
-enum bverror do_blit(struct bvbltparams *bltparams,
- struct gcbatch *gcbatch,
- struct surfaceinfo *srcinfo);
-enum bverror do_filter(struct bvbltparams *bvbltparams,
- struct gcbatch *gcbatch,
- struct surfaceinfo *srcinfo);
-
-#endif
diff --git a/bltsville/gcbv/mirror/gcdbglog.c b/bltsville/gcbv/mirror/gcdbglog.c
deleted file mode 100644
index 9743897..0000000
--- a/bltsville/gcbv/mirror/gcdbglog.c
+++ /dev/null
@@ -1,1684 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <gcx.h>
-#include "gcmain.h"
-
-#if ANDROID
-#include <cutils/log.h>
-#endif
-
-#if GCDEBUG_ENABLE
-
-/*******************************************************************************
- * Debug switches.
- */
-
-/* Dumping enable default state. */
-#define GC_DUMP_ENABLE 0
-
-/* Ignore all zones as if they were all enabled in all modules. */
-#define GC_IGNORE_ZONES 0
-
-/* When enabled, all output is collected into a buffer with a predefined size.
- * GC_DUMP_BUFFER_SIZE determines the size of the buffer and GC_ENABLE_OVERFLOW
- * controls what happens when the buffer gets full. */
-#define GC_BUFFERED_OUTPUT 0
-
-/* Debug output buffer size. */
-#define GC_DUMP_BUFFER_SIZE (200 * 1024)
-
-/* If disabled, the contents of the buffer will be dumped to the console when
- * the buffer gets full.
- * If enabled, wrap around mode is enabled where when the buffer gets full,
- * the oldest entries are overwritten with the new entrie. To dump the buffer
- * to the console gc_dump_flush must be called explicitly. */
-#define GC_ENABLE_OVERFLOW 1
-
-/* Specifies how many prints are accumulated in the buffer before the buffer is
- * flushed. Set to zero to disable auto dumping mode. */
-#define GC_FLUSH_COUNT 0
-
-/* Specifies the maximum number of threads that will be tracked in an attempt
- * to visually separate messages from different threads. To disable thread
- * tracking, set to 0 or 1. */
-#define GC_THREAD_COUNT 20
-
-/* Specifies spacing for thread messages. */
-#define GC_THREAD_INDENT 0
-
-/* When set to non-zero, specifies how many prints are accumulated in the
- * buffer before the buffer is flushed. */
-#define GC_SHOW_DUMP_LINE 1
-
-/* If enabled, each print statement will be preceeded with the current
- * process ID. */
-#define GC_SHOW_PID 1
-
-/* If enabled, internal logging validation code is turned on. */
-#define GC_DEBUG_SELF 0
-
-/* Maximum length of a dump string. */
-#define GC_MAXSTR_LENGTH 256
-
-/* Print buffers like C arrays. */
-#define GC_C_BUFFER 0
-
-
-/*******************************************************************************
- * Miscellaneous macros.
- */
-
-#define GC_PTR2INT(p) \
-( \
- (unsigned int) (p) \
-)
-
-#define GC_ALIGN(n, align) \
-( \
- ((n) + ((align) - 1)) & ~((align) - 1) \
-)
-
-#define GC_PTRALIGNMENT(p, alignment) \
-( \
- GC_ALIGN(GC_PTR2INT(p), alignment) - GC_PTR2INT(p) \
-)
-
-#define GC_VARARG_ALIGNMENT sizeof(unsigned long long)
-
-#if defined(GCDBGFILTER)
-#undef GCDBGFILTER
-#endif
-
-#define GCDBGFILTER \
- (*filter)
-
-#if GC_IGNORE_ZONES
-#define GC_VERIFY_ENABLE(filter, zone) \
- (g_initdone)
-#else
-#define GC_VERIFY_ENABLE(filter, zone) \
- (g_initdone && ((filter == NULL) || ((filter->zone & zone) != 0)))
-#endif
-
-#if GC_SHOW_DUMP_LINE
-#define GC_DUMPLINE_FORMAT "[%12d] "
-#endif
-
-#if GC_SHOW_PID
-#define GC_PID_FORMAT "[pid=%04X] "
-#endif
-
-#define GC_EOL_RESERVE 1
-
-
-/*******************************************************************************
- * Dump item header definition.
- */
-
-enum itemtype {
- GC_BUFITEM_NONE,
- GC_BUFITEM_STRING,
- GC_BUFITEM_BUFFER
-};
-
-/* Common item head/buffer terminator. */
-struct itemhead {
- enum itemtype type;
-};
-
-
-/*******************************************************************************
- * Supported dump items.
- */
-
-/* GC_BUFITEM_STRING: buffered string. */
-struct itemstring {
- enum itemtype itemtype;
- int indent;
-
-#if GC_SHOW_PID
- pid_t pid;
-#endif
-
-#if GC_SHOW_DUMP_LINE
- unsigned int dumpline;
-#endif
-
- const char *message;
- va_list messagedata;
- unsigned int datasize;
-};
-
-/* GC_BUFITEM_BUFFER: buffered memory. */
-enum buffertype {
- GC_BUFTYPE_GENERIC,
- GC_BUFTYPE_COMMAND,
- GC_BUFTYPE_SURFACE
-};
-
-#define GC_GENERIC_DATA_COUNT 8
-#define GC_SURFACE_DATA_COUNT 64
-
-struct itembuffer {
- enum itemtype itemtype;
- enum buffertype buffertype;
- int indent;
-
- unsigned int surfwidth;
- unsigned int surfheight;
- unsigned int surfbpp;
- unsigned int x1, y1;
- unsigned int x2, y2;
-
- unsigned int datasize;
- unsigned int gpuaddr;
-};
-
-
-/*******************************************************************************
- * Debug output buffer.
- */
-
-struct threadinfo {
- pid_t pid;
- int msgindent;
- int threadindent;
-};
-
-struct buffout {
- int enable;
-
-#if GC_THREAD_COUNT > 1
- unsigned int threadcount;
- struct threadinfo threadinfo[1 + GC_THREAD_COUNT];
-#else
- struct threadinfo threadinfo[1];
-#endif
-
-#if GC_SHOW_DUMP_LINE
- unsigned int dumpline;
-#endif
-
-#if GC_BUFFERED_OUTPUT
- int start;
- int index;
- int count;
- unsigned char *buffer;
-#endif
-};
-
-static struct buffout g_outputbuffer = {
- .enable = GC_DUMP_ENABLE
-};
-
-
-/*******************************************************************************
- * Globals.
- */
-
-static unsigned int g_initdone;
-static GCDEFINE_LOCK(g_lockmutex);
-static struct list_head gc_filterlist = LIST_HEAD_INIT(gc_filterlist);
-
-
-/*******************************************************************************
- * Item size functions.
- */
-
-#if GC_BUFFERED_OUTPUT
-static int get_item_size_terminator(struct itemhead *item)
-{
- return sizeof(struct itemhead);
-}
-
-static int get_item_size_string(struct itemhead *item)
-{
- struct itemstring *itemstring = (struct itemstring *) item;
- unsigned int vlen = *((unsigned char **) &itemstring->messagedata)
- - ((unsigned char *) itemstring);
- return vlen + itemstring->datasize;
-}
-
-static int get_item_size_buffer(struct itemhead *item)
-{
- struct itembuffer *itembuffer = (struct itembuffer *) item;
- return sizeof(struct itembuffer) + itembuffer->datasize;
-}
-
-#if GC_ENABLE_OVERFLOW
-typedef int (*getitemsize) (struct itemhead *item);
-
-static getitemsize g_itemsize[] = {
- get_item_size_terminator,
- get_item_size_string,
- get_item_size_buffer
-};
-#endif
-#endif
-
-
-/*******************************************************************************
- * Printing functions.
- */
-
-#if ANDROID
-#define GC_PRINTK(s, fmt, ...) \
- LOGI(fmt, ##__VA_ARGS__);
-#else
-#define GC_PRINTK(s, fmt, ...) \
- printf(fmt, ##__VA_ARGS__);
-#endif
-
-#if GC_DEBUG_SELF
-# define GC_DEBUGMSG(fmt, ...) \
- GC_PRINTK(NULL, "[%s:%d] " fmt, __func__, __LINE__, \
- ##__VA_ARGS__)
-#else
-# define GC_DEBUGMSG(...) {}
-#endif
-
-static struct threadinfo *get_threadinfo(struct buffout *buffout)
-{
-#if GC_THREAD_COUNT > 1
- struct threadinfo *threadinfo;
- unsigned int i, count;
- pid_t pid;
-
- /* Get current pid. */
- pid = gettid();
-
- /* Try to locate thread record. */
- count = buffout->threadcount + 1;
- for (i = 1; i < count; i += 1)
- if (buffout->threadinfo[i].pid == pid)
- return &buffout->threadinfo[i];
-
- /* Not found, still have room? */
- if (buffout->threadcount < GC_THREAD_COUNT) {
- threadinfo = &buffout->threadinfo[count];
- threadinfo->pid = pid;
- threadinfo->msgindent = 0;
- threadinfo->threadindent = buffout->threadcount
- * GC_THREAD_INDENT;
- buffout->threadcount += 1;
- return threadinfo;
- }
-
- /* Too many threads, use the common entry. */
- GC_PRINTK(NULL, "%s(%d) [ERROR] reached the maximum thread number.\n",
- __func__, __LINE__);
- threadinfo = buffout->threadinfo;
- threadinfo->pid = pid;
- return threadinfo;
-#else
- struct threadinfo *threadinfo;
- threadinfo = buffout->threadinfo;
-
-#if GC_SHOW_PID
- threadinfo->pid = pid;
-#else
- threadinfo->pid = 0;
-#endif
-
- return threadinfo;
-#endif
-}
-
-static int gc_get_indent(int indent, char *buffer, int buffersize)
-{
- static const int MAX_INDENT = 80;
- int len, _indent;
-
- _indent = indent % MAX_INDENT;
- if (_indent > buffersize)
- _indent = buffersize - 1;
-
- for (len = 0; len < _indent; len += 1)
- buffer[len] = ' ';
-
- buffer[len] = '\0';
- return len;
-}
-
-static void gc_print_string(struct seq_file *s, struct itemstring *str)
-{
- int len = 0;
- char buffer[GC_MAXSTR_LENGTH];
-
-#if GC_SHOW_DUMP_LINE
- len += snprintf(buffer + len, sizeof(buffer) - len - GC_EOL_RESERVE,
- GC_DUMPLINE_FORMAT, str->dumpline);
-#endif
-
-#if GC_SHOW_PID
- len += snprintf(buffer + len, sizeof(buffer) - len - GC_EOL_RESERVE,
- GC_PID_FORMAT, str->pid);
-#endif
-
- /* Append the indent string. */
- len += gc_get_indent(str->indent, buffer + len,
- sizeof(buffer) - len - GC_EOL_RESERVE);
-
- /* Format the string. */
- len += vsnprintf(buffer + len, sizeof(buffer) - len - GC_EOL_RESERVE,
- str->message, str->messagedata);
-
- /* Add end-of-line if missing. */
- if (buffer[len - 1] != '\n')
- buffer[len++] = '\n';
- buffer[len] = '\0';
-
- /* Print the string. */
- GC_PRINTK(s, "%s", buffer);
-}
-
-static void gc_print_generic(struct seq_file *s, struct itembuffer *item,
- unsigned char *data)
-{
- char buffer[GC_MAXSTR_LENGTH];
- unsigned int i, indent, len;
-
- /* Append the indent string. */
- indent = gc_get_indent(item->indent, buffer, sizeof(buffer));
-
- /* Print the title. */
- GC_PRINTK(s, "%sBUFFER @ 0x%08X\n",
- buffer, item->gpuaddr);
-
- /* Print the buffer. */
- for (i = 0, len = indent; i < item->datasize; i += 4) {
- if ((i % GC_GENERIC_DATA_COUNT) == 0) {
- if (i != 0) {
- /* Print the string. */
- GC_PRINTK(s, "%s\n", buffer);
-
- /* Reset the line. */
- len = indent;
- }
-
- len += snprintf(buffer + len, sizeof(buffer) - len,
- "0x%08X: ", item->gpuaddr + i);
- }
-
- /* Append the data value. */
- len += snprintf(buffer + len, sizeof(buffer) - len,
- " 0x%08X", *(unsigned int *) (data + i));
- }
-
- /* Print the last partial string. */
- if ((i % GC_SURFACE_DATA_COUNT) != 0)
- GC_PRINTK(s, "%s\n", buffer);
-}
-
-static char *gc_module_name(unsigned int index)
-{
- switch (index) {
- case GCREG_COMMAND_STALL_STALL_SOURCE_FRONT_END:
- return "FE";
-
- case GCREG_COMMAND_STALL_STALL_SOURCE_PIXEL_ENGINE:
- return "PE";
-
- case GCREG_COMMAND_STALL_STALL_SOURCE_DRAWING_ENGINE:
- return "DE";
-
- default:
- return "*INVALID*";
- }
-}
-
-static void gc_print_command(struct seq_file *s, struct itembuffer *item,
- unsigned char *data)
-{
- char buffer[GC_MAXSTR_LENGTH];
- unsigned int *data32;
- unsigned int i, j, datacount;
- unsigned int command, count, addr;
- unsigned int delay, src, dst;
- unsigned int x1, y1, x2, y2;
-
- /* Append the indent string. */
- gc_get_indent(item->indent, buffer, sizeof(buffer));
-
- /* Print the title. */
- GC_PRINTK(s, "%sCOMMAND BUFFER @ 0x%08X\n", buffer, item->gpuaddr);
- GC_PRINTK(s, "%s size = %d\n", buffer, item->datasize);
-
- datacount = (item->datasize + 3) / 4;
- data32 = (unsigned int *) data;
- for (i = 0; i < datacount;) {
-#if GC_C_BUFFER
- GC_PRINTK(s, "%s\t0x%08X,\n", buffer, data32[i++]);
-#else
- command = (data32[i] >> 27) & 0x1F;
-
- switch (command) {
- case GCREG_COMMAND_OPCODE_LOAD_STATE:
- count = (data32[i] >> 16) & 0x3F;
- addr = data32[i] & 0xFFFF;
- GC_PRINTK(s, "%s 0x%08X: 0x%08X STATE(0x%04X, %d)\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i], addr, count);
- i += 1;
-
- count |= 1;
- for (j = 0; j < count; i += 1, j += 1)
- GC_PRINTK(s, "%s%14c0x%08X\n",
- buffer, ' ', data32[i]);
- break;
-
- case GCREG_COMMAND_OPCODE_END:
- GC_PRINTK(s, "%s 0x%08X: 0x%08X END()\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i]);
- i += 1;
-
- GC_PRINTK(s, "%s%14c0x%08X\n",
- buffer, ' ', data32[i]);
- i += 1;
- break;
-
- case GCREG_COMMAND_OPCODE_NOP:
- GC_PRINTK(s, "%s 0x%08X: 0x%08X NOP()\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i]);
- i += 1;
-
- GC_PRINTK(s, "%s" "%14c0x%08X\n",
- buffer, ' ', data32[i]);
- i += 1;
- break;
-
- case GCREG_COMMAND_OPCODE_STARTDE:
- count = (data32[i] >> 8) & 0xFF;
- GC_PRINTK(s, "%s 0x%08X: 0x%08X STARTDE(%d)\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i], count);
- i += 1;
-
- GC_PRINTK(s, "%s" "%14c0x%08X\n",
- buffer, ' ', data32[i]);
- i += 1;
-
- for (j = 0; j < count; j += 1) {
- x1 = data32[i] & 0xFFFF;
- y1 = (data32[i] >> 16) & 0xFFFF;
- GC_PRINTK(s, "%s%14c0x%08X LT(%d,%d)\n",
- buffer, ' ', data32[i], x1, y1);
- i += 1;
-
- x2 = data32[i] & 0xFFFF;
- y2 = (data32[i] >> 16) & 0xFFFF;
- GC_PRINTK(s, "%s%14c0x%08X RB(%d,%d)\n",
- buffer, ' ', data32[i], x2, y2);
- i += 1;
- }
- break;
-
- case GCREG_COMMAND_OPCODE_WAIT:
- delay = data32[i] & 0xFFFF;
- GC_PRINTK(s, "%s 0x%08X: 0x%08X WAIT(%d)\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i], delay);
- i += 1;
-
- GC_PRINTK(s, "%s%14c0x%08X\n", buffer, ' ', data32[i]);
- i += 1;
- break;
-
- case GCREG_COMMAND_OPCODE_LINK:
- count = data32[i] & 0xFFFF;
- addr = data32[i + 1];
- GC_PRINTK(s, "%s 0x%08X: 0x%08X "
- "LINK(0x%08X-0x%08X, %d)\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i], addr, addr + count * 8,
- count);
- i += 1;
-
- GC_PRINTK(s, "%s%14c0x%08X\n", buffer, ' ', data32[i]);
- i += 1;
- break;
-
- case GCREG_COMMAND_OPCODE_STALL:
- src = data32[i + 1] & 0x1F;
- dst = (data32[i + 1] >> 8) & 0x1F;
-
- GC_PRINTK(s, "%s 0x%08X: 0x%08X STALL(%s-%s)\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i],
- gc_module_name(src),
- gc_module_name(dst));
- i += 1;
-
- GC_PRINTK(s, "%s" "%14c0x%08X\n",
- buffer, ' ', data32[i]);
- i += 1;
- break;
-
- default:
- GC_PRINTK(s, "%s 0x%08X: 0x%08X UNKNOWN COMMAND\n",
- buffer, item->gpuaddr + (i << 2),
- data32[i]);
- i += 2;
- }
-#endif
- }
-}
-
-static void gc_flush_line(struct seq_file *s, char *buffer,
- unsigned int indent, unsigned int *len,
- unsigned int count, unsigned char checksum)
-{
- unsigned int _len;
- char countstr[10];
-
- /* Correct data count. */
- count %= GC_SURFACE_DATA_COUNT;
- if (count == 0)
- count = GC_SURFACE_DATA_COUNT;
-
- snprintf(countstr, sizeof(countstr), "%02X", count);
- buffer[indent + 1] = countstr[0];
- buffer[indent + 2] = countstr[1];
-
- /* Append the checksum. */
- _len = *len;
- _len += snprintf(buffer + _len, sizeof(buffer) - _len,
- "%02X", checksum);
-
- /* Print the string. */
- GC_PRINTK(s, "%s\n", buffer);
-
- /* Reset the length. */
- *len = indent;
-}
-
-static void gc_print_surface(struct seq_file *s, struct itembuffer *itembuffer,
- unsigned char *data)
-{
- char buffer[GC_MAXSTR_LENGTH];
- unsigned int i, indent, len;
- unsigned int prevupper32 = ~0U;
- unsigned int currupper32;
- unsigned int offset, address;
- unsigned int width, height;
-
- /* Append the indent string. */
- indent = gc_get_indent(itembuffer->indent, buffer, sizeof(buffer));
-
- /* Print the title. */
- GC_PRINTK(s, "%sIMAGE SURFACE @ 0x%08X\n",
- buffer, itembuffer->gpuaddr);
-
- GC_PRINTK(s, "%s surface size = %dx%d\n",
- buffer, itembuffer->surfwidth, itembuffer->surfheight);
-
- GC_PRINTK(s, "%s surface colordepth = %d\n",
- buffer, itembuffer->surfbpp);
-
- GC_PRINTK(s, "%s dumping rectangle = (%d,%d)-(%d,%d)\n",
- buffer, itembuffer->x1, itembuffer->y1,
- itembuffer->x2, itembuffer->y2);
-
- /* Add TGA header. */
- width = itembuffer->x2 - itembuffer->x1;
- height = itembuffer->y2 - itembuffer->y1;
- GC_PRINTK(s, ":12000000000002000000000000000000"
- "%02X%02X%02X%02X%02X2000\n",
- (width & 0xFF), ((width >> 8) & 0xFF),
- (height & 0xFF), ((height >> 8) & 0xFF),
- itembuffer->surfbpp * 8);
-
- /* TGA skip header. */
- offset = 18;
-
- /* Print the buffer. */
- for (i = 0, len = indent; i < itembuffer->datasize; i += 1) {
- /* Determine the current address. */
- address = offset + i;
-
- /* Determine the current higher 16 bits of the address. */
- currupper32 = address >> 16;
-
- /* Did it change? */
- if (currupper32 != prevupper32) {
- /* Print the previous data if any. */
- if ((i % GC_SURFACE_DATA_COUNT) != 0)
- gc_flush_line(s, buffer, indent, &len, i, 0);
-
- /* Set new upper address. */
- prevupper32 = currupper32;
- GC_PRINTK(s, ":02000004%04X00\n", prevupper32);
-
- /* Add the line prefix. */
- len += snprintf(buffer + len,
- sizeof(buffer) - len - 2,
- ":xx%04X00", address & 0xFFFF);
- } else if ((i % GC_SURFACE_DATA_COUNT) == 0) {
- len += snprintf(buffer + len,
- sizeof(buffer) - len - 2,
- ":xx%04X00", address & 0xFFFF);
- }
-
- /* Append the data value. */
- len += snprintf(buffer + len,
- sizeof(buffer) - len - 2,
- "%02X", data[i]);
-
- /* End of line? */
- if (((i + 1) % GC_SURFACE_DATA_COUNT) == 0)
- gc_flush_line(s, buffer, indent, &len, i + 1, 0);
- }
-
- /* Print the last partial string. */
- if ((i % GC_SURFACE_DATA_COUNT) != 0)
- gc_flush_line(s, buffer, indent, &len, i, 0);
-
- /* End of dump. */
- GC_PRINTK(s, ":00000001FF\n");
-}
-
-typedef void (*printbuffer) (struct seq_file *s, struct itembuffer *itembuffer,
- unsigned char *data);
-
-static printbuffer g_printbuffer[] = {
- gc_print_generic,
- gc_print_command,
- gc_print_surface
-};
-
-static void gc_print_buffer(struct seq_file *s, struct itembuffer *itembuffer,
- unsigned char *data)
-{
- if (((int) itembuffer->buffertype < 0) ||
- (itembuffer->buffertype >= countof(g_printbuffer))) {
- GC_PRINTK(s, "BUFFER ENTRY 0x%08X\n",
- (unsigned int) itembuffer);
- GC_PRINTK(s, "INVALID BUFFER TYPE %d\n",
- itembuffer->buffertype);
- } else {
- g_printbuffer[itembuffer->buffertype](s, itembuffer, data);
- }
-}
-
-
-/*******************************************************************************
- * Print function wrappers.
- */
-
-#if GC_BUFFERED_OUTPUT
-static unsigned int gc_print_none(struct seq_file *s, struct buffout *buffout,
- struct itemhead *item)
-{
- /* Return the size of the node. */
- return get_item_size_terminator(item);
-}
-
-static unsigned int gc_print_string_wrapper(struct seq_file *s,
- struct buffout *buffout,
- struct itemhead *item)
-{
- /* Print the message. */
- gc_print_string(s, (struct itemstring *) item);
-
- /* Return the size of the node. */
- return get_item_size_string(item);
-}
-
-static unsigned int gc_print_buffer_wrapper(struct seq_file *s,
- struct buffout *buffout,
- struct itemhead *item)
-{
- unsigned char *data;
- struct itembuffer *itembuffer = (struct itembuffer *) item;
-
- /* Compute data address. */
- data = (unsigned char *) (itembuffer + 1);
-
- /* Print the message. */
- gc_print_buffer(s, (struct itembuffer *) item, data);
-
- /* Return the size of the node. */
- return get_item_size_buffer(item);
-}
-
-typedef unsigned int (*printitem) (struct seq_file *s, struct buffout *buffout,
- struct itemhead *item);
-
-static printitem g_printarray[] = {
- gc_print_none,
- gc_print_string_wrapper,
- gc_print_buffer_wrapper
-};
-#endif
-
-
-/*******************************************************************************
- * Private functions.
- */
-
-unsigned int gc_get_bpp(unsigned int format)
-{
- unsigned int bpp;
-
- switch (format) {
- case GCREG_DE_FORMAT_INDEX8:
- case GCREG_DE_FORMAT_A8:
- bpp = 1;
- break;
-
- case GCREG_DE_FORMAT_X4R4G4B4:
- case GCREG_DE_FORMAT_A4R4G4B4:
- case GCREG_DE_FORMAT_X1R5G5B5:
- case GCREG_DE_FORMAT_A1R5G5B5:
- case GCREG_DE_FORMAT_R5G6B5:
- case GCREG_DE_FORMAT_YUY2:
- case GCREG_DE_FORMAT_UYVY:
- case GCREG_DE_FORMAT_RG16:
- bpp = 2;
- break;
-
- case GCREG_DE_FORMAT_X8R8G8B8:
- case GCREG_DE_FORMAT_A8R8G8B8:
- bpp = 4;
- break;
-
- default:
- bpp = 0;
- }
-
- return bpp;
-}
-
-#if GC_BUFFERED_OUTPUT
-static void gc_buffer_flush(struct seq_file *s, struct buffout *buffout)
-{
- int i, skip;
- struct itemhead *item;
-
- if (buffout->count == 0)
- return;
-
- GC_PRINTK(s, "****************************************"
- "****************************************\n");
- GC_PRINTK(s, "FLUSHING DEBUG OUTPUT BUFFER (%d elements).\n",
- buffout->count);
-
-#if !GC_ENABLE_OVERFLOW
- {
- int occupied = (100 * (buffout->index - buffout->start))
- / GC_DUMP_BUFFER_SIZE;
- if (buffout->start != 0)
- GC_PRINTK(s, " START = %d\n", buffout->start);
- GC_PRINTK(s, " INDEX = %d\n", buffout->index);
- GC_PRINTK(s, " BUFFER USE = %d%%\n", occupied);
- }
-#endif
-
- GC_PRINTK(s, "****************************************"
- "****************************************\n");
-
- item = (struct itemhead *) &buffout->buffer[buffout->start];
- GC_DEBUGMSG("start=%d.\n", buffout->start);
-
- for (i = 0; i < buffout->count; i += 1) {
- GC_DEBUGMSG("printing item %d of type %d @ 0x%08X.\n",
- i, item->type, (unsigned int) item);
- skip = (*g_printarray[item->type]) (s, buffout, item);
-
- item = (struct itemhead *) ((unsigned char *) item + skip);
- GC_DEBUGMSG("next item @ 0x%08X.\n", (unsigned int) item);
-
- if (item->type == GC_BUFITEM_NONE) {
- GC_DEBUGMSG("reached the end of buffer.\n");
- item = (struct itemhead *) buffout->buffer;
- }
- }
-
- GC_DEBUGMSG("resetting the buffer.\n");
- buffout->start = 0;
- buffout->index = 0;
- buffout->count = 0;
-}
-
-static struct itemhead *gc_allocate_item(struct buffout *buffout, int size)
-{
- struct itemhead *item, *next;
- int endofbuffer = (buffout->index + size
- >= GC_DUMP_BUFFER_SIZE - sizeof(struct itemhead));
-
-#if GC_ENABLE_OVERFLOW
- int skip, bufferoverflow;
-
- bufferoverflow = (buffout->index < buffout->start) &&
- (buffout->index + size >= buffout->start);
-
- if (endofbuffer || bufferoverflow) {
- if (endofbuffer) {
- if (buffout->index < buffout->start) {
- item = (struct itemhead *)
- &buffout->buffer[buffout->start];
-
- while (item->type != GC_BUFITEM_NONE) {
- skip = (*g_itemsize[item->type]) (item);
-
- buffout->start += skip;
- buffout->count -= 1;
-
- item->type = GC_BUFITEM_NONE;
- item = (struct itemhead *)
- ((unsigned char *) item + skip);
- }
-
- buffout->start = 0;
- }
-
- buffout->index = 0;
- }
-
- item = (struct itemhead *) &buffout->buffer[buffout->start];
-
- while (buffout->start - buffout->index <= size) {
- skip = (*g_itemsize[item->type]) (item);
-
- buffout->start += skip;
- buffout->count -= 1;
-
- item->type = GC_BUFITEM_NONE;
- item = (struct itemhead *)
- ((unsigned char *) item + skip);
-
- if (item->type == GC_BUFITEM_NONE) {
- buffout->start = 0;
- break;
- }
- }
- }
-#else
- if (endofbuffer) {
- GC_PRINTK(NULL, "message buffer full; "
- "forcing message flush.\n\n");
- gc_buffer_flush(NULL, buffout);
- }
-#endif
-
- item = (struct itemhead *) &buffout->buffer[buffout->index];
-
- buffout->index += size;
- buffout->count += 1;
-
- next = (struct itemhead *) ((unsigned char *) item + size);
- next->type = GC_BUFITEM_NONE;
-
- return item;
-}
-
-static void gc_append_string(struct buffout *buffout,
- struct itemstring *itemstring)
-{
- unsigned char *messagedata;
- struct itemstring *item;
- unsigned int alignment;
- int size, freesize;
- int allocsize;
-
- /* Determine the maximum item size. */
- allocsize = sizeof(struct itemstring) + itemstring->datasize
- + GC_VARARG_ALIGNMENT;
-
- /* Allocate the item. */
- item = (struct itemstring *) gc_allocate_item(buffout, allocsize);
- GC_DEBUGMSG("allocated %d bytes @ 0x%08X.\n",
- allocsize, (unsigned int) item);
-
- /* Compute the initial message data pointer. */
- messagedata = (unsigned char *) (item + 1);
-
- /* Align the data pointer as necessary. */
- alignment = GC_PTRALIGNMENT(messagedata, GC_VARARG_ALIGNMENT);
- messagedata += alignment;
- GC_DEBUGMSG("messagedata @ 0x%08X.\n", (unsigned int) messagedata);
-
- /* Set item data. */
- item->itemtype = GC_BUFITEM_STRING;
- item->indent = itemstring->indent;
- item->message = itemstring->message;
- item->messagedata = *(va_list *) &messagedata;
- item->datasize = itemstring->datasize;
-
-#if GC_SHOW_PID
- item->pid = itemstring->pid;
-#endif
-
-#if GC_SHOW_DUMP_LINE
- item->dumpline = itemstring->dumpline;
-#endif
-
- /* Copy argument value. */
- if (itemstring->datasize != 0) {
- GC_DEBUGMSG("copying %d bytes of messagedata.\n",
- itemstring->datasize);
- memcpy(messagedata,
- *(unsigned char **) &itemstring->messagedata,
- itemstring->datasize);
- }
-
- /* Compute the actual node size. */
- size = sizeof(struct itemstring) + itemstring->datasize + alignment;
- GC_DEBUGMSG("adjusted item size=%d.\n", size);
-
- /* Free extra memory if any. */
- freesize = allocsize - size;
- GC_DEBUGMSG("freesize=%d.\n", freesize);
-
- if (freesize != 0) {
- struct itemhead *next;
- buffout->index -= freesize;
- next = (struct itemhead *) ((unsigned char *) item + size);
- next->type = GC_BUFITEM_NONE;
- }
-
-#if GC_BUFFERED_OUTPUT && GC_FLUSH_COUNT
- if (buffout->count >= GC_FLUSH_COUNT) {
- GC_PRINTK(NULL, "reached %d message count; "
- "forcing message flush.\n\n", buffout->count);
- gc_buffer_flush(NULL, buffout);
- }
-#endif
-}
-
-static void gc_append_buffer(struct buffout *buffout,
- struct itembuffer *itembuffer,
- unsigned int *data)
-{
- struct itembuffer *item;
- int allocsize;
-
- /* Determine the item size. */
- allocsize = sizeof(struct itembuffer) + itembuffer->datasize;
-
- /* Allocate the item. */
- item = (struct itembuffer *) gc_allocate_item(buffout, allocsize);
- GC_DEBUGMSG("allocated %d bytes @ 0x%08X.\n",
- allocsize, (unsigned int) item);
-
- /* Set item data. */
- *item = *itembuffer;
-
- /* Copy data. */
- memcpy(item + 1, data, itembuffer->datasize);
-
-#if GC_BUFFERED_OUTPUT && GC_FLUSH_COUNT
- if (buffout->count >= GC_FLUSH_COUNT) {
- GC_PRINTK(NULL, "reached %d message count; "
- "forcing message flush.\n\n", buffout->count);
- gc_buffer_flush(NULL, buffout);
- }
-#endif
-}
-#endif
-
-static void gc_print(struct buffout *buffout, unsigned int argsize,
- const char *message, va_list args)
-{
- struct itemstring itemstring;
- struct threadinfo *threadinfo;
-
- GCLOCK(&g_lockmutex);
-
- /* Locate thead entry. */
- threadinfo = get_threadinfo(buffout);
-
- /* Form the indent string. */
- if (strncmp(message, "--", 2) == 0)
- threadinfo->msgindent -= 2;
-
- /* Fill in the sructure. */
- itemstring.itemtype = GC_BUFITEM_STRING;
- itemstring.indent = threadinfo->msgindent
- + threadinfo->threadindent;
- itemstring.message = message;
- itemstring.messagedata = args;
- itemstring.datasize = argsize;
-
-#if GC_SHOW_PID
- itemstring.pid = threadinfo->pid;
-#endif
-
-#if GC_SHOW_DUMP_LINE
- itemstring.dumpline = ++buffout->dumpline;
-#endif
-
- /* Print the message. */
-#if GC_BUFFERED_OUTPUT
- gc_append_string(buffout, &itemstring);
-#else
- gc_print_string(NULL, &itemstring);
-#endif
-
- /* Check increasing indent. */
- if (strncmp(message, "++", 2) == 0)
- threadinfo->msgindent += 2;
-
- GCUNLOCK(&g_lockmutex);
-}
-
-
-/*******************************************************************************
- * Dumping functions.
- */
-
-void gc_dump_string(struct gcdbgfilter *filter, unsigned int zone,
- const char *message, ...)
-{
- va_list args;
- unsigned int i, count, argsize;
-
- if (!g_outputbuffer.enable)
- return;
-
- if (message == NULL)
- GC_DEBUGMSG("message is NULL.\n");
-
- if (GC_VERIFY_ENABLE(filter, zone)) {
- for (i = 0, count = 0; message[i]; i += 1)
- if (message[i] == '%')
- count += 1;
-
- argsize = count * sizeof(unsigned int);
- GC_DEBUGMSG("argsize=%d.\n", argsize);
-
- va_start(args, message);
- gc_print(&g_outputbuffer, argsize, message, args);
- va_end(args);
- }
-}
-EXPORT_SYMBOL(gc_dump_string);
-
-void gc_dump_string_sized(struct gcdbgfilter *filter, unsigned int zone,
- unsigned int argsize, const char *message, ...)
-{
- va_list args;
-
- if (!g_outputbuffer.enable)
- return;
-
- if (GC_VERIFY_ENABLE(filter, zone)) {
- va_start(args, message);
- gc_print(&g_outputbuffer, argsize, message, args);
- va_end(args);
- }
-}
-EXPORT_SYMBOL(gc_dump_string_sized);
-
-void gc_dump_cmd_buffer(struct gcdbgfilter *filter, unsigned int zone,
- void *ptr, unsigned int gpuaddr, unsigned int datasize)
-{
- struct itembuffer itembuffer;
- struct threadinfo *threadinfo;
-
- if (!g_outputbuffer.enable)
- return;
-
- if (GC_VERIFY_ENABLE(filter, zone)) {
- GCLOCK(&g_lockmutex);
-
- /* Locate thead entry. */
- threadinfo = get_threadinfo(&g_outputbuffer);
-
- /* Fill in the sructure. */
- itembuffer.itemtype = GC_BUFITEM_BUFFER;
- itembuffer.buffertype = GC_BUFTYPE_COMMAND;
- itembuffer.indent = threadinfo->msgindent
- + threadinfo->threadindent;
- itembuffer.datasize = datasize;
- itembuffer.gpuaddr = gpuaddr;
-
- /* Print the message. */
-#if GC_BUFFERED_OUTPUT
- gc_append_buffer(NULL, &g_outputbuffer, &itembuffer,
- (unsigned int *) ptr);
-#else
- gc_print_buffer(NULL, &itembuffer,
- (unsigned char *) ptr);
-#endif
-
- GCUNLOCK(&g_lockmutex);
- }
-}
-EXPORT_SYMBOL(gc_dump_cmd_buffer);
-
-void gc_dump_buffer(struct gcdbgfilter *filter, unsigned int zone,
- void *ptr, unsigned int gpuaddr,
- unsigned int datasize)
-{
- struct itembuffer itembuffer;
- struct threadinfo *threadinfo;
-
- if (!g_outputbuffer.enable)
- return;
-
- if (GC_VERIFY_ENABLE(filter, zone)) {
- GCLOCK(&g_lockmutex);
-
- /* Locate thead entry. */
- threadinfo = get_threadinfo(&g_outputbuffer);
-
- /* Fill in the sructure. */
- itembuffer.itemtype = GC_BUFITEM_BUFFER;
- itembuffer.buffertype = GC_BUFTYPE_GENERIC;
- itembuffer.indent = threadinfo->msgindent
- + threadinfo->threadindent;
- itembuffer.datasize = datasize;
- itembuffer.gpuaddr = gpuaddr;
-
- /* Print the message. */
-#if GC_BUFFERED_OUTPUT
- gc_append_buffer(NULL, &g_outputbuffer, &itembuffer,
- (unsigned int *) ptr);
-#else
- gc_print_buffer(NULL, &itembuffer,
- (unsigned char *) ptr);
-#endif
-
- GCUNLOCK(&g_lockmutex);
- }
-}
-EXPORT_SYMBOL(gc_dump_buffer);
-
-
-/*******************************************************************************
- * Dumping control functions.
- */
-
-void gc_dump_enable(void)
-{
- GCLOCK(&g_lockmutex);
-
- g_outputbuffer.enable = 1;
- GC_PRINTK(NULL, "gcx dumping is enabled.\n");
-
- GCUNLOCK(&g_lockmutex);
-}
-EXPORT_SYMBOL(gc_dump_enable);
-
-void gc_dump_disable(void)
-{
- GCLOCK(&g_lockmutex);
-
- g_outputbuffer.enable = 0;
- GC_PRINTK(NULL, "gcx dumping is disabled.\n");
-
- GCUNLOCK(&g_lockmutex);
-}
-EXPORT_SYMBOL(gc_dump_disable);
-
-void gc_dump_show_enabled(struct seq_file *s)
-{
- struct list_head *filterhead;
- struct gcdbgfilter *filter;
- unsigned int i, zone;
-
- GCLOCK(&g_lockmutex);
-
- GC_PRINTK(s, "gcx logging is %s\n", g_outputbuffer.enable
- ? "enabled" : "disabled");
-
- list_for_each(filterhead, &gc_filterlist) {
- filter = list_entry(filterhead, struct gcdbgfilter,
- link);
-
- GC_PRINTK(s, "gcx filter '%s':\n", filter->filtername);
- GC_PRINTK(s, " zone mask = 0x%08X%s\n", filter->zone,
- (filter->zone == 0)
- ? " (all disabled)" : "");
-
- for (i = 0; filter->zonename[i] != NULL; i++) {
- zone = 1 << i;
- GC_PRINTK(s, " 0x%08X: %10s%s\n",
- zone, filter->zonename[i],
- ((filter->zone & zone) != 0)
- ? " (enabled)" : "");
- }
- }
-
- GCUNLOCK(&g_lockmutex);
-}
-EXPORT_SYMBOL(gc_dump_show_enabled);
-
-void gc_dump_filter_enable(const char *filtername, int zone)
-{
- struct list_head *filterhead;
- struct gcdbgfilter *filter;
- unsigned int filterfound = 0;
- unsigned int havesetzones = 0;
-
- GCLOCK(&g_lockmutex);
-
- GC_PRINTK(NULL, "modifying zone mask for filter %s:\n", filtername);
-
- list_for_each(filterhead, &gc_filterlist) {
- filter = list_entry(filterhead, struct gcdbgfilter,
- link);
-
- if (strcasecmp(filtername, filter->filtername) == 0) {
- GC_PRINTK(NULL, " 0x%08X --> 0x%08X\n",
- filter->zone, zone);
- filter->zone = zone;
- filterfound = 1;
- }
-
- if (filter->zone != 0)
- havesetzones = 1;
- }
-
- GCUNLOCK(&g_lockmutex);
-
- if (!filterfound)
- GC_PRINTK(NULL, " couldn't find filter %s.\n", filtername);
-
- if (havesetzones && !g_outputbuffer.enable)
- gc_dump_enable();
- else if (!havesetzones && g_outputbuffer.enable)
- gc_dump_disable();
-}
-EXPORT_SYMBOL(gc_dump_filter_enable);
-
-void gc_dbg_add_client(struct gcdbgfilter *filter)
-{
- list_add(&filter->link, &gc_filterlist);
-}
-EXPORT_SYMBOL(gc_dbg_add_client);
-
-void gc_dump_flush(struct seq_file *s)
-{
-#if GC_BUFFERED_OUTPUT
- GCLOCK(&g_lockmutex);
-
- /*
- * Not dumping through debugfs for now because we have
- * too much data and it'd require us to implement the
- * seq_file iterator interface.
- */
- gc_buffer_flush(NULL, &g_outputbuffer);
-
- GCUNLOCK(&g_lockmutex);
-#endif
-}
-EXPORT_SYMBOL(gc_dump_flush);
-
-void gc_dump_reset(void)
-{
-#if GC_BUFFERED_OUTPUT
- GCLOCK(&g_lockmutex);
-
- g_outputbuffer.start = 0;
- g_outputbuffer.index = 0;
- g_outputbuffer.count = 0;
-
- GC_PRINTK(NULL, "gcx logging buffer is reset.\n");
-
- GCUNLOCK(&g_lockmutex);
-#endif
-}
-EXPORT_SYMBOL(gc_dump_reset);
-
-
-/*******************************************************************************
- * Command buffer parser.
- */
-
-int gc_parse_command_buffer(unsigned int *buffer, unsigned int size,
- struct gccommandinfo *info)
-{
- int res;
- unsigned int i, j, itemcount, index, oldsrc;
- unsigned int command, count, addr;
-
- memset(info, 0, sizeof(struct gccommandinfo));
- info->command = ~0U;
-
- oldsrc = 0;
-
- itemcount = (size + 3) / 4;
- for (i = 0; i < itemcount;) {
- command = (buffer[i] >> 27) & 0x1F;
-
- switch (command) {
- case GCREG_COMMAND_OPCODE_LOAD_STATE:
- count = (buffer[i] >> 16) & 0x3F;
- addr = buffer[i] & 0xFFFF;
- i += 1;
-
- for (j = 0; j < count; j += 1) {
- switch (addr) {
- case gcregDestAddressRegAddrs:
- info->dst.surf.address = buffer[i];
- break;
-
- case gcregDestStrideRegAddrs:
- info->dst.surf.stride = buffer[i];
- break;
-
- case gcregDestRotationConfigRegAddrs:
- info->dst.surf.width
- = buffer[i] & 0xFFFF;
- break;
-
- case gcregDstRotationHeightRegAddrs:
- info->dst.surf.height
- = buffer[i] & 0xFFFF;
- break;
-
- case gcregDestConfigRegAddrs:
- info->command
- = (buffer[i] >> 12) & 0xF;
-
- info->dst.surf.swizzle
- = (buffer[i] >> 16) & 0x3;
-
- info->dst.surf.format
- = buffer[i] & 0x1F;
-
- info->dst.surf.bpp = gc_get_bpp(
- info->dst.surf.format);
- break;
-
- case gcregSrcAddressRegAddrs:
- info->src[0].surf.address = buffer[i];
- oldsrc = 1;
- break;
-
- case gcregSrcStrideRegAddrs:
- info->src[0].surf.stride = buffer[i];
- break;
-
- case gcregSrcRotationConfigRegAddrs:
- info->src[0].surf.width
- = buffer[i] & 0xFFFF;
- break;
-
- case gcregSrcRotationHeightRegAddrs:
- info->src[0].surf.height
- = buffer[i] & 0xFFFF;
- break;
-
- case gcregSrcConfigRegAddrs:
- info->src[0].surf.swizzle
- = (buffer[i] >> 20) & 0x3;
-
- info->src[0].surf.format
- = (buffer[i] >> 24) & 0x1F;
-
- info->src[0].surf.bpp = gc_get_bpp(
- info->src[0].surf.format);
- break;
-
- case gcregSrcOriginRegAddrs:
- info->src[0].rect.left
- = buffer[i] & 0xFFFF;
-
- info->src[0].rect.top
- = (buffer[i] >> 16) & 0xFFFF;
- break;
-
- case gcregSrcSizeRegAddrs:
- info->src[0].rect.right
- = buffer[i] & 0xFFFF;
-
- info->src[0].rect.bottom
- = (buffer[i] >> 16) & 0xFFFF;
- break;
-
- case gcregBlock4SrcAddressRegAddrs:
- case gcregBlock4SrcAddressRegAddrs + 1:
- case gcregBlock4SrcAddressRegAddrs + 2:
- case gcregBlock4SrcAddressRegAddrs + 3:
- index = addr & 3;
- info->src[index].surf.address
- = buffer[i];
- break;
-
- case gcregBlock4SrcStrideRegAddrs:
- case gcregBlock4SrcStrideRegAddrs + 1:
- case gcregBlock4SrcStrideRegAddrs + 2:
- case gcregBlock4SrcStrideRegAddrs + 3:
- index = addr & 3;
- info->src[index].surf.stride
- = buffer[i];
- break;
-
- case gcregBlock4SrcRotationConfigRegAddrs:
- case gcregBlock4SrcRotationConfigRegAddrs + 1:
- case gcregBlock4SrcRotationConfigRegAddrs + 2:
- case gcregBlock4SrcRotationConfigRegAddrs + 3:
- index = addr & 3;
- info->src[index].surf.width
- = buffer[i] & 0xFFFF;
- break;
-
- case gcregBlock4SrcRotationHeightRegAddrs:
- case gcregBlock4SrcRotationHeightRegAddrs + 1:
- case gcregBlock4SrcRotationHeightRegAddrs + 2:
- case gcregBlock4SrcRotationHeightRegAddrs + 3:
- index = addr & 3;
- info->src[0].surf.height
- = buffer[i] & 0xFFFF;
- break;
-
- case gcregBlock4SrcConfigRegAddrs:
- case gcregBlock4SrcConfigRegAddrs + 1:
- case gcregBlock4SrcConfigRegAddrs + 2:
- case gcregBlock4SrcConfigRegAddrs + 3:
- index = addr & 3;
- info->src[index].surf.swizzle
- = (buffer[i] >> 20) & 0x3;
-
- info->src[index].surf.format
- = (buffer[i] >> 24) & 0x1F;
-
- info->src[index].surf.bpp = gc_get_bpp(
- info->src[index].surf.format);
- break;
-
- case gcregBlock4SrcOriginRegAddrs:
- case gcregBlock4SrcOriginRegAddrs + 1:
- case gcregBlock4SrcOriginRegAddrs + 2:
- case gcregBlock4SrcOriginRegAddrs + 3:
- index = addr & 3;
- info->src[index].rect.left
- = buffer[i] & 0xFFFF;
-
- info->src[index].rect.top
- = (buffer[i] >> 16) & 0xFFFF;
- break;
-
- case gcregBlock4SrcSizeRegAddrs:
- case gcregBlock4SrcSizeRegAddrs + 1:
- case gcregBlock4SrcSizeRegAddrs + 2:
- case gcregBlock4SrcSizeRegAddrs + 3:
- index = addr & 3;
- info->src[index].rect.right
- = buffer[i] & 0xFFFF;
-
- info->src[index].rect.bottom
- = (buffer[i] >> 16) & 0xFFFF;
- break;
-
- case gcregDEMultiSourceRegAddrs:
- info->srccount = (buffer[i] & 0x7) + 1;
- break;
- }
-
- addr += 1;
- i += 1;
- }
-
- i += ((~count) & 1);
- break;
-
- case GCREG_COMMAND_OPCODE_END:
- case GCREG_COMMAND_OPCODE_NOP:
- case GCREG_COMMAND_OPCODE_WAIT:
- case GCREG_COMMAND_OPCODE_LINK:
- case GCREG_COMMAND_OPCODE_STALL:
- i += 2;
- break;
-
- case GCREG_COMMAND_OPCODE_STARTDE:
- info->dst.rectcount = (buffer[i] >> 8) & 0xFF;
- i += 2;
-
- for (j = 0; j < info->dst.rectcount; j += 1) {
- info->dst.rect[j].left
- = buffer[i] & 0xFFFF;
- info->dst.rect[j].top
- = (buffer[i] >> 16) & 0xFFFF;
- i += 1;
-
- info->dst.rect[j].right
- = buffer[i] & 0xFFFF;
- info->dst.rect[j].bottom
- = (buffer[i] >> 16) & 0xFFFF;
- i += 1;
- }
- break;
-
- default:
- res = 0;
- gc_dump_string(NULL, 0,
- "bad command (%d) "
- "while parsing the command stream",
- command);
- goto exit;
- }
-
- }
-
- /* Enable old source. */
- if ((info->srccount == 0) && oldsrc)
- info->srccount = 1;
-
- /* Success. */
- res = 1;
-
-exit:
- return res;
-}
-EXPORT_SYMBOL(gc_parse_command_buffer);
-
-
-/*******************************************************************************
- * Bltsville debugging.
- */
-
-char *gc_bvblend_name(enum bvblend blend)
-{
- switch (blend) {
- case BVBLEND_CLEAR: return "BVBLEND_CLEAR";
- case BVBLEND_SRC1: return "BVBLEND_SRC1";
- case BVBLEND_SRC2: return "BVBLEND_SRC2";
- case BVBLEND_SRC1OVER: return "BVBLEND_SRC1OVER";
- case BVBLEND_SRC2OVER: return "BVBLEND_SRC2OVER";
- case BVBLEND_SRC1IN: return "BVBLEND_SRC1IN";
- case BVBLEND_SRC2IN: return "BVBLEND_SRC2IN";
- case BVBLEND_SRC1OUT: return "BVBLEND_SRC1OUT";
- case BVBLEND_SRC2OUT: return "BVBLEND_SRC2OUT";
- case BVBLEND_SRC1ATOP: return "BVBLEND_SRC1ATOP";
- case BVBLEND_SRC2ATOP: return "BVBLEND_SRC2ATOP";
- case BVBLEND_XOR: return "BVBLEND_XOR";
- case BVBLEND_PLUS: return "BVBLEND_PLUS";
- case BVBLEND_NORMAL: return "BVBLEND_NORMAL";
- case BVBLEND_LIGHTEN: return "BVBLEND_LIGHTEN";
- case BVBLEND_DARKEN: return "BVBLEND_DARKEN";
- case BVBLEND_MULTIPLY: return "BVBLEND_MULTIPLY";
- case BVBLEND_AVERAGE: return "BVBLEND_AVERAGE";
- case BVBLEND_ADD: return "BVBLEND_ADD";
- case BVBLEND_SUBTRACT: return "BVBLEND_SUBTRACT";
- case BVBLEND_DIFFERENCE: return "BVBLEND_DIFFERENCE";
- case BVBLEND_NEGATE: return "BVBLEND_NEGATE";
- case BVBLEND_SCREEN: return "BVBLEND_SCREEN";
- case BVBLEND_EXCLUSION: return "BVBLEND_EXCLUSION";
- case BVBLEND_OVERLAY: return "BVBLEND_OVERLAY";
- case BVBLEND_SOFT_LIGHT: return "BVBLEND_SOFT_LIGHT";
- case BVBLEND_HARD_LIGHT: return "BVBLEND_HARD_LIGHT";
- case BVBLEND_COLOR_DODGE: return "BVBLEND_COLOR_DODGE";
- case BVBLEND_COLOR_BURN: return "BVBLEND_COLOR_BURN";
- case BVBLEND_LINEAR_LIGHT: return "BVBLEND_LINEAR_LIGHT";
- case BVBLEND_VIVID_LIGHT: return "BVBLEND_VIVID_LIGHT";
- case BVBLEND_PIN_LIGHT: return "BVBLEND_PIN_LIGHT";
- case BVBLEND_HARD_MIX: return "BVBLEND_HARD_MIX";
- case BVBLEND_REFLECT: return "BVBLEND_REFLECT";
- case BVBLEND_GLOW: return "BVBLEND_GLOW";
- case BVBLEND_PHOENIX: return "BVBLEND_PHOENIX";
- default: return "[UNKNOWN]";
- }
-}
-EXPORT_SYMBOL(gc_bvblend_name);
-
-
-/*******************************************************************************
- * Initialization/cleanup.
- */
-
-void gcdbg_init(void)
-{
-#if GC_BUFFERED_OUTPUT
- /* Allocate the debug buffer. */
- g_outputbuffer.buffer = kmalloc(GC_DUMP_BUFFER_SIZE, GFP_KERNEL);
- if (g_outputbuffer.buffer == NULL) {
- GC_PRINTK(NULL, "failed to allocate dump buffer.\n");
- return;
- }
-#endif
-
- g_initdone = 1;
-}
-
-void gcdbg_exit(void)
-{
-#if GC_BUFFERED_OUTPUT
- if (g_outputbuffer.buffer != NULL) {
- kfree(g_outputbuffer.buffer);
- g_outputbuffer.buffer = NULL;
- }
-#endif
-
- g_initdone = 0;
-}
-
-#endif /* GCDEBUG_ENABLE */
diff --git a/bltsville/gcbv/mirror/gcfill.c b/bltsville/gcbv/mirror/gcfill.c
deleted file mode 100644
index 458be75..0000000
--- a/bltsville/gcbv/mirror/gcfill.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_COLOR (1 << 0)
-#define GCZONE_FILL (1 << 1)
-
-GCDBG_FILTERDEF(fill, GCZONE_NONE,
- "color",
- "fill")
-
-
-static inline unsigned int extract_component(unsigned int pixel,
- const struct bvcomponent *desc)
-{
- unsigned int component;
- unsigned int component8;
-
- component = (pixel & desc->mask) >> desc->shift;
- GCDBG(GCZONE_COLOR, "mask=0x%08X, shift=%d, component=0x%08X\n",
- desc->mask, desc->shift, component);
-
- switch (desc->size) {
- case 0:
- component8 = 0xFF;
- GCDBG(GCZONE_COLOR, "component8=0x%08X\n", component8);
- break;
-
- case 1:
- component8 = component ? 0xFF : 0x00;
- GCDBG(GCZONE_COLOR, "component8=0x%08X\n", component8);
- break;
-
- case 4:
- component8 = component | (component << 4);
- GCDBG(GCZONE_COLOR, "component8=0x%08X\n", component8);
- break;
-
- case 5:
- component8 = (component << 3) | (component >> 2);
- GCDBG(GCZONE_COLOR, "component8=0x%08X\n", component8);
- break;
-
- case 6:
- component8 = (component << 2) | (component >> 4);
- GCDBG(GCZONE_COLOR, "component8=0x%08X\n", component8);
- break;
-
- default:
- component8 = component;
- GCDBG(GCZONE_COLOR, "component8=0x%08X\n", component8);
- }
-
- return component8;
-}
-
-static unsigned int getinternalcolor(void *ptr, struct bvformatxlate *format)
-{
- unsigned int srcpixel, dstpixel;
- unsigned int r, g, b, a;
-
- switch (format->bitspp) {
- case 16:
- srcpixel = *(unsigned short *) ptr;
- GCDBG(GCZONE_COLOR, "srcpixel=0x%08X\n", srcpixel);
- break;
-
- case 32:
- srcpixel = *(unsigned int *) ptr;
- GCDBG(GCZONE_COLOR, "srcpixel=0x%08X\n", srcpixel);
- break;
-
- default:
- srcpixel = 0;
- GCDBG(GCZONE_COLOR, "srcpixel=0x%08X\n", srcpixel);
- }
-
- r = extract_component(srcpixel, &format->cs.rgb.comp->r);
- g = extract_component(srcpixel, &format->cs.rgb.comp->g);
- b = extract_component(srcpixel, &format->cs.rgb.comp->b);
- a = extract_component(srcpixel, &format->cs.rgb.comp->a);
-
- GCDBG(GCZONE_COLOR, "(r,g,b,a)=0x%02X,0x%02X,0x%02X,0x%02X\n",
- r, g, b, a);
-
- dstpixel = (a << 24) | (r << 16) | (g << 8) | b;
-
- GCDBG(GCZONE_COLOR, "dstpixel=0x%08X\n", dstpixel);
-
- return dstpixel;
-}
-
-enum bverror do_fill(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct surfaceinfo *dstinfo;
- struct gcmofill *gcmofill;
- unsigned char *fillcolorptr;
- struct bvbuffmap *dstmap = NULL;
-
- GCENTER(GCZONE_FILL);
-
- /* Finish previous batch if any. */
- bverror = batch->batchend(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Parse destination parameters. */
- bverror = parse_destination(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Setup rotation. */
- process_dest_rotation(bvbltparams, batch);
-
- /* Get a shortcut to the destination surface. */
- dstinfo = &batch->dstinfo;
-
- /* Verify if the destination parameter have been modified. */
- if ((batch->dstbyteshift != dstinfo->bytealign) ||
- (batch->dstphyswidth != dstinfo->physwidth) ||
- (batch->dstphysheight != dstinfo->physheight)) {
- /* Set new values. */
- batch->dstbyteshift = dstinfo->bytealign;
- batch->dstphyswidth = dstinfo->physwidth;
- batch->dstphysheight = dstinfo->physheight;
-
- /* Mark as modified. */
- batch->batchflags |= BVBATCH_DST;
- }
-
- /* Map the destination. */
- bverror = do_map(bvbltparams->dstdesc, batch, &dstmap);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- /* Set the new destination. */
- bverror = set_dst(bvbltparams, batch, dstmap);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Reset the modified flag. */
- batch->batchflags &= ~(BVBATCH_DST |
- BVBATCH_CLIPRECT |
- BVBATCH_DESTRECT);
-
- /***********************************************************************
- ** Allocate command buffer.
- */
-
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmofill),
- (void **) &gcmofill);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /***********************************************************************
- ** Set dummy source.
- */
-
- /* Set surface dummy width and height. */
- gcmofill->src.rotation_ldst = gcmofillsrc_rotation_ldst;
- gcmofill->src.rotation.raw = 0;
- gcmofill->src.rotation.reg.surf_width = 1;
- gcmofill->src.config.raw = 0;
-
- gcmofill->src.rotationheight_ldst = gcmofillsrc_rotationheight_ldst;
- gcmofill->src.rotationheight.reg.height = 1;
- gcmofill->src.rotationangle.raw = 0;
- gcmofill->src.rotationangle.reg.dst = GCREG_ROT_ANGLE_ROT0;
- gcmofill->src.rotationangle.reg.dst_mirror = GCREG_MIRROR_NONE;
-
- /* Disable alpha blending. */
- gcmofill->src.alphacontrol_ldst = gcmofillsrc_alphacontrol_ldst;
- gcmofill->src.alphacontrol.raw = 0;
- gcmofill->src.alphacontrol.reg.enable = GCREG_ALPHA_CONTROL_ENABLE_OFF;
-
- /***********************************************************************
- ** Set fill color.
- */
-
- fillcolorptr
- = (unsigned char *) srcinfo->buf.desc->virtaddr
- + srcinfo->rect.top * srcinfo->geom->virtstride
- + srcinfo->rect.left * srcinfo->format.bitspp / 8;
-
- gcmofill->clearcolor_ldst = gcmofill_clearcolor_ldst;
- gcmofill->clearcolor.raw = getinternalcolor(fillcolorptr,
- &srcinfo->format);
-
- /***********************************************************************
- ** Configure and start fill.
- */
-
- /* Set destination configuration. */
- gcmofill->dstconfig_ldst = gcmofill_dstconfig_ldst;
- gcmofill->dstconfig.raw = 0;
- gcmofill->dstconfig.reg.swizzle = dstinfo->format.swizzle;
- gcmofill->dstconfig.reg.format = dstinfo->format.format;
- gcmofill->dstconfig.reg.command = GCREG_DEST_CONFIG_COMMAND_CLEAR;
-
- /* Set ROP3. */
- gcmofill->rop_ldst = gcmofill_rop_ldst;
- gcmofill->rop.raw = 0;
- gcmofill->rop.reg.type = GCREG_ROP_TYPE_ROP3;
- gcmofill->rop.reg.fg = (unsigned char) bvbltparams->op.rop;
-
- /* Set START_DE command. */
- gcmofill->startde.cmd.fld = gcfldstartde;
-
- /* Set destination rectangle. */
- gcmofill->rect.left = batch->dstadjusted.left;
- gcmofill->rect.top = batch->dstadjusted.top;
- gcmofill->rect.right = batch->dstadjusted.right;
- gcmofill->rect.bottom = batch->dstadjusted.bottom;
-
-exit:
- GCEXITARG(GCZONE_FILL, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
diff --git a/bltsville/gcbv/mirror/gcfilter.c b/bltsville/gcbv/mirror/gcfilter.c
deleted file mode 100644
index 525e242..0000000
--- a/bltsville/gcbv/mirror/gcfilter.c
+++ /dev/null
@@ -1,1788 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_KERNEL (1 << 0)
-#define GCZONE_FILTER (1 << 1)
-#define GCZONE_BLEND (1 << 2)
-#define GCZONE_TYPE (1 << 3)
-#define GCZONE_SRC (1 << 4)
-#define GCZONE_DEST (1 << 5)
-#define GCZONE_SURF (1 << 6)
-
-GCDBG_FILTERDEF(filter, GCZONE_NONE,
- "kernel",
- "filter",
- "blend",
- "type",
- "src",
- "dest",
- "surf")
-
-
-/*******************************************************************************
- * Miscellaneous defines.
- */
-
-#define GC_BYTES_PER_CACHELINE (64)
-#define GC_BITS_PER_CACHELINE (GC_BYTES_PER_CACHELINE * 8)
-#define GC_CACHELINE_ALIGN_16 (GC_BITS_PER_CACHELINE / 16 - 1)
-#define GC_CACHELINE_ALIGN_32 (GC_BITS_PER_CACHELINE / 32 - 1)
-
-enum gcscaletype {
- GC_SCALE_OPF,
- GC_SCALE_HOR,
- GC_SCALE_VER,
- GC_SCALE_HOR_FLIPPED,
- GC_SCALE_VER_FLIPPED
-};
-
-/*******************************************************************************
- * Scale factor format: unsigned 1.31 fixed point.
- */
-
-#define GC_SCALE_TYPE unsigned int
-#define GC_SCALE_FRACTION 31
-#define GC_SCALE_ONE ((GC_SCALE_TYPE) (1 << GC_SCALE_FRACTION))
-
-
-/*******************************************************************************
- * X coordinate format: signed 4.28 fixed point.
- */
-
-#define GC_COORD_TYPE int
-#define GC_COORD_FRACTION 28
-#define GC_COORD_PI ((GC_COORD_TYPE) 0x3243F6C0)
-#define GC_COORD_2OVERPI ((GC_COORD_TYPE) 0x0A2F9832)
-#define GC_COORD_PIOVER2 ((GC_COORD_TYPE) 0x1921FB60)
-#define GC_COORD_ZERO ((GC_COORD_TYPE) 0)
-#define GC_COORD_HALF ((GC_COORD_TYPE) (1 << (GC_COORD_FRACTION - 1)))
-#define GC_COORD_ONE ((GC_COORD_TYPE) (1 << GC_COORD_FRACTION))
-#define GC_COORD_NEGONE ((GC_COORD_TYPE) (~GC_COORD_ONE + 1))
-#define GC_COORD_SUBPIX_STEP ((GC_COORD_TYPE) \
- (1 << (GC_COORD_FRACTION - GC_PHASE_BITS)))
-
-
-/*******************************************************************************
- * Hardware coefficient format: signed 2.14 fixed point.
- */
-
-#define GC_COEF_TYPE short
-#define GC_COEF_FRACTION 14
-#define GC_COEF_ZERO ((GC_COEF_TYPE) 0)
-#define GC_COEF_ONE ((GC_COEF_TYPE) (1 << GC_COEF_FRACTION))
-#define GC_COEF_NEGONE ((GC_COEF_TYPE) (~GC_COEF_ONE + 1))
-
-
-/*******************************************************************************
- * Weight sum format: x.28 fixed point.
- */
-
-#define GC_SUM_TYPE long long
-#define GC_SUM_FRACTION GC_COORD_FRACTION
-
-
-/*******************************************************************************
- * Math shortcuts.
- */
-
-#define computescale(dstsize, srcsize) ((GC_SCALE_TYPE) \
- div_u64(((u64) (dstsize)) << GC_SCALE_FRACTION, (srcsize)) \
-)
-
-#define normweight(weight, sum) ((GC_COORD_TYPE) \
- div64_s64(((s64) (weight)) << GC_COORD_FRACTION, (sum)) \
-)
-
-#define convertweight(weight) ((GC_COEF_TYPE) \
- ((weight) >> (GC_COORD_FRACTION - GC_COEF_FRACTION)) \
-)
-
-
-/*******************************************************************************
- * Fixed point SINE function. Takes a positive value in range [0..pi/2].
- */
-
-static GC_COORD_TYPE sine(GC_COORD_TYPE x)
-{
- static const GC_COORD_TYPE sinetable[] = {
- 0x00000000, 0x001FFFEB, 0x003FFF55, 0x005FFDC0,
- 0x007FFAAB, 0x009FF596, 0x00BFEE01, 0x00DFE36C,
- 0x00FFD557, 0x011FC344, 0x013FACB2, 0x015F9120,
- 0x017F7010, 0x019F4902, 0x01BF1B78, 0x01DEE6F2,
- 0x01FEAAEE, 0x021E66F0, 0x023E1A7C, 0x025DC50C,
- 0x027D6624, 0x029CFD48, 0x02BC89F8, 0x02DC0BB8,
- 0x02FB8204, 0x031AEC64, 0x033A4A5C, 0x03599B64,
- 0x0378DF08, 0x039814CC, 0x03B73C2C, 0x03D654B0,
- 0x03F55DDC, 0x04145730, 0x04334030, 0x04521868,
- 0x0470DF58, 0x048F9488, 0x04AE3770, 0x04CCC7A8,
- 0x04EB44A8, 0x0509ADF8, 0x05280328, 0x054643B0,
- 0x05646F28, 0x05828508, 0x05A084E0, 0x05BE6E38,
- 0x05DC4098, 0x05F9FB80, 0x06179E88, 0x06352928,
- 0x06529AF8, 0x066FF380, 0x068D3248, 0x06AA56D8,
- 0x06C760C0, 0x06E44F90, 0x070122C8, 0x071DD9F8,
- 0x073A74B8, 0x0756F290, 0x07735308, 0x078F95B0,
- 0x07ABBA20, 0x07C7BFD8, 0x07E3A678, 0x07FF6D88,
- 0x081B14A0, 0x08369B40, 0x08520110, 0x086D4590,
- 0x08886860, 0x08A36910, 0x08BE4730, 0x08D90250,
- 0x08F39A20, 0x090E0E10, 0x09285DD0, 0x094288E0,
- 0x095C8EF0, 0x09766F90, 0x09902A60, 0x09A9BEE0,
- 0x09C32CC0, 0x09DC7390, 0x09F592F0, 0x0A0E8A70,
- 0x0A2759C0, 0x0A400070, 0x0A587E20, 0x0A70D270,
- 0x0A88FD00, 0x0AA0FD60, 0x0AB8D350, 0x0AD07E50,
- 0x0AE7FE10, 0x0AFF5230, 0x0B167A50, 0x0B2D7610,
- 0x0B444520, 0x0B5AE730, 0x0B715BC0, 0x0B87A290,
- 0x0B9DBB40, 0x0BB3A580, 0x0BC960F0, 0x0BDEED30,
- 0x0BF44A00, 0x0C0976F0, 0x0C1E73D0, 0x0C334020,
- 0x0C47DBB0, 0x0C5C4620, 0x0C707F20, 0x0C848660,
- 0x0C985B80, 0x0CABFE50, 0x0CBF6E60, 0x0CD2AB80,
- 0x0CE5B550, 0x0CF88B80, 0x0D0B2DE0, 0x0D1D9C10,
- 0x0D2FD5C0, 0x0D41DAB0, 0x0D53AAA0, 0x0D654540,
- 0x0D76AA40, 0x0D87D970, 0x0D98D280, 0x0DA99530,
- 0x0DBA2140, 0x0DCA7650, 0x0DDA9450, 0x0DEA7AD0,
- 0x0DFA29B0, 0x0E09A0B0, 0x0E18DF80, 0x0E27E5F0,
- 0x0E36B3C0, 0x0E4548B0, 0x0E53A490, 0x0E61C720,
- 0x0E6FB020, 0x0E7D5F70, 0x0E8AD4C0, 0x0E980FF0,
- 0x0EA510B0, 0x0EB1D6F0, 0x0EBE6260, 0x0ECAB2D0,
- 0x0ED6C810, 0x0EE2A200, 0x0EEE4070, 0x0EF9A310,
- 0x0F04C9E0, 0x0F0FB490, 0x0F1A6300, 0x0F24D510,
- 0x0F2F0A80, 0x0F390340, 0x0F42BF10, 0x0F4C3DE0,
- 0x0F557F70, 0x0F5E83C0, 0x0F674A80, 0x0F6FD3B0,
- 0x0F781F20, 0x0F802CB0, 0x0F87FC40, 0x0F8F8DA0,
- 0x0F96E0D0, 0x0F9DF5B0, 0x0FA4CC00, 0x0FAB63D0,
- 0x0FB1BCF0, 0x0FB7D740, 0x0FBDB2B0, 0x0FC34F30,
- 0x0FC8ACA0, 0x0FCDCAF0, 0x0FD2AA10, 0x0FD749E0,
- 0x0FDBAA50, 0x0FDFCB50, 0x0FE3ACD0, 0x0FE74EC0,
- 0x0FEAB110, 0x0FEDD3C0, 0x0FF0B6B0, 0x0FF359F0,
- 0x0FF5BD50, 0x0FF7E0E0, 0x0FF9C490, 0x0FFB6850,
- 0x0FFCCC30, 0x0FFDF010, 0x0FFED400, 0x0FFF77F0,
- 0x0FFFDBF0, 0x0FFFFFE0, 0x0FFFE3D0, 0x0FFF87D0,
- 0x0FFEEBC0, 0x0FFE0FC0, 0x0FFCF3D0, 0x0FFB97E0
- };
-
- enum {
- indexwidth = 8,
- intwidth = 1,
- indexshift = intwidth
- + GC_COORD_FRACTION
- - indexwidth
- };
-
- unsigned int p1, p2;
- GC_COORD_TYPE p1x, p2x;
- GC_COORD_TYPE p1y, p2y;
- GC_COORD_TYPE dx, dy;
- GC_COORD_TYPE a, b;
- GC_COORD_TYPE result;
-
- /* Determine the indices of two closest points in the table. */
- p1 = ((unsigned int) x) >> indexshift;
- p2 = p1 + 1;
-
- if ((p1 >= countof(sinetable)) || (p2 >= countof(sinetable))) {
- GCERR("invalid table index.\n");
- return GC_COORD_ZERO;
- }
-
- /* Determine the coordinates of the two closest points. */
- p1x = p1 << indexshift;
- p2x = p2 << indexshift;
-
- p1y = sinetable[p1];
- p2y = sinetable[p2];
-
- /* Determine the deltas. */
- dx = p2x - p1x;
- dy = p2y - p1y;
-
- /* Find the slope and the y-intercept. */
- b = (GC_COORD_TYPE) div64_s64(((s64) dy) << GC_COORD_FRACTION, dx);
- a = p1y - (GC_COORD_TYPE) (((s64) b * p1x) >> GC_COORD_FRACTION);
-
- /* Compute the result. */
- result = a + (GC_COORD_TYPE) (((s64) b * x) >> GC_COORD_FRACTION);
- return result;
-}
-
-
-/*******************************************************************************
- * SINC function used in filter kernel generation.
- */
-
-static GC_COORD_TYPE sinc_filter(GC_COORD_TYPE x, int radius)
-{
- GC_COORD_TYPE result;
- s64 radius64;
- s64 pit, pitd;
- s64 normpit, normpitd;
- int negpit, negpitd;
- int quadpit, quadpitd;
- GC_COORD_TYPE sinpit, sinpitd;
- GC_COORD_TYPE f1, f2;
-
- if (x == GC_COORD_ZERO)
- return GC_COORD_ONE;
-
- radius64 = abs(radius) << GC_COORD_FRACTION;
- if (x > radius64)
- return GC_COORD_ZERO;
-
- pit = (((s64) GC_COORD_PI) * x) >> GC_COORD_FRACTION;
- pitd = div_s64(pit, radius);
-
- /* Sine table only has values for the first positive quadrant,
- * remove the sign here. */
- if (pit < 0) {
- normpit = -pit;
- negpit = 1;
- } else {
- normpit = pit;
- negpit = 0;
- }
-
- if (pitd < 0) {
- normpitd = -pitd;
- negpitd = 1;
- } else {
- normpitd = pitd;
- negpitd = 0;
- }
-
- /* Determine which quadrant we are in. */
- quadpit = (int) ((normpit * GC_COORD_2OVERPI)
- >> (2 * GC_COORD_FRACTION));
- quadpitd = (int) ((normpitd * GC_COORD_2OVERPI)
- >> (2 * GC_COORD_FRACTION));
-
- /* Move coordinates to the first quadrant. */
- normpit -= (s64) GC_COORD_PIOVER2 * quadpit;
- normpitd -= (s64) GC_COORD_PIOVER2 * quadpitd;
-
- /* Normalize the quadrant numbers. */
- quadpit %= 4;
- quadpitd %= 4;
-
- /* Flip the coordinates if necessary. */
- if ((quadpit == 1) || (quadpit == 3))
- normpit = GC_COORD_PIOVER2 - normpit;
-
- if ((quadpitd == 1) || (quadpitd == 3))
- normpitd = GC_COORD_PIOVER2 - normpitd;
-
- sinpit = sine((GC_COORD_TYPE) normpit);
- sinpitd = sine((GC_COORD_TYPE) normpitd);
-
- /* Negate depending on the quadrant. */
- if (negpit) {
- if ((quadpit == 0) || (quadpit == 1))
- sinpit = -sinpit;
- } else {
- if ((quadpit == 2) || (quadpit == 3))
- sinpit = -sinpit;
- }
-
- if (negpitd) {
- if ((quadpitd == 0) || (quadpitd == 1))
- sinpitd = -sinpitd;
- } else {
- if ((quadpitd == 2) || (quadpitd == 3))
- sinpitd = -sinpitd;
- }
-
- f1 = (GC_COORD_TYPE)
- div64_s64(((s64) sinpit) << GC_COORD_FRACTION, pit);
- f2 = (GC_COORD_TYPE)
- div64_s64(((s64) sinpitd) << GC_COORD_FRACTION, pitd);
-
- result = (GC_COORD_TYPE) ((((s64) f1) * f2)
- >> GC_COORD_FRACTION);
-
- return result;
-}
-
-
-/*******************************************************************************
- * Filter kernel generator based on SINC function.
- */
-
-static void calculate_sync_filter(struct gcfilterkernel *gcfilterkernel)
-{
- GC_SCALE_TYPE scale;
- GC_COORD_TYPE subpixset[GC_TAP_COUNT];
- GC_COORD_TYPE subpixeloffset;
- GC_COORD_TYPE x, weight;
- GC_SUM_TYPE weightsum;
- short convweightsum;
- int kernelhalf, padding;
- int subpixpos, kernelpos;
- short *kernelarray;
- short count, adjustfrom, adjustment;
- int index;
-
- /* Compute the scale factor. */
- scale = (gcfilterkernel->dstsize >= gcfilterkernel->srcsize)
- ? GC_SCALE_ONE
- : computescale(gcfilterkernel->dstsize, gcfilterkernel->srcsize);
-
- /* Calculate the kernel half. */
- kernelhalf = (int) (gcfilterkernel->kernelsize >> 1);
-
- /* Init the subpixel offset. */
- subpixeloffset = GC_COORD_HALF;
-
- /* Determine kernel padding size. */
- padding = (GC_TAP_COUNT - gcfilterkernel->kernelsize) / 2;
-
- /* Set initial kernel array pointer. */
- kernelarray = gcfilterkernel->kernelarray;
-
- /* Loop through each subpixel. */
- for (subpixpos = 0; subpixpos < GC_PHASE_LOAD_COUNT; subpixpos += 1) {
- /* Compute weights. */
- weightsum = GC_COORD_ZERO;
- for (kernelpos = 0; kernelpos < GC_TAP_COUNT; kernelpos += 1) {
- /* Determine the current index. */
- index = kernelpos - padding;
-
- /* Pad with zeros left side. */
- if (index < 0) {
- subpixset[kernelpos] = GC_COORD_ZERO;
- continue;
- }
-
- /* Pad with zeros right side. */
- if (index >= (int) gcfilterkernel->kernelsize) {
- subpixset[kernelpos] = GC_COORD_ZERO;
- continue;
- }
-
- /* "Filter off" case. */
- if (gcfilterkernel->kernelsize == 1) {
- subpixset[kernelpos] = GC_COORD_ONE;
-
- /* Update the sum of the weights. */
- weightsum += GC_COORD_ONE;
- continue;
- }
-
- /* Compute X coordinate. */
- x = ((index - kernelhalf) << GC_COORD_FRACTION)
- + subpixeloffset;
-
- /* Scale the coordinate. */
- x = (GC_COORD_TYPE)
- ((((s64) x) * scale) >> GC_SCALE_FRACTION);
-
- /* Compute the weight. */
- subpixset[kernelpos] = sinc_filter(x, kernelhalf);
-
- /* Update the sum of the weights. */
- weightsum += subpixset[kernelpos];
- }
-
- /* Convert the weights to the hardware format. */
- convweightsum = 0;
- for (kernelpos = 0; kernelpos < GC_TAP_COUNT; kernelpos += 1) {
- /* Normalize the current weight. */
- weight = normweight(subpixset[kernelpos], weightsum);
-
- /* Convert the weight to fixed point. */
- if (weight == GC_COORD_ZERO)
- kernelarray[kernelpos] = GC_COEF_ZERO;
- else if (weight >= GC_COORD_ONE)
- kernelarray[kernelpos] = GC_COEF_ONE;
- else if (weight <= GC_COORD_NEGONE)
- kernelarray[kernelpos] = GC_COEF_NEGONE;
- else
- kernelarray[kernelpos] = convertweight(weight);
-
- /* Compute the sum of all coefficients. */
- convweightsum += kernelarray[kernelpos];
- }
-
- /* Adjust the fixed point coefficients so that the sum is 1. */
- count = GC_COEF_ONE - convweightsum;
- if (count < 0) {
- count = -count;
- adjustment = -1;
- } else {
- adjustment = 1;
- }
-
- if (count > GC_TAP_COUNT) {
- GCERR("adjust count is too high = %d\n", count);
- } else {
- adjustfrom = (GC_TAP_COUNT - count) / 2;
- for (kernelpos = 0; kernelpos < count; kernelpos += 1)
- kernelarray[adjustfrom + kernelpos]
- += adjustment;
- }
-
- /* Advance the array pointer. */
- kernelarray += GC_TAP_COUNT;
-
- /* Advance to the next subpixel. */
- subpixeloffset -= GC_COORD_SUBPIX_STEP;
- }
-}
-
-
-/*******************************************************************************
- * Loads a filter into the GPU.
- */
-
-static enum bverror load_filter(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- enum gcfiltertype type,
- unsigned int kernelsize,
- unsigned int scalefactor,
- unsigned int srcsize,
- unsigned int dstsize,
- struct gccmdldstate arraystate)
-{
- enum bverror bverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
- struct gcfiltercache *filtercache;
- struct list_head *filterlist;
- struct list_head *filterhead;
- struct gcfilterkernel *gcfilterkernel;
- struct gcmofilterkernel *gcmofilterkernel;
-
- GCDBG(GCZONE_KERNEL, "kernelsize = %d\n", kernelsize);
- GCDBG(GCZONE_KERNEL, "srcsize = %d\n", srcsize);
- GCDBG(GCZONE_KERNEL, "dstsize = %d\n", dstsize);
- GCDBG(GCZONE_KERNEL, "scalefactor = 0x%08X\n", scalefactor);
-
- /* Is the filter already loaded? */
- if ((gccontext->loadedfilter != NULL) &&
- (gccontext->loadedfilter->type == type) &&
- (gccontext->loadedfilter->kernelsize == kernelsize) &&
- (gccontext->loadedfilter->scalefactor == scalefactor)) {
- GCDBG(GCZONE_KERNEL, "filter already computed.\n");
- gcfilterkernel = gccontext->loadedfilter;
- goto load;
- }
-
- /* Get the proper filter cache. */
- filtercache = &gccontext->filtercache[type][kernelsize];
- filterlist = &filtercache->list;
-
- /* Try to find existing filter. */
- GCDBG(GCZONE_KERNEL, "scanning for existing filter.\n");
- list_for_each(filterhead, filterlist) {
- gcfilterkernel = list_entry(filterhead,
- struct gcfilterkernel,
- link);
- if (gcfilterkernel->scalefactor == scalefactor) {
- GCDBG(GCZONE_KERNEL, "filter found @ 0x%08X.\n",
- (unsigned int) gcfilterkernel);
- break;
- }
- }
-
- /* Found the filter? */
- if (filterhead != filterlist) {
- /* Move the filter to the head of the list. */
- if (filterlist->next != filterhead) {
- GCDBG(GCZONE_KERNEL, "moving to the head.\n");
- list_move(filterhead, filterlist);
- }
- } else {
- GCDBG(GCZONE_KERNEL, "filter not found.\n");
- if (filtercache->count == GC_FILTER_CACHE_MAX) {
- GCDBG(GCZONE_KERNEL,
- "reached the maximum number of filters.\n");
- filterhead = filterlist->prev;
- list_move(filterhead, filterlist);
-
- gcfilterkernel = list_entry(filterhead,
- struct gcfilterkernel,
- link);
- } else {
- GCDBG(GCZONE_KERNEL, "allocating new filter.\n");
- gcfilterkernel = gcalloc(struct gcfilterkernel,
- sizeof(struct gcfilterkernel));
- if (gcfilterkernel == NULL) {
- BVSETBLTERROR(BVERR_OOM,
- "filter allocation failed");
- goto exit;
- }
-
- list_add(&gcfilterkernel->link, filterlist);
- }
-
- /* Update the number of filters. */
- filtercache->count += 1;
-
- /* Initialize the filter. */
- gcfilterkernel->type = type;
- gcfilterkernel->kernelsize = kernelsize;
- gcfilterkernel->srcsize = srcsize;
- gcfilterkernel->dstsize = dstsize;
- gcfilterkernel->scalefactor = scalefactor;
-
- /* Compute the coefficients. */
- calculate_sync_filter(gcfilterkernel);
- }
-
-load:
- GCDBG(GCZONE_KERNEL, "loading filter.\n");
-
- /* Load the filter. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmofilterkernel),
- (void **) &gcmofilterkernel);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmofilterkernel->kernelarray_ldst = arraystate;
- memcpy(&gcmofilterkernel->kernelarray,
- gcfilterkernel->kernelarray,
- sizeof(gcfilterkernel->kernelarray));
-
- /* Set the filter. */
- gccontext->loadedfilter = gcfilterkernel;
-
-exit:
- return bverror;
-}
-
-
-/*******************************************************************************
- * Compute the scale factor.
- */
-
-static inline unsigned int get_scale_factor(unsigned int srcsize,
- unsigned int dstsize)
-{
- if ((srcsize <= 1) || (dstsize <= 1))
- return 0;
-
- return ((srcsize - 1) << 16) / (dstsize - 1);
-}
-
-
-/*******************************************************************************
- * Rotates the specified rectangle to the specified angle.
- */
-
-static void rotate_gcrect(int angle,
- struct bvsurfgeom *srcgeom, struct gcrect *srcrect,
- struct bvsurfgeom *dstgeom, struct gcrect *dstrect)
-{
- unsigned int width, height;
- struct gcrect rect;
-
- GCENTER(GCZONE_SURF);
-
- GCDBG(GCZONE_SURF, "src geom size = %dx%d\n",
- srcgeom->width, srcgeom->height);
-
- switch (angle) {
- case ROT_ANGLE_0:
- GCDBG(GCZONE_SURF, "ROT_ANGLE_0\n");
-
- if (dstgeom != srcgeom) {
- dstgeom->width = srcgeom->width;
- dstgeom->height = srcgeom->height;
- }
-
- if (dstrect != srcrect)
- *dstrect = *srcrect;
- break;
-
- case ROT_ANGLE_90:
- GCDBG(GCZONE_SURF, "ROT_ANGLE_90\n");
-
- width = srcgeom->width;
- height = srcgeom->height;
-
- dstgeom->width = height;
- dstgeom->height = width;
-
- rect.left = height - srcrect->bottom;
- rect.top = srcrect->left;
- rect.right = height - srcrect->top;
- rect.bottom = srcrect->right;
-
- *dstrect = rect;
- break;
-
- case ROT_ANGLE_180:
- GCDBG(GCZONE_SURF, "ROT_ANGLE_180\n");
-
- width = srcgeom->width;
- height = srcgeom->height;
-
- if (dstgeom != srcgeom) {
- dstgeom->width = width;
- dstgeom->height = height;
- }
-
- rect.left = width - srcrect->right;
- rect.top = height - srcrect->bottom;
- rect.right = width - srcrect->left;
- rect.bottom = height - srcrect->top;
-
- *dstrect = rect;
- break;
-
- case ROT_ANGLE_270:
- GCDBG(GCZONE_SURF, "ROT_ANGLE_270\n");
-
- width = srcgeom->width;
- height = srcgeom->height;
-
- dstgeom->width = height;
- dstgeom->height = width;
-
- rect.left = srcrect->top;
- rect.top = width - srcrect->right;
- rect.right = srcrect->bottom;
- rect.bottom = width - srcrect->left;
-
- *dstrect = rect;
- break;
- }
-
- GCEXIT(GCZONE_SURF);
-}
-
-
-/*******************************************************************************
- * Setup destination rotation parameters.
- */
-
-void process_rotation(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo,
- int adjangle)
-{
- GCENTER(GCZONE_DEST);
-
- if (srcinfo->newgeom ||
- ((batch->batchflags & (BVBATCH_CLIPRECT |
- BVBATCH_DESTRECT |
- BVBATCH_DST)) != 0)) {
- bool orthogonal;
- struct gcfilter *gcfilter;
- struct surfaceinfo *dstinfo;
- int dstoffsetX, dstoffsetY;
-
- /* Get some shortcuts. */
- dstinfo = &batch->dstinfo;
- gcfilter = &batch->op.filter;
-
- /* Compute the adjusted destination angle. */
- gcfilter->dstangle
- = (dstinfo->angle + (4 - srcinfo->angle)) % 4;
- GCDBG(GCZONE_DEST, "dstangle = %d\n", gcfilter->dstangle);
-
- /* Determine whether the new and the old destination angles
- * are orthogonal to each other. */
- orthogonal = (gcfilter->dstangle % 2) != (dstinfo->angle % 2);
-
- switch (gcfilter->dstangle) {
- case ROT_ANGLE_0:
- /* Determine the origin offset. */
- dstoffsetX = dstinfo->xpixalign;
- dstoffsetY = dstinfo->ypixalign;
-
- /* Determine geometry size. */
- if (orthogonal) {
- batch->dstwidth = dstinfo->geom->height
- - dstinfo->xpixalign;
- batch->dstheight = dstinfo->geom->width
- - dstinfo->ypixalign;
- } else {
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->xpixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->ypixalign;
- }
-
- /* Determine the physical size. */
- dstinfo->physwidth = batch->dstwidth;
- dstinfo->physheight = batch->dstheight;
- break;
-
- case ROT_ANGLE_90:
- /* Determine the origin offset. */
- dstoffsetX = dstinfo->ypixalign;
- dstoffsetY = dstinfo->xpixalign;
-
- if (orthogonal) {
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->height
- - dstinfo->ypixalign;
- batch->dstheight = dstinfo->geom->width
- - dstinfo->xpixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = dstinfo->geom->width
- - dstinfo->xpixalign;
- dstinfo->physheight = dstinfo->geom->height
- - dstinfo->ypixalign;
- } else {
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->ypixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->xpixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = dstinfo->geom->height
- - dstinfo->xpixalign;
- dstinfo->physheight = dstinfo->geom->width
- - dstinfo->ypixalign;
- }
- break;
-
- case ROT_ANGLE_180:
- /* Determine the origin offset. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- /* Determine geometry size. */
- if (orthogonal) {
- batch->dstwidth = dstinfo->geom->height
- - dstinfo->xpixalign;
- batch->dstheight = dstinfo->geom->width
- - dstinfo->ypixalign;
- } else {
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->xpixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->ypixalign;
- }
-
- /* Determine the physical size. */
- dstinfo->physwidth = batch->dstwidth;
- dstinfo->physheight = batch->dstheight;
- break;
-
- case ROT_ANGLE_270:
- /* Determine the origin offset. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- if (orthogonal) {
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->height
- = dstinfo->ypixalign;
- batch->dstheight = dstinfo->geom->width
- - dstinfo->xpixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = dstinfo->geom->width
- - dstinfo->xpixalign;
- dstinfo->physheight = dstinfo->geom->height
- - dstinfo->ypixalign;
- } else {
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->ypixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->xpixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = dstinfo->geom->height
- - dstinfo->xpixalign;
- dstinfo->physheight = dstinfo->geom->width
- - dstinfo->ypixalign;
- }
- break;
-
- default:
- dstoffsetX = 0;
- dstoffsetY = 0;
- }
-
- /* Rotate the original destination rectangle
- * to match the new angle. */
- rotate_gcrect(adjangle,
- dstinfo->geom, &dstinfo->rect,
- &gcfilter->dstgeom, &gcfilter->dstrect);
-
- /* Rotate the clipped destination rectangle. */
- rotate_gcrect(adjangle,
- dstinfo->geom, &batch->dstclipped,
- &gcfilter->dstgeom, &gcfilter->dstclipped);
-
- /* Compute the adjusted the destination rectangle. */
- gcfilter->dstadjusted.left
- = gcfilter->dstclipped.left - dstoffsetX;
- gcfilter->dstadjusted.top
- = gcfilter->dstclipped.top - dstoffsetY;
- gcfilter->dstadjusted.right
- = gcfilter->dstclipped.right - dstoffsetX;
- gcfilter->dstadjusted.bottom
- = gcfilter->dstclipped.bottom - dstoffsetY;
-
- GCPRINT_RECT(GCZONE_DEST, "rotated dstrect",
- &gcfilter->dstrect);
- GCPRINT_RECT(GCZONE_DEST, "rotated dstclipped",
- &gcfilter->dstclipped);
- GCPRINT_RECT(GCZONE_DEST, "rotated dstadjusted",
- &gcfilter->dstadjusted);
-
- if (batch->haveaux) {
- /* Rotate the original aux destination rectangle
- * to match the new angle. */
- rotate_gcrect(adjangle, dstinfo->geom,
- &batch->dstrectaux, &gcfilter->dstgeom,
- &gcfilter->dstrectaux);
-
- /* Rotate the aux destination rectangle. */
- rotate_gcrect(adjangle, dstinfo->geom,
- &batch->dstclippedaux, &gcfilter->dstgeom,
- &gcfilter->dstclippedaux);
-
- /* Compute the adjust the aux destination rectangle. */
- gcfilter->dstadjustedaux.left
- = batch->dstclippedaux.left - dstoffsetX;
- gcfilter->dstadjustedaux.top
- = batch->dstclippedaux.top - dstoffsetY;
- gcfilter->dstadjustedaux.right
- = batch->dstclippedaux.right - dstoffsetX;
- gcfilter->dstadjustedaux.bottom
- = batch->dstclippedaux.bottom - dstoffsetY;
-
- GCPRINT_RECT(GCZONE_DEST, "rotated dstrectaux",
- &gcfilter->dstrectaux);
- GCPRINT_RECT(GCZONE_DEST, "rotated dstclippedaux",
- &gcfilter->dstclippedaux);
- GCPRINT_RECT(GCZONE_DEST, "rotated dstadjustedaux",
- &gcfilter->dstadjustedaux);
- }
-
- GCDBG(GCZONE_DEST, "aligned geometry size = %dx%d\n",
- batch->dstwidth, batch->dstheight);
- GCDBG(GCZONE_DEST, "aligned physical size = %dx%d\n",
- dstinfo->physwidth, dstinfo->physheight);
- GCDBG(GCZONE_DEST, "origin offset (pixels) = %d,%d\n",
- dstoffsetX, dstoffsetY);
- }
-
- GCEXIT(GCZONE_DEST);
-}
-
-
-/*******************************************************************************
- * Rasterizer setup.
- */
-
-static enum bverror startvr(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct bvbuffmap *srcmap,
- struct bvbuffmap *dstmap,
- struct surfaceinfo *srcinfo,
- struct surfaceinfo *dstinfo,
- unsigned int srcx,
- unsigned int srcy,
- struct gcrect *dstrect,
- int srcangle,
- int dstangle,
- enum gcscaletype scaletype)
-{
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct gcfilter *gcfilter;
-
- struct gcmovrdst *gcmovrdst;
- struct gcmovrsrc *gcmovrsrc;
- struct gcmostartvr *gcmostartvr;
-
- struct gcrect srcrect;
-
- GCENTERARG(GCZONE_FILTER, "scaletype = %d\n", scaletype);
-
- /* Get a shortcut to the filter properties. */
- gcfilter = &batch->op.filter;
-
- /***********************************************************************
- * Program the destination.
- */
-
- GCDBG(GCZONE_FILTER, "destination:\n");
- GCDBG(GCZONE_FILTER, " angle = %d\n", dstangle);
- GCDBG(GCZONE_FILTER, " pixalign = %d,%d\n",
- dstinfo->xpixalign, dstinfo->ypixalign);
- GCDBG(GCZONE_FILTER, " bytealign = %d\n", dstinfo->bytealign);
- GCDBG(GCZONE_FILTER, " virtstride = %d\n", dstinfo->geom->virtstride);
- GCDBG(GCZONE_FILTER, " format = %d\n", dstinfo->format.format);
- GCDBG(GCZONE_FILTER, " swizzle = %d\n", dstinfo->format.swizzle);
- GCDBG(GCZONE_FILTER, " premul = %d\n", dstinfo->format.premultiplied);
- GCDBG(GCZONE_FILTER, " physwidth = %d\n", dstinfo->physwidth);
- GCDBG(GCZONE_FILTER, " physheight = %d\n", dstinfo->physheight);
- GCPRINT_RECT(GCZONE_FILTER, " rect", dstrect);
-
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmovrdst),
- (void **) &gcmovrdst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Add the address fixup. */
- add_fixup(bvbltparams, batch, &gcmovrdst->address, dstinfo->bytealign);
-
- /* Set surface parameters. */
- gcmovrdst->config_ldst = gcmovrdst_config_ldst;
- gcmovrdst->address = GET_MAP_HANDLE(dstmap);
- gcmovrdst->stride = dstinfo->geom->virtstride;
- gcmovrdst->config.raw = 0;
- gcmovrdst->config.reg.swizzle = dstinfo->format.swizzle;
- gcmovrdst->config.reg.format = dstinfo->format.format;
-
- /* Set surface width and height. */
- gcmovrdst->rotation.raw = 0;
- gcmovrdst->rotation.reg.surf_width = dstinfo->physwidth;
- gcmovrdst->rotationheight_ldst = gcmovrdst_rotationheight_ldst;
- gcmovrdst->rotationheight.raw = 0;
- gcmovrdst->rotationheight.reg.height = dstinfo->physheight;
-
- /***********************************************************************
- * Program the source.
- */
-
- /* Determine adjusted source bounding rectangle and origin. */
- srcrect = srcinfo->rect;
- srcrect.left -= srcinfo->xpixalign;
- srcrect.right -= srcinfo->xpixalign;
- srcx -= (srcinfo->xpixalign << 16);
-
- GCDBG(GCZONE_FILTER, "source:\n");
- GCDBG(GCZONE_FILTER, " angle = %d\n", srcangle);
- GCDBG(GCZONE_FILTER, " pixalign = %d,%d\n",
- srcinfo->xpixalign, srcinfo->ypixalign);
- GCDBG(GCZONE_FILTER, " bytealign = %d\n", srcinfo->bytealign);
- GCDBG(GCZONE_FILTER, " virtstride = %d\n", srcinfo->geom->virtstride);
- GCDBG(GCZONE_FILTER, " format = %d\n", srcinfo->format.format);
- GCDBG(GCZONE_FILTER, " swizzle = %d\n", srcinfo->format.swizzle);
- GCDBG(GCZONE_FILTER, " premul = %d\n", srcinfo->format.premultiplied);
- GCDBG(GCZONE_FILTER, " physwidth = %d\n", srcinfo->physwidth);
- GCDBG(GCZONE_FILTER, " physheight = %d\n", srcinfo->physheight);
- GCPRINT_RECT(GCZONE_FILTER, " rect", &srcrect);
-
- GCDBG(GCZONE_FILTER, "src origin: 0x%08X,0x%08X\n", srcx, srcy);
-
- /* Allocate command buffer. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmovrsrc),
- (void **) &gcmovrsrc);
- if (bverror != BVERR_NONE)
- goto exit;
-
- add_fixup(bvbltparams, batch, &gcmovrsrc->address, srcinfo->bytealign);
-
- gcmovrsrc->config_ldst = gcmovrsrc_config_ldst;
-
- gcmovrsrc->address = GET_MAP_HANDLE(srcmap);
- gcmovrsrc->stride = srcinfo->geom->virtstride;
-
- gcmovrsrc->rotation.raw = 0;
- gcmovrsrc->rotation.reg.surf_width = srcinfo->physwidth;
-
- gcmovrsrc->config.raw = 0;
- gcmovrsrc->config.reg.swizzle = srcinfo->format.swizzle;
- gcmovrsrc->config.reg.format = srcinfo->format.format;
-
- if (gccontext->gcfeatures2.reg.l2cachefor420 &&
- (srcinfo->format.type == BVFMT_YUV) &&
- (srcinfo->format.cs.yuv.planecount > 1) &&
- ((srcinfo->angle & 1) != 0))
- gcmovrsrc->config.reg.disable420L2cache
- = GCREG_SRC_CONFIG_DISABLE420_L2_CACHE_DISABLED;
-
- gcmovrsrc->pos_ldst = gcmovrsrc_pos_ldst;
-
- /* Source image bounding box. */
- gcmovrsrc->lt.reg.left = srcrect.left;
- gcmovrsrc->lt.reg.top = srcrect.top;
- gcmovrsrc->rb.reg.right = srcrect.right;
- gcmovrsrc->rb.reg.bottom = srcrect.bottom;
-
- /* Fractional origin. */
- gcmovrsrc->x = srcx;
- gcmovrsrc->y = srcy;
-
- /* Program rotation. */
- gcmovrsrc->rotation_ldst = gcmovrsrc_rotation_ldst;
- gcmovrsrc->rotationheight.reg.height = srcinfo->physheight;
- gcmovrsrc->rotationangle.raw = 0;
- gcmovrsrc->rotationangle.reg.src = rotencoding[srcangle];
- gcmovrsrc->rotationangle.reg.dst = rotencoding[dstangle];
- gcmovrsrc->rotationangle.reg.src_mirror = srcinfo->mirror;
- gcmovrsrc->rotationangle.reg.dst_mirror = dstinfo->mirror;
-
- gcmovrsrc->rop_ldst = gcmovrsrc_rop_ldst;
- gcmovrsrc->rop.raw = 0;
- gcmovrsrc->rop.reg.type = GCREG_ROP_TYPE_ROP3;
- gcmovrsrc->rop.reg.fg = 0xCC;
-
- /* Program multiply modes. */
- gcmovrsrc->mult_ldst = gcmovrsrc_mult_ldst;
- gcmovrsrc->mult.raw = 0;
- gcmovrsrc->mult.reg.srcglobalpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_DISABLE;
-
- if (srcinfo->format.premultiplied)
- gcmovrsrc->mult.reg.srcpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE;
- else
- gcmovrsrc->mult.reg.srcpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE;
-
- if (dstinfo->format.premultiplied) {
- gcmovrsrc->mult.reg.dstpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE;
-
- gcmovrsrc->mult.reg.dstdemul
- = GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_DISABLE;
- } else {
- gcmovrsrc->mult.reg.dstpremul
- = GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE;
-
- gcmovrsrc->mult.reg.dstdemul
- = GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_ENABLE;
- }
-
- /* Program YUV source. */
- if (srcinfo->format.type == BVFMT_YUV) {
- bverror = set_yuvsrc(bvbltparams, batch, srcinfo, srcmap);
- if (bverror != BVERR_NONE)
- goto exit;
- }
-
- /***********************************************************************
- * Program blending.
- */
-
- bverror = set_blending(bvbltparams, batch, srcinfo);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /***********************************************************************
- * Start the operation.
- */
-
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmostartvr),
- (void **) &gcmostartvr);
- if (bverror != BVERR_NONE)
- goto exit;
-
- switch (scaletype) {
- case GC_SCALE_OPF:
- gcmostartvr->scalex = gcfilter->horscalefactor;
- gcmostartvr->scaley = gcfilter->verscalefactor;
- gcmostartvr->config = gcregvrconfig_onepass;
- break;
-
- case GC_SCALE_HOR:
- gcmostartvr->scalex = gcfilter->horscalefactor;
- gcmostartvr->scaley = 0;
- gcmostartvr->config = gcregvrconfig_horizontal;
- break;
-
- case GC_SCALE_VER:
- gcmostartvr->scalex = 0;
- gcmostartvr->scaley = gcfilter->verscalefactor;
- gcmostartvr->config = gcregvrconfig_vertical;
- break;
-
- case GC_SCALE_HOR_FLIPPED:
- gcmostartvr->scalex = 0;
- gcmostartvr->scaley = gcfilter->horscalefactor;
- gcmostartvr->config = gcregvrconfig_vertical;
- break;
-
- case GC_SCALE_VER_FLIPPED:
- gcmostartvr->scalex = gcfilter->verscalefactor;
- gcmostartvr->scaley = 0;
- gcmostartvr->config = gcregvrconfig_horizontal;
- break;
- }
-
- gcmostartvr->scale_ldst = gcmostartvr_scale_ldst;
- gcmostartvr->rect_ldst = gcmostartvr_rect_ldst;
- gcmostartvr->config_ldst = gcmostartvr_config_ldst;
-
- gcmostartvr->lt.left = dstrect->left;
- gcmostartvr->lt.top = dstrect->top;
- gcmostartvr->rb.right = dstrect->right;
- gcmostartvr->rb.bottom = dstrect->bottom;
-
-exit:
- GCEXITARG(GCZONE_FILTER, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-
-/*******************************************************************************
- * Main fiter entry.
- */
-
-enum bverror do_filter(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct surfaceinfo *srcinfo)
-{
- enum bverror bverror = BVERR_NONE;
- struct gccontext *gccontext = get_context();
-
- struct gcfilter *gcfilter;
- struct surfaceinfo *dstinfo;
-
- bool scalex, scaley;
- bool singlepass, twopass;
-
- struct gcrect *srcrect;
- struct gcrect *dstrect;
- struct gcrect *dstclipped;
- struct gcrect *dstadjusted;
-
- struct bvsurfgeom dstrotated0geom;
- struct gcrect dstrotated0;
-
- struct gcrect dstdelta;
- struct gcrect srcdelta;
- struct gcrect srcclipped;
-
- struct bvbuffmap *srcmap = NULL;
- struct bvbuffmap *tmpmap = NULL;
- struct bvbuffmap *dstmap = NULL;
-
- struct gcmovrconfigex *gcmovrconfigex;
-
- int adjangle;
- unsigned int srcx, srcy;
- unsigned int srcwidth, srcheight;
- unsigned int dstwidth, dstheight;
- unsigned int horscalefactor, verscalefactor;
- unsigned int kernelsize;
-
- GCENTER(GCZONE_FILTER);
-
- /* Get some shortcuts. */
- dstinfo = &batch->dstinfo;
- gcfilter = &batch->op.filter;
-
- /* Finish previous batch if any. */
- bverror = batch->batchend(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* ROP is not supported by the filters. */
- if ((srcinfo->rop & 0xFF) != 0xCC) {
- BVSETBLTERROR(BVERR_ROP,
- "only copy ROP is supported in scaling mode");
- goto exit;
- }
-
- /* Parse the scale mode. */
- bverror = parse_scalemode(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Parse destination parameters. */
- bverror = parse_destination(bvbltparams, batch);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Compute the source alignments needed to compensate
- * for the surface base address misalignment if any. */
- srcinfo->xpixalign = get_pixel_offset(srcinfo, 0);
- srcinfo->ypixalign = 0;
- srcinfo->bytealign = (srcinfo->xpixalign
- * (int) srcinfo->format.bitspp) / 8;
- GCDBG(GCZONE_SRC, "source surface offset (pixels) = %d,%d\n",
- srcinfo->xpixalign, srcinfo->ypixalign);
- GCDBG(GCZONE_SRC, "source surface offset (bytes) = %d\n",
- srcinfo->bytealign);
-
- /* Compute U/V plane offsets. */
- if ((srcinfo->format.type == BVFMT_YUV) &&
- (srcinfo->format.cs.yuv.planecount > 1))
- set_computeyuv(srcinfo, 0, 0);
-
- /* Determine physical size. */
- if ((srcinfo->angle % 2) == 0) {
- srcinfo->physwidth = srcinfo->geom->width
- - srcinfo->xpixalign;
- srcinfo->physheight = srcinfo->geom->height
- - srcinfo->ypixalign;
- } else {
- srcinfo->physwidth = srcinfo->geom->height
- - srcinfo->xpixalign;
- srcinfo->physheight = srcinfo->geom->width
- - srcinfo->ypixalign;
- }
- GCDBG(GCZONE_SRC, "source physical size = %dx%d\n",
- srcinfo->physwidth, srcinfo->physheight);
-
- /* OPF does not support source rotation, which can be compensated by
- * using destination rotation. Compute the adjustment angle.
- * For simplicity use the same algorythm for both OPF and TPF. */
- adjangle = (4 - srcinfo->angle) % 4;
- GCDBG(GCZONE_DEST, "adjangle = %d\n", adjangle);
-
- /* Compute destination rotation. */
- process_rotation(bvbltparams, batch, srcinfo, adjangle);
-
- /* Rotate the source rectangle to 0 degree. */
- srcrect = &srcinfo->rect;
- GCPRINT_RECT(GCZONE_FILTER, "full src", srcrect);
- rotate_gcrect(adjangle,
- srcinfo->geom, srcrect,
- srcinfo->geom, srcrect);
- GCPRINT_RECT(GCZONE_FILTER, "full adjusted src", srcrect);
-
- /* Get destination rect shortcuts. */
- if ((srcinfo->index == 1) && batch->haveaux) {
- dstrect = &gcfilter->dstrectaux;
- dstclipped = &gcfilter->dstclippedaux;
- dstadjusted = &gcfilter->dstadjustedaux;
- } else {
- dstrect = &gcfilter->dstrect;
- dstclipped = &gcfilter->dstclipped;
- dstadjusted = &gcfilter->dstadjusted;
- }
-
- GCPRINT_RECT(GCZONE_FILTER, "full adjusted dst", dstrect);
- GCPRINT_RECT(GCZONE_FILTER, "clipped adjusted dst", dstclipped);
- GCPRINT_RECT(GCZONE_FILTER, "aligned adjusted dst", dstadjusted);
-
- /* Determine the source and destination rectangles. */
- srcwidth = srcrect->right - srcrect->left;
- srcheight = srcrect->bottom - srcrect->top;
- dstwidth = dstrect->right - dstrect->left;
- dstheight = dstrect->bottom - dstrect->top;
-
- GCDBG(GCZONE_FILTER, "adjusted input src size: %dx%d\n",
- srcwidth, srcheight);
- GCDBG(GCZONE_FILTER, "adjusted input dst size: %dx%d\n",
- dstwidth, dstheight);
-
- /* Determine the data path. */
- scalex = (srcwidth != dstwidth);
- scaley = (srcheight != dstheight);
-
- twopass = scalex && scaley;
- if (twopass) {
- if (((gcfilter->horkernelsize == 3) ||
- (gcfilter->horkernelsize == 5)) &&
- ((gcfilter->verkernelsize == 3) ||
- (gcfilter->verkernelsize == 5))) {
- singlepass = true;
- twopass = false;
- } else {
- singlepass = false;
- }
- } else {
- /* Two pass filter in one pass mode. */
- if (!scalex && !scaley)
- GCERR("no scaling needed.\n");
-
- GCDBG(GCZONE_FILTER, "only %s scaling needed.\n",
- scalex ? "horizontal" : "vertical");
-
- singlepass = false;
- }
-
- /* Compute the scale factors. */
- gcfilter->horscalefactor =
- horscalefactor = get_scale_factor(srcwidth, dstwidth);
- GCDBG(GCZONE_FILTER, "horscalefactor = 0x%08X\n", horscalefactor);
-
- gcfilter->verscalefactor =
- verscalefactor = get_scale_factor(srcheight, dstheight);
- GCDBG(GCZONE_FILTER, "verscalefactor = 0x%08X\n", verscalefactor);
-
- /* Compute the destination offsets. */
- dstdelta.left = dstclipped->left - dstrect->left;
- dstdelta.top = dstclipped->top - dstrect->top;
- dstdelta.right = dstclipped->right - dstrect->left;
- dstdelta.bottom = dstclipped->bottom - dstrect->top;
- GCDBG(GCZONE_FILTER, "dst deltas = (%d,%d)-(%d,%d)\n",
- dstdelta.left, dstdelta.top, dstdelta.right, dstdelta.bottom);
-
- /* Compute the source offsets. */
- srcdelta.left = dstdelta.left * horscalefactor;
- srcdelta.top = dstdelta.top * verscalefactor;
- srcdelta.right = (dstdelta.right - 1) * horscalefactor + (1 << 16);
- srcdelta.bottom = (dstdelta.bottom - 1) * verscalefactor + (1 << 16);
-
- /* Before rendering each destination pixel, the HW will select the
- * corresponding source center pixel to apply the kernel around.
- * To make this process precise we need to add 0.5 to source initial
- * coordinates here; this will make HW pick the next source pixel if
- * the fraction is equal or greater then 0.5. */
- srcdelta.left += 0x00008000;
- srcdelta.top += 0x00008000;
- srcdelta.right += 0x00008000;
- srcdelta.bottom += 0x00008000;
- GCDBG(GCZONE_FILTER, "src deltas = "
- "(0x%08X,0x%08X)-(0x%08X,0x%08X)\n",
- srcdelta.left, srcdelta.top, srcdelta.right, srcdelta.bottom);
- GCDBG(GCZONE_FILTER, "src deltas (int) = (%d,%d)-(%d,%d)\n",
- srcdelta.left >> 16, srcdelta.top >> 16,
- srcdelta.right >> 16, srcdelta.bottom >> 16);
-
- /* Determine clipped source rectangle. */
- srcclipped.left = srcrect->left + (srcdelta.left >> 16);
- srcclipped.top = srcrect->top + (srcdelta.top >> 16);
- srcclipped.right = srcrect->left + (srcdelta.right >> 16);
- srcclipped.bottom = srcrect->top + (srcdelta.bottom >> 16);
-
- GCDBG(GCZONE_FILTER, "source:\n");
- GCDBG(GCZONE_FILTER, " stride = %d, geom = %dx%d\n",
- srcinfo->geom->virtstride,
- srcinfo->geom->width, srcinfo->geom->height);
- GCDBG(GCZONE_FILTER, " rotation = %d\n",
- srcinfo->angle);
- GCPRINT_RECT(GCZONE_FILTER, " clipped rect", &srcclipped);
-
- GCDBG(GCZONE_FILTER, "destination:\n");
- GCDBG(GCZONE_FILTER, " stride = %d, geom size = %dx%d\n",
- dstinfo->geom->virtstride,
- dstinfo->geom->width, dstinfo->geom->height);
- GCDBG(GCZONE_FILTER, " rotation = %d\n",
- dstinfo->angle);
- GCPRINT_RECT(GCZONE_FILTER, " clipped rect", dstclipped);
-
- /* Validate the source rectangle. */
- if (!valid_rect(srcinfo->geom, &srcclipped)) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1RECT
- : BVERR_SRC2RECT,
- "invalid source rectangle.");
- goto exit;
- }
-
- /* Map the source. */
- bverror = do_map(srcinfo->buf.desc, batch, &srcmap);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- /* Map the destination. */
- bverror = do_map(dstinfo->buf.desc, batch, &dstmap);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- /* Do single pass filter if we can. */
- if (singlepass) {
- GCDBG(GCZONE_TYPE, "single pass\n");
-
- /* Determine the kernel size to use. */
- kernelsize = max(gcfilter->horkernelsize,
- gcfilter->verkernelsize);
-
- /* Set kernel size. */
- bverror = claim_buffer(bvbltparams, batch,
- sizeof(struct gcmovrconfigex),
- (void **) &gcmovrconfigex);
- if (bverror != BVERR_NONE)
- goto exit;
-
- gcmovrconfigex->config_ldst = gcmovrconfigex_config_ldst;
- gcmovrconfigex->config.raw = ~0U;
- gcmovrconfigex->config.reg.kernelsize = kernelsize;
- gcmovrconfigex->config.reg.mask_kernelsize
- = GCREG_VR_CONFIG_EX_MASK_FILTER_TAP_ENABLED;
-
- /* Setup single pass. */
- srcx = (srcrect->left << 16) + srcdelta.left;
- srcy = (srcrect->top << 16) + srcdelta.top;
- GCDBG(GCZONE_SRC, "src origin: 0x%08X,0x%08X\n", srcx, srcy);
-
- /* Load the horizontal filter. */
- bverror = load_filter(bvbltparams, batch,
- GC_FILTER_SYNC,
- gcfilter->horkernelsize,
- gcfilter->horscalefactor,
- srcwidth, dstwidth,
- gcmofilterkernel_horizontal_ldst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Load the vertical filter. */
- bverror = load_filter(bvbltparams, batch,
- GC_FILTER_SYNC,
- gcfilter->verkernelsize,
- gcfilter->verscalefactor,
- srcheight, dstheight,
- gcmofilterkernel_vertical_ldst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Start the operation. */
- bverror = startvr(bvbltparams, batch,
- srcmap, dstmap, srcinfo, dstinfo,
- srcx, srcy, dstadjusted,
- ROT_ANGLE_0, gcfilter->dstangle,
- GC_SCALE_OPF);
- } else if (twopass) {
- unsigned int horkernelhalf;
- unsigned int leftextra, rightextra;
- unsigned int tmprectwidth, tmprectheight;
- unsigned int tmpalignmask, dstalignmask;
- unsigned int tmpsize;
- struct surfaceinfo tmpinfo;
- struct bvsurfgeom tmpgeom;
-
- GCDBG(GCZONE_TYPE, "two pass\n");
-
- /* Initialize the temporaty surface geometry. */
- tmpgeom.structsize = sizeof(struct bvsurfgeom);
- tmpgeom.orientation = 0;
- tmpgeom.paletteformat = 0;
- tmpgeom.palette = NULL;
-
- /* Initialize the temporaty surface descriptor. */
- tmpinfo.index = -1;
- tmpinfo.geom = &tmpgeom;
- tmpinfo.angle = gcfilter->dstangle;
- tmpinfo.mirror = GCREG_MIRROR_NONE;
- tmpinfo.rop = 0;
- GCDBG(GCZONE_FILTER, "tmp angle = %d\n", tmpinfo.angle);
-
- /* Transfer blending parameters from the source to the
- * temporary buffer so that the blending would happen
- * on the second pass. */
- tmpinfo.gca = srcinfo->gca;
- srcinfo->gca = NULL;
-
- /* Determine temporary surface format. */
- if (srcinfo->format.type == BVFMT_YUV) {
- if (tmpinfo.angle == ROT_ANGLE_0) {
- GCDBG(GCZONE_FILTER,
- "tmp format = 4:2:2\n");
- tmpgeom.format = OCDFMT_YUYV;
- parse_format(bvbltparams, &tmpinfo);
- } else {
- GCDBG(GCZONE_FILTER,
- "tmp format = dst format\n");
- tmpgeom.format = dstinfo->geom->format;
- tmpinfo.format = dstinfo->format;
- }
- } else {
- GCDBG(GCZONE_FILTER,
- "tmp format = src format\n");
- tmpgeom.format = srcinfo->geom->format;
- tmpinfo.format = srcinfo->format;
- }
-
- /* Determine pixel alignment masks. */
- tmpalignmask = GC_BITS_PER_CACHELINE
- / tmpinfo.format.bitspp - 1;
- dstalignmask = GC_BITS_PER_CACHELINE
- / dstinfo->format.bitspp - 1;
-
- /* In partial filter blit cases, the vertical pass has to render
- * more pixel information to the left and to the right of the
- * temporary image so that the next pass has its necessary
- * kernel information on the edges of the image. */
- horkernelhalf = gcfilter->horkernelsize >> 1;
-
- leftextra = srcdelta.left >> 16;
- rightextra = srcwidth - (srcdelta.right >> 16);
-
- if (leftextra > horkernelhalf)
- leftextra = horkernelhalf;
-
- if (rightextra > horkernelhalf)
- rightextra = horkernelhalf;
-
- GCDBG(GCZONE_FILTER, "leftextra = %d, rightextra = %d\n",
- leftextra, rightextra);
-
- /* Determine the source origin. */
- srcx = ((srcrect->left - leftextra) << 16) + srcdelta.left;
- srcy = (srcrect->top << 16) + srcdelta.top;
- GCDBG(GCZONE_SRC, "src origin: 0x%08X,0x%08X\n", srcx, srcy);
- GCDBG(GCZONE_SRC, "src origin (int): %d,%d\n",
- srcx >> 16, srcy >> 16);
-
- /* Determine the size of the temporary rectangle. */
- tmprectwidth = leftextra + rightextra
- + ((srcdelta.right >> 16) - (srcdelta.left >> 16));
- tmprectheight = dstadjusted->bottom - dstadjusted->top;
- GCDBG(GCZONE_FILTER, "tmp rect size: %dx%d\n",
- tmprectwidth, tmprectheight);
-
- /* Determine the temporary destination coordinates. */
- switch (tmpinfo.angle) {
- case ROT_ANGLE_0:
- case ROT_ANGLE_180:
- tmpinfo.rect.left = (srcx >> 16) & tmpalignmask;
- tmpinfo.rect.top = 0;
- tmpinfo.rect.right = tmpinfo.rect.left + tmprectwidth;
- tmpinfo.rect.bottom = tmprectheight;
-
- tmpgeom.width = (tmpinfo.rect.right + tmpalignmask)
- & ~tmpalignmask;
- tmpgeom.height = tmprectheight;
-
- tmpinfo.physwidth = tmpgeom.width;
- tmpinfo.physheight = tmpgeom.height;
- break;
-
- case ROT_ANGLE_90:
- tmpinfo.rect.left = 0;
- tmpinfo.rect.top = dstadjusted->left & dstalignmask;
- tmpinfo.rect.right = tmprectwidth;
- tmpinfo.rect.bottom = tmpinfo.rect.top + tmprectheight;
-
- tmpgeom.width = tmprectwidth;
- tmpgeom.height = (tmpinfo.rect.bottom + tmpalignmask)
- & ~tmpalignmask;
-
- tmpinfo.physwidth = tmpgeom.height;
- tmpinfo.physheight = tmpgeom.width;
- break;
-
- case ROT_ANGLE_270:
- tmpinfo.rect.left = 0;
- tmpinfo.rect.right = tmprectwidth;
- tmpinfo.rect.bottom = dstadjusted->left & dstalignmask;
-
- tmpgeom.width = tmprectwidth;
- tmpgeom.height = (tmpinfo.rect.bottom + tmprectheight
- + tmpalignmask) & ~tmpalignmask;
-
- tmpinfo.rect.bottom = tmpgeom.height
- - tmpinfo.rect.bottom;
- tmpinfo.rect.top = tmpinfo.rect.bottom
- - tmprectheight;
-
- tmpinfo.physwidth = tmpgeom.height;
- tmpinfo.physheight = tmpgeom.width;
- break;
- }
-
- GCPRINT_RECT(GCZONE_DEST, "tmp dest", &tmpinfo.rect);
- GCDBG(GCZONE_FILTER, "tmp geometry size = %dx%d\n",
- tmpgeom.width, tmpgeom.height);
- GCDBG(GCZONE_FILTER, "tmp physical size = %dx%d\n",
- tmpinfo.physwidth, tmpinfo.physheight);
-
- /* Determine the size of the temporaty surface. */
- tmpgeom.virtstride = (tmpinfo.physwidth
- * tmpinfo.format.bitspp) / 8;
- tmpsize = tmpgeom.virtstride * tmpinfo.physheight;
- tmpsize += GC_BYTES_PER_CACHELINE;
- tmpsize = (tmpsize + ~PAGE_MASK) & PAGE_MASK;
- GCDBG(GCZONE_FILTER, "tmp stride = %d\n", tmpgeom.virtstride);
- GCDBG(GCZONE_FILTER, "tmp size (bytes) = %d\n", tmpsize);
-
- /* Allocate the temporary buffer. */
- bverror = allocate_temp(bvbltparams, tmpsize);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Map the temporary buffer. */
- tmpinfo.buf.desc = gccontext->tmpbuffdesc;
- bverror = do_map(tmpinfo.buf.desc, batch, &tmpmap);
- if (bverror != BVERR_NONE) {
- bvbltparams->errdesc = gccontext->bverrorstr;
- goto exit;
- }
-
- /* Compute the temp buffer alignments needed to compensate
- * for the surface base address misalignment if any. */
- tmpinfo.xpixalign = 0;
- tmpinfo.ypixalign = 0;
- tmpinfo.bytealign = (get_pixel_offset(&tmpinfo, 0)
- * (int) tmpinfo.format.bitspp) / 8;
- GCDBG(GCZONE_SRC, "tmp offset (pixels) = %d,%d\n",
- tmpinfo.xpixalign, tmpinfo.ypixalign);
- GCDBG(GCZONE_SRC, "tmp offset (bytes) = %d\n",
- tmpinfo.bytealign);
-
- /* Load the vertical filter. */
- bverror = load_filter(bvbltparams, batch,
- GC_FILTER_SYNC,
- gcfilter->verkernelsize,
- gcfilter->verscalefactor,
- srcheight, dstheight,
- gcmofilterkernel_shared_ldst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Start the operation. */
- GCDBG(GCZONE_TYPE, "vertical pass\n");
- bverror = startvr(bvbltparams, batch,
- srcmap, tmpmap, srcinfo, &tmpinfo,
- srcx, srcy, &tmpinfo.rect,
- ROT_ANGLE_0, tmpinfo.angle,
- GC_SCALE_VER);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Fake no rotation. */
- adjangle = (4 - tmpinfo.angle) % 4;
- GCDBG(GCZONE_DEST, "adjangle = %d\n", adjangle);
-
- /* Rotate the source rectangle to 0 degree. */
- rotate_gcrect(adjangle,
- tmpinfo.geom, &tmpinfo.rect,
- tmpinfo.geom, &tmpinfo.rect);
- GCPRINT_RECT(GCZONE_DEST, "tmp src", &tmpinfo.rect);
-
- /* Rotate the destination rectangle to 0 degree. */
- rotate_gcrect(adjangle,
- &gcfilter->dstgeom, dstclipped,
- &dstrotated0geom, &dstrotated0);
- GCPRINT_RECT(GCZONE_DEST, "dest", &dstrotated0);
-
- /* Apply adjustment. */
- dstrotated0.left -= dstinfo->xpixalign;
- dstrotated0.right -= dstinfo->xpixalign;
-
- /* Determine the source origin. */
- switch (tmpinfo.angle) {
- case ROT_ANGLE_0:
- srcx = ((tmpinfo.rect.left + leftextra) << 16)
- + (srcdelta.left & 0xFFFF);
- srcy = (tmpinfo.rect.top << 16)
- + (srcdelta.top & 0xFFFF);
- break;
-
- case ROT_ANGLE_90:
- srcx = (tmpinfo.rect.left << 16)
- + (srcdelta.top & 0xFFFF);
- srcy = ((tmpinfo.rect.top + rightextra) << 16)
- + (srcdelta.left & 0xFFFF);
- break;
-
- case ROT_ANGLE_180:
- srcx = ((tmpinfo.rect.left + rightextra) << 16)
- + (srcdelta.left & 0xFFFF);
- srcy = (tmpinfo.rect.top << 16)
- + (srcdelta.top & 0xFFFF);
- break;
-
- case ROT_ANGLE_270:
- srcx = (tmpinfo.rect.left << 16)
- + (srcdelta.top & 0xFFFF);
- srcy = ((tmpinfo.rect.top + leftextra) << 16)
- + (srcdelta.left & 0xFFFF);
- break;
- }
-
- GCDBG(GCZONE_SRC, "src origin: 0x%08X,0x%08X\n", srcx, srcy);
-
- /* Load the horizontal filter. */
- bverror = load_filter(bvbltparams, batch,
- GC_FILTER_SYNC,
- gcfilter->horkernelsize,
- gcfilter->horscalefactor,
- srcwidth, dstwidth,
- gcmofilterkernel_shared_ldst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Start the operation. */
- GCDBG(GCZONE_TYPE, "horizontal pass\n");
- bverror = startvr(bvbltparams, batch,
- tmpmap, dstmap, &tmpinfo, dstinfo,
- srcx, srcy, &dstrotated0,
- ROT_ANGLE_0, ROT_ANGLE_0,
- ((gcfilter->dstangle % 2) == 0)
- ? GC_SCALE_HOR
- : GC_SCALE_HOR_FLIPPED);
- if (bverror != BVERR_NONE)
- goto exit;
- } else {
- GCDBG(GCZONE_TYPE, "two pass (%s pass config).\n",
- scalex ? "horizontal" : "vertical");
-
- /* Setup single pass. */
- srcx = (srcrect->left << 16) + srcdelta.left;
- srcy = (srcrect->top << 16) + srcdelta.top;
- GCDBG(GCZONE_SRC, "src origin: 0x%08X,0x%08X\n", srcx, srcy);
-
- if (scalex) {
- /* Load the horizontal filter. */
- bverror = load_filter(bvbltparams, batch,
- GC_FILTER_SYNC,
- gcfilter->horkernelsize,
- gcfilter->horscalefactor,
- srcwidth, dstwidth,
- gcmofilterkernel_shared_ldst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Start the operation. */
- bverror = startvr(bvbltparams, batch,
- srcmap, dstmap, srcinfo, dstinfo,
- srcx, srcy, dstadjusted,
- ROT_ANGLE_0, gcfilter->dstangle,
- GC_SCALE_HOR);
- if (bverror != BVERR_NONE)
- goto exit;
- } else {
- /* Load the vertical filter. */
- bverror = load_filter(bvbltparams, batch,
- GC_FILTER_SYNC,
- gcfilter->verkernelsize,
- gcfilter->verscalefactor,
- srcheight, dstheight,
- gcmofilterkernel_shared_ldst);
- if (bverror != BVERR_NONE)
- goto exit;
-
- /* Start the operation. */
- bverror = startvr(bvbltparams, batch,
- srcmap, dstmap, srcinfo, dstinfo,
- srcx, srcy, dstadjusted,
- ROT_ANGLE_0, gcfilter->dstangle,
- GC_SCALE_VER);
- if (bverror != BVERR_NONE)
- goto exit;
- }
- }
-
-exit:
- GCEXITARG(GCZONE_FILTER, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
diff --git a/bltsville/gcbv/mirror/gcmap.c b/bltsville/gcbv/mirror/gcmap.c
deleted file mode 100644
index 3f2b3f3..0000000
--- a/bltsville/gcbv/mirror/gcmap.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_MAPPING (1 << 0)
-
-GCDBG_FILTERDEF(map, GCZONE_NONE,
- "mapping")
-
-
-/*******************************************************************************
- * Memory management.
- */
-
-enum bverror do_map(struct bvbuffdesc *bvbuffdesc,
- struct gcbatch *batch,
- struct bvbuffmap **map)
-{
- static const int mapsize
- = sizeof(struct bvbuffmap)
- + sizeof(struct bvbuffmapinfo);
-
- enum bverror bverror;
- struct gccontext *gccontext = get_context();
- struct bvbuffmap *bvbuffmap;
- struct bvbuffmapinfo *bvbuffmapinfo;
- struct bvphysdesc *bvphysdesc;
- bool mappedbyothers;
- struct gcimap gcimap;
- struct gcschedunmap *gcschedunmap;
-
- GCENTERARG(GCZONE_MAPPING, "bvbuffdesc = 0x%08X\n",
- (unsigned int) bvbuffdesc);
-
- /* Lock access to the mapping list. */
- GCLOCK(&gccontext->maplock);
-
- /* Try to find existing mapping. */
- bvbuffmap = bvbuffdesc->map;
- while (bvbuffmap != NULL) {
- if (bvbuffmap->bv_unmap == bv_unmap)
- break;
- bvbuffmap = bvbuffmap->nextmap;
- }
-
- /* Not mapped yet? */
- if (bvbuffmap == NULL) {
- /* New mapping, allocate a record. */
- if (gccontext->buffmapvac == NULL) {
- bvbuffmap = gcalloc(struct bvbuffmap, mapsize);
- if (bvbuffmap == NULL) {
- BVSETERROR(BVERR_OOM,
- "failed to allocate mapping record");
- goto fail;
- }
-
- bvbuffmap->structsize = sizeof(struct bvbuffmap);
- bvbuffmap->bv_unmap = bv_unmap;
- bvbuffmap->handle = (unsigned long) (bvbuffmap + 1);
- } else {
- bvbuffmap = gccontext->buffmapvac;
- gccontext->buffmapvac = bvbuffmap->nextmap;
- }
-
- /* Setup buffer mapping. Here we need to check and make sure
- * that the buffer starts at a location that is supported by
- * the hw. If it is not, offset is computed and the buffer is
- * extended by the value of the offset. */
- gcimap.gcerror = GCERR_NONE;
- gcimap.handle = 0;
-
- if (bvbuffdesc->auxtype == BVAT_PHYSDESC) {
- bvphysdesc = (struct bvphysdesc *) bvbuffdesc->auxptr;
-
- if (bvphysdesc->structsize <
- STRUCTSIZE(bvphysdesc, pageoffset)) {
- BVSETERROR(BVERR_BUFFERDESC_VERS,
- "unsupported bvphysdesc version");
- goto fail;
- }
-
- gcimap.buf.offset = bvphysdesc->pageoffset;
- gcimap.pagesize = bvphysdesc->pagesize;
- gcimap.pagearray = bvphysdesc->pagearray;
- gcimap.size = bvbuffdesc->length;
-
- GCDBG(GCZONE_MAPPING, "new mapping (%s):\n",
- (batch == NULL) ? "explicit" : "implicit");
- GCDBG(GCZONE_MAPPING, "pagesize = %lu\n",
- bvphysdesc->pagesize);
- GCDBG(GCZONE_MAPPING, "pagearray = 0x%08X\n",
- (unsigned int) bvphysdesc->pagearray);
- GCDBG(GCZONE_MAPPING, "pageoffset = %lu\n",
- bvphysdesc->pageoffset);
- GCDBG(GCZONE_MAPPING, "mapping size = %d\n",
- gcimap.size);
- } else {
- gcimap.buf.logical = bvbuffdesc->virtaddr;
- gcimap.pagesize = 0;
- gcimap.pagearray = NULL;
- gcimap.size = bvbuffdesc->length;
-
- GCDBG(GCZONE_MAPPING, "new mapping (%s):\n",
- (batch == NULL) ? "explicit" : "implicit");
- GCDBG(GCZONE_MAPPING, "specified virtaddr = 0x%08X\n",
- (unsigned int) bvbuffdesc->virtaddr);
- GCDBG(GCZONE_MAPPING, "aligned virtaddr = 0x%08X\n",
- (unsigned int) gcimap.buf.logical);
- GCDBG(GCZONE_MAPPING, "mapping size = %d\n",
- gcimap.size);
- }
-
- gc_map_wrapper(&gcimap);
- if (gcimap.gcerror != GCERR_NONE) {
- BVSETERROR(BVERR_OOM,
- "unable to allocate gccore memory");
- goto fail;
- }
-
- /* Set map handle. */
- bvbuffmapinfo = (struct bvbuffmapinfo *) bvbuffmap->handle;
- bvbuffmapinfo->handle = gcimap.handle;
-
- /* Initialize reference counters. */
- if (batch == NULL) {
- /* Explicit mapping. */
- bvbuffmapinfo->usermap = 1;
- bvbuffmapinfo->automap = 0;
- } else {
- /* Implicit mapping; if there are existing mappings
- * from other implementations, mark this an explicit
- * mapping as well. */
- mappedbyothers = (bvbuffdesc->map != NULL);
- GCDBG(GCZONE_MAPPING, "%smapped by others.\n",
- mappedbyothers ? "" : "not ");
-
- bvbuffmapinfo->usermap = mappedbyothers ? 1 : 0;
- bvbuffmapinfo->automap = 1;
- }
-
- /* Add the record to the list of mappings. */
- bvbuffmap->nextmap = bvbuffdesc->map;
- bvbuffdesc->map = bvbuffmap;
- } else {
- /* Mapping already exists. */
- bvbuffmapinfo = (struct bvbuffmapinfo *) bvbuffmap->handle;
-
- /* Advance reference counters. */
- if (batch == NULL) {
- /* Explicit mapping. */
- GCDBG(GCZONE_MAPPING, "explicit map.\n");
- bvbuffmapinfo->usermap += 1;
- } else {
- /* Implicit mapping. */
- GCDBG(GCZONE_MAPPING, "implicit map.\n");
- bvbuffmapinfo->automap += 1;
- }
-
- GCDBG(GCZONE_MAPPING, "mapping exists.\n");
- }
-
- GCDBG(GCZONE_MAPPING, "bvbuffmap = 0x%08X\n",
- (unsigned int) bvbuffmap);
- GCDBG(GCZONE_MAPPING, "explicit count = %d\n",
- bvbuffmapinfo->usermap);
- GCDBG(GCZONE_MAPPING, "implicit count = %d\n",
- bvbuffmapinfo->automap);
-
- /* Schedule for unmapping. */
- if (batch != NULL) {
- if (list_empty(&gccontext->unmapvac)) {
- gcschedunmap = gcalloc(struct gcschedunmap,
- sizeof(struct gcschedunmap));
- if (gcschedunmap == NULL) {
- BVSETERROR(BVERR_OOM,
- "failed to schedule unmapping");
- goto fail;
- }
- list_add(&gcschedunmap->link, &batch->unmap);
- } else {
- struct list_head *head;
- head = gccontext->unmapvac.next;
- gcschedunmap = list_entry(head,
- struct gcschedunmap,
- link);
- list_move(&gcschedunmap->link, &batch->unmap);
- }
-
- gcschedunmap->handle = (unsigned long) bvbuffdesc;
-
- GCDBG(GCZONE_MAPPING, "scheduled for unmapping.\n");
- }
-
- /* Set the map pointer. */
- *map = bvbuffmap;
-
- /* Unlock access to the mapping list. */
- GCUNLOCK(&gccontext->maplock);
-
- GCEXITARG(GCZONE_MAPPING, "handle = 0x%08X\n",
- bvbuffmapinfo->handle);
- return BVERR_NONE;
-
-fail:
- if (bvbuffmap != NULL) {
- bvbuffmap->nextmap = gccontext->buffmapvac;
- gccontext->buffmapvac = bvbuffmap;
- }
-
- /* Unlock access to the mapping list. */
- GCUNLOCK(&gccontext->maplock);
-
- GCEXITARG(GCZONE_MAPPING, "bverror = %d\n", bverror);
- return bverror;
-}
-
-void do_unmap_implicit(struct gcbatch *batch)
-{
- struct gccontext *gccontext = get_context();
- struct list_head *head, *temphead;
- struct gcschedunmap *gcschedunmap;
- struct bvbuffdesc *bvbuffdesc;
- struct bvbuffmap *prev, *bvbuffmap;
- struct bvbuffmapinfo *bvbuffmapinfo;
-
- GCENTER(GCZONE_MAPPING);
-
- /* Lock access to the mapping list. */
- GCLOCK(&gccontext->maplock);
-
- /* Scan scheduled unmappings and remove the ones that are still
- * in use. */
- list_for_each_safe(head, temphead, &batch->unmap) {
- gcschedunmap = list_entry(head, struct gcschedunmap, link);
-
- /* Cast the handle. */
- bvbuffdesc = (struct bvbuffdesc *) gcschedunmap->handle;
-
- /* Find our mapping. */
- prev = NULL;
- bvbuffmap = bvbuffdesc->map;
- while (bvbuffmap != NULL) {
- if (bvbuffmap->bv_unmap == bv_unmap)
- break;
- prev = bvbuffmap;
- bvbuffmap = bvbuffmap->nextmap;
- }
-
- /* Not found? */
- if (bvbuffmap == NULL) {
- GCERR("mapping not found for bvbuffdesc 0x%08X.\n",
- (unsigned int) bvbuffdesc);
-
- /* Remove scheduled unmapping. */
- list_move(head, &gccontext->unmapvac);
- continue;
- }
-
- /* Get the info structure. */
- bvbuffmapinfo = (struct bvbuffmapinfo *) bvbuffmap->handle;
-
- GCDBG(GCZONE_MAPPING, "head = 0x%08X\n",
- (unsigned int) gcschedunmap);
- GCDBG(GCZONE_MAPPING, " bvbuffmap = 0x%08X\n",
- (unsigned int) bvbuffmap);
- GCDBG(GCZONE_MAPPING, " handle = 0x%08X\n",
- bvbuffmapinfo->handle);
-
- /* Implicit unmapping. */
- bvbuffmapinfo->automap -= 1;
- if (bvbuffmapinfo->automap < 0) {
- GCERR("implicit count negative.\n");
- bvbuffmapinfo->automap = 0;
- }
-
- GCDBG(GCZONE_MAPPING, " explicit count = %d\n",
- bvbuffmapinfo->usermap);
- GCDBG(GCZONE_MAPPING, " implicit count = %d\n",
- bvbuffmapinfo->automap);
-
- /* Still referenced? */
- if (bvbuffmapinfo->usermap || bvbuffmapinfo->automap) {
- GCDBG(GCZONE_MAPPING, " still referenced.\n");
-
- /* Remove scheduled unmapping. */
- list_move(head, &gccontext->unmapvac);
- continue;
- }
-
- GCDBG(GCZONE_MAPPING, " ready for unmapping.\n");
-
- /* Set the handle. */
- gcschedunmap->handle = bvbuffmapinfo->handle;
-
- /* Remove from the buffer descriptor. */
- if (prev == NULL)
- bvbuffdesc->map = bvbuffmap->nextmap;
- else
- prev->nextmap = bvbuffmap->nextmap;
-
- /* Add to the vacant list. */
- bvbuffmap->nextmap = gccontext->buffmapvac;
- gccontext->buffmapvac = bvbuffmap;
- }
-
- /* Unlock access to the mapping list. */
- GCUNLOCK(&gccontext->maplock);
-
- GCEXIT(GCZONE_MAPPING);
-}
diff --git a/bltsville/gcbv/mirror/gcparser.c b/bltsville/gcbv/mirror/gcparser.c
deleted file mode 100644
index 5bfbdb6..0000000
--- a/bltsville/gcbv/mirror/gcparser.c
+++ /dev/null
@@ -1,2090 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gcbv.h"
-
-#define GCZONE_NONE 0
-#define GCZONE_ALL (~0U)
-#define GCZONE_FORMAT (1 << 0)
-#define GCZONE_FORMAT_VERBOSE (1 << 1)
-#define GCZONE_BLEND (1 << 2)
-#define GCZONE_OFFSET (1 << 3)
-#define GCZONE_DEST (1 << 4)
-#define GCZONE_SRC (1 << 5)
-#define GCZONE_SCALING (1 << 6)
-
-GCDBG_FILTERDEF(parser, GCZONE_NONE,
- "format",
- "formatverbose",
- "blend",
- "offset",
- "dest",
- "src",
- "scaling")
-
-
-/*******************************************************************************
- * Internal macros.
- */
-
-#define GCCONVERT_RECT(zone, name, bvrect, gcrect) \
-{ \
- (gcrect)->left = (bvrect)->left; \
- (gcrect)->top = (bvrect)->top; \
- (gcrect)->right = (bvrect)->left + (bvrect)->width; \
- (gcrect)->bottom = (bvrect)->top + (bvrect)->height; \
- \
- GCPRINT_RECT(zone, name, gcrect); \
-}
-
-
-/*******************************************************************************
- * Pixel format parser.
- */
-
-#define OCDFMTDEF_PLACEMENT_SHIFT 9
-#define OCDFMTDEF_PLACEMENT_MASK (3 << OCDFMTDEF_PLACEMENT_SHIFT)
-
-#define BVCOMP(Shift, Size) \
- { Shift, Size, ((1 << Size) - 1) << Shift }
-
-#define BVRED(Shift, Size) \
- BVCOMP(Shift, Size)
-
-#define BVGREEN(Shift, Size) \
- BVCOMP(Shift, Size)
-
-#define BVBLUE(Shift, Size) \
- BVCOMP(Shift, Size)
-
-#define BVALPHA(Shift, Size) \
- BVCOMP(Shift, Size)
-
-static const unsigned int rgba16swizzle[] = {
- GCREG_DE_SWIZZLE_ARGB,
- GCREG_DE_SWIZZLE_RGBA,
- GCREG_DE_SWIZZLE_ABGR,
- GCREG_DE_SWIZZLE_BGRA
-};
-
-static const unsigned int rgb16swizzle[] = {
- GCREG_DE_SWIZZLE_ARGB,
- GCREG_DE_SWIZZLE_ARGB,
- GCREG_DE_SWIZZLE_ABGR,
- GCREG_DE_SWIZZLE_ABGR
-};
-
-static const unsigned int rgba32swizzle[] = {
- GCREG_DE_SWIZZLE_BGRA,
- GCREG_DE_SWIZZLE_ABGR,
- GCREG_DE_SWIZZLE_RGBA,
- GCREG_DE_SWIZZLE_ARGB
-};
-
-static const struct bvcsrgb xrgb4444_bits[] = {
- { BVRED(8, 4), BVGREEN(4, 4), BVBLUE(0, 4), BVALPHA(12, 0) },
- { BVRED(12, 4), BVGREEN(8, 4), BVBLUE(4, 4), BVALPHA(0, 0) },
- { BVRED(0, 4), BVGREEN(4, 4), BVBLUE(8, 4), BVALPHA(12, 0) },
- { BVRED(4, 4), BVGREEN(8, 4), BVBLUE(12, 4), BVALPHA(0, 0) }
-};
-
-static const struct bvcsrgb argb4444_bits[] = {
- { BVRED(8, 4), BVGREEN(4, 4), BVBLUE(0, 4), BVALPHA(12, 4) },
- { BVRED(12, 4), BVGREEN(8, 4), BVBLUE(4, 4), BVALPHA(0, 4) },
- { BVRED(0, 4), BVGREEN(4, 4), BVBLUE(8, 4), BVALPHA(12, 4) },
- { BVRED(4, 4), BVGREEN(8, 4), BVBLUE(12, 4), BVALPHA(0, 4) }
-};
-
-static const struct bvcsrgb xrgb1555_bits[] = {
- { BVRED(10, 5), BVGREEN(5, 5), BVBLUE(0, 5), BVALPHA(15, 0) },
- { BVRED(11, 5), BVGREEN(6, 5), BVBLUE(1, 5), BVALPHA(0, 0) },
- { BVRED(0, 5), BVGREEN(5, 5), BVBLUE(10, 5), BVALPHA(15, 0) },
- { BVRED(1, 5), BVGREEN(6, 5), BVBLUE(11, 5), BVALPHA(0, 0) }
-};
-
-static const struct bvcsrgb argb1555_bits[] = {
- { BVRED(10, 5), BVGREEN(5, 5), BVBLUE(0, 5), BVALPHA(15, 1) },
- { BVRED(11, 5), BVGREEN(6, 5), BVBLUE(1, 5), BVALPHA(0, 1) },
- { BVRED(0, 5), BVGREEN(5, 5), BVBLUE(10, 5), BVALPHA(15, 1) },
- { BVRED(1, 5), BVGREEN(6, 5), BVBLUE(11, 5), BVALPHA(0, 1) }
-};
-
-static const struct bvcsrgb rgb565_bits[] = {
- { BVRED(11, 5), BVGREEN(5, 6), BVBLUE(0, 5), BVALPHA(0, 0) },
- { BVRED(11, 5), BVGREEN(5, 6), BVBLUE(0, 5), BVALPHA(0, 0) },
- { BVRED(0, 5), BVGREEN(5, 6), BVBLUE(11, 5), BVALPHA(0, 0) },
- { BVRED(0, 5), BVGREEN(5, 6), BVBLUE(11, 5), BVALPHA(0, 0) }
-};
-
-static const struct bvcsrgb xrgb8888_bits[] = {
- { BVRED(8, 8), BVGREEN(16, 8), BVBLUE(24, 8), BVALPHA(0, 0) },
- { BVRED(0, 8), BVGREEN(8, 8), BVBLUE(16, 8), BVALPHA(24, 0) },
- { BVRED(24, 8), BVGREEN(16, 8), BVBLUE(8, 8), BVALPHA(0, 0) },
- { BVRED(16, 8), BVGREEN(8, 8), BVBLUE(0, 8), BVALPHA(24, 0) }
-};
-
-static const struct bvcsrgb argb8888_bits[] = {
- { BVRED(8, 8), BVGREEN(16, 8), BVBLUE(24, 8), BVALPHA(0, 8) },
- { BVRED(0, 8), BVGREEN(8, 8), BVBLUE(16, 8), BVALPHA(24, 8) },
- { BVRED(24, 8), BVGREEN(16, 8), BVBLUE(8, 8), BVALPHA(0, 8) },
- { BVRED(16, 8), BVGREEN(8, 8), BVBLUE(0, 8), BVALPHA(24, 8) }
-};
-
-static const unsigned int container[] = {
- 8, /* OCDFMTDEF_CONTAINER_8BIT */
- 16, /* OCDFMTDEF_CONTAINER_16BIT */
- 24, /* OCDFMTDEF_CONTAINER_24BIT */
- 32, /* OCDFMTDEF_CONTAINER_32BIT */
- ~0U, /* reserved */
- 48, /* OCDFMTDEF_CONTAINER_48BIT */
- ~0U, /* reserved */
- 64 /* OCDFMTDEF_CONTAINER_64BIT */
-};
-
-enum bverror parse_format(struct bvbltparams *bvbltparams,
- struct surfaceinfo *surfaceinfo)
-{
- enum bverror bverror = BVERR_NONE;
- struct bvformatxlate *format;
- enum ocdformat ocdformat;
- unsigned int cs, std, alpha, subsample, layout;
- unsigned int reversed, leftjust, swizzle, cont, bits;
-
- format = &surfaceinfo->format;
- ocdformat = surfaceinfo->geom->format;
- GCENTERARG(GCZONE_FORMAT, "ocdformat = 0x%08X\n", ocdformat);
-
- cs = (ocdformat & OCDFMTDEF_CS_MASK)
- >> OCDFMTDEF_CS_SHIFT;
- std = (ocdformat & OCDFMTDEF_STD_MASK)
- >> OCDFMTDEF_STD_SHIFT;
- alpha = ocdformat & OCDFMTDEF_ALPHA;
- subsample = (ocdformat & OCDFMTDEF_SUBSAMPLE_MASK)
- >> OCDFMTDEF_SUBSAMPLE_SHIFT;
- layout = (ocdformat & OCDFMTDEF_LAYOUT_MASK)
- >> OCDFMTDEF_LAYOUT_SHIFT;
- cont = (ocdformat & OCDFMTDEF_CONTAINER_MASK)
- >> OCDFMTDEF_CONTAINER_SHIFT;
- bits = ((ocdformat & OCDFMTDEF_COMPONENTSIZEMINUS1_MASK)
- >> OCDFMTDEF_COMPONENTSIZEMINUS1_SHIFT) + 1;
-
- GCDBG(GCZONE_FORMAT_VERBOSE, "std = %d\n", std);
- GCDBG(GCZONE_FORMAT_VERBOSE, "cs = %d\n", cs);
- GCDBG(GCZONE_FORMAT_VERBOSE, "alpha = %d\n", alpha ? 1 : 0);
- GCDBG(GCZONE_FORMAT_VERBOSE, "subsample = %d\n", subsample);
- GCDBG(GCZONE_FORMAT_VERBOSE, "layout = %d\n", layout);
- GCDBG(GCZONE_FORMAT_VERBOSE, "cont = %d\n", cont);
- GCDBG(GCZONE_FORMAT_VERBOSE, "bits = %d\n", bits);
-
- switch (cs) {
- case (OCDFMTDEF_CS_RGB >> OCDFMTDEF_CS_SHIFT):
- GCDBG(GCZONE_FORMAT, "OCDFMTDEF_CS_RGB\n");
-
- /* Determine the swizzle. */
- swizzle = (ocdformat & OCDFMTDEF_PLACEMENT_MASK)
- >> OCDFMTDEF_PLACEMENT_SHIFT;
- GCDBG(GCZONE_FORMAT, "swizzle = %d\n", swizzle);
-
- /* RGB color space. */
- format->type = BVFMT_RGB;
-
- /* Has to be 0 for RGB. */
- if (std != 0) {
- BVSETBLTERROR(BVERR_UNK,
- "unsupported standard");
- goto exit;
- }
-
- /* Determine premultuplied or not. */
- if (alpha == OCDFMTDEF_ALPHA) {
- format->premultiplied
- = ((ocdformat & OCDFMTDEF_NON_PREMULT) == 0);
- } else {
- format->premultiplied = true;
-
- if ((ocdformat & OCDFMTDEF_FILL_EMPTY_0) != 0) {
- BVSETBLTERROR(BVERR_UNK,
- "0 filling is not supported");
- goto exit;
- }
- }
- GCDBG(GCZONE_FORMAT, "premultiplied = %d\n",
- format->premultiplied);
-
- /* No subsample support. */
- if (subsample !=
- (OCDFMTDEF_SUBSAMPLE_NONE >> OCDFMTDEF_SUBSAMPLE_SHIFT)) {
- BVSETBLTERROR(BVERR_UNK,
- "subsampling for RGB is not supported");
- goto exit;
- }
-
- /* Only packed RGB is supported. */
- if (layout !=
- (OCDFMTDEF_PACKED >> OCDFMTDEF_LAYOUT_SHIFT)) {
- BVSETBLTERROR(BVERR_UNK,
- "only packed RGBA formats are supported");
- goto exit;
- }
-
- /* Determine the format. */
- switch (bits) {
- case 12:
- format->bitspp = 16;
- format->allocbitspp = 16;
- format->swizzle = rgba16swizzle[swizzle];
-
- if (alpha == OCDFMTDEF_ALPHA) {
- format->format = GCREG_DE_FORMAT_A4R4G4B4;
- format->cs.rgb.comp = &argb4444_bits[swizzle];
- } else {
- format->format = GCREG_DE_FORMAT_X4R4G4B4;
- format->cs.rgb.comp = &xrgb4444_bits[swizzle];
- }
- break;
-
- case 15:
- format->bitspp = 16;
- format->allocbitspp = 16;
- format->swizzle = rgba16swizzle[swizzle];
-
- if (alpha == OCDFMTDEF_ALPHA) {
- format->format = GCREG_DE_FORMAT_A1R5G5B5;
- format->cs.rgb.comp = &argb1555_bits[swizzle];
- } else {
- format->format = GCREG_DE_FORMAT_X1R5G5B5;
- format->cs.rgb.comp = &xrgb1555_bits[swizzle];
- }
- break;
-
- case 16:
- if (alpha == OCDFMTDEF_ALPHA) {
- BVSETBLTERROR(BVERR_UNK,
- "alpha component is not supported"
- "for this format.");
- goto exit;
- }
-
- format->bitspp = 16;
- format->allocbitspp = 16;
- format->swizzle = rgb16swizzle[swizzle];
- format->format = GCREG_DE_FORMAT_R5G6B5;
- format->cs.rgb.comp = &rgb565_bits[swizzle];
- break;
-
- case 24:
- format->bitspp = 32;
- format->allocbitspp = 32;
- format->swizzle = rgba32swizzle[swizzle];
-
- if (alpha == OCDFMTDEF_ALPHA) {
- format->format = GCREG_DE_FORMAT_A8R8G8B8;
- format->cs.rgb.comp = &argb8888_bits[swizzle];
- } else {
- format->format = GCREG_DE_FORMAT_X8R8G8B8;
- format->cs.rgb.comp = &xrgb8888_bits[swizzle];
- }
- break;
-
- default:
- BVSETBLTERROR(BVERR_UNK,
- "unsupported bit width %d", bits);
- goto exit;
- }
-
- if (format->allocbitspp != container[cont]) {
- BVSETBLTERROR(BVERR_UNK,
- "unsupported container");
- goto exit;
- }
- break;
-
- case (OCDFMTDEF_CS_YCbCr >> OCDFMTDEF_CS_SHIFT):
- GCDBG(GCZONE_FORMAT, "OCDFMTDEF_CS_YCbCr\n");
-
- /* YUV color space. */
- format->type = BVFMT_YUV;
-
- /* Determine the swizzle. */
- reversed = ocdformat & OCDFMTDEF_REVERSED;
- leftjust = ocdformat & OCDFMTDEF_LEFT_JUSTIFIED;
- GCDBG(GCZONE_FORMAT_VERBOSE, "reversed = %d\n",
- reversed ? 1 : 0);
- GCDBG(GCZONE_FORMAT_VERBOSE, "leftjust = %d\n",
- leftjust ? 1 : 0);
-
- /* Parse the standard. */
- switch (std) {
- case OCDFMTDEF_STD_ITUR_601_YCbCr >> OCDFMTDEF_STD_SHIFT:
- GCDBG(GCZONE_FORMAT, "OCDFMTDEF_STD_ITUR_601_YCbCr\n");
- format->cs.yuv.std = GCREG_PE_CONTROL_YUV_601;
- break;
-
- case OCDFMTDEF_STD_ITUR_709_YCbCr >> OCDFMTDEF_STD_SHIFT:
- GCDBG(GCZONE_FORMAT, "OCDFMTDEF_STD_ITUR_709_YCbCr\n");
- format->cs.yuv.std = GCREG_PE_CONTROL_YUV_709;
- break;
-
- default:
- BVSETBLTERROR(BVERR_UNK,
- "unsupported color standard");
- goto exit;
- }
-
- /* Alpha is not supported. */
- if (alpha == OCDFMTDEF_ALPHA) {
- BVSETBLTERROR(BVERR_UNK,
- "alpha channel is not supported");
- goto exit;
- }
-
- format->premultiplied = true;
-
- /* Parse subsampling. */
- switch (subsample) {
- case OCDFMTDEF_SUBSAMPLE_422_YCbCr >> OCDFMTDEF_SUBSAMPLE_SHIFT:
- GCDBG(GCZONE_FORMAT, "OCDFMTDEF_SUBSAMPLE_422_YCbCr\n");
-
- /* Parse layout. */
- switch (layout) {
- case OCDFMTDEF_PACKED >> OCDFMTDEF_LAYOUT_SHIFT:
- GCDBG(GCZONE_FORMAT, "OCDFMTDEF_PACKED\n");
-
- if (container[cont] != 32) {
- BVSETBLTERROR(BVERR_UNK,
- "unsupported container");
- goto exit;
- }
-
- format->bitspp = 16;
- format->allocbitspp = 16;
- format->format = leftjust
- ? GCREG_DE_FORMAT_YUY2
- : GCREG_DE_FORMAT_UYVY;
- format->swizzle = reversed
- ? GCREG_PE_CONTROL_UV_SWIZZLE_VU
- : GCREG_PE_CONTROL_UV_SWIZZLE_UV;
- format->cs.yuv.planecount = 1;
- format->cs.yuv.xsample = 2;
- format->cs.yuv.ysample = 1;
- break;
-
- default:
- BVSETBLTERROR(BVERR_UNK,
- "specified 4:2:2 layout "
- "is not supported");
- goto exit;
- }
- break;
-
- case OCDFMTDEF_SUBSAMPLE_420_YCbCr >> OCDFMTDEF_SUBSAMPLE_SHIFT:
-
- /* Parse layout. */
- switch (layout) {
- case OCDFMTDEF_2_PLANE_YCbCr
- >> OCDFMTDEF_LAYOUT_SHIFT:
- GCDBG(GCZONE_FORMAT,
- "OCDFMTDEF_2_PLANE_YCbCr\n");
-
- if (container[cont] != 48) {
- BVSETBLTERROR(BVERR_UNK,
- "unsupported container");
- goto exit;
- }
-
- format->bitspp = 8;
- format->allocbitspp = 12;
- format->format = GCREG_DE_FORMAT_NV12;
- format->swizzle = reversed
- ? GCREG_PE_CONTROL_UV_SWIZZLE_VU
- : GCREG_PE_CONTROL_UV_SWIZZLE_UV;
- format->cs.yuv.planecount = 2;
- format->cs.yuv.xsample = 2;
- format->cs.yuv.ysample = 2;
- break;
-
- case OCDFMTDEF_3_PLANE_STACKED
- >> OCDFMTDEF_LAYOUT_SHIFT:
- GCDBG(GCZONE_FORMAT,
- "OCDFMTDEF_3_PLANE_STACKED\n");
-
- if (container[cont] != 48) {
- BVSETBLTERROR(BVERR_UNK,
- "unsupported container");
- goto exit;
- }
-
- format->bitspp = 8;
- format->allocbitspp = 12;
- format->format = GCREG_DE_FORMAT_YV12;
- format->swizzle = reversed
- ? GCREG_PE_CONTROL_UV_SWIZZLE_VU
- : GCREG_PE_CONTROL_UV_SWIZZLE_UV;
- format->cs.yuv.planecount = 3;
- format->cs.yuv.xsample = 2;
- format->cs.yuv.ysample = 2;
- break;
-
- default:
- BVSETBLTERROR(BVERR_UNK,
- "specified 4:2:2 layout "
- "is not supported");
- goto exit;
- }
- break;
-
- default:
- BVSETBLTERROR(BVERR_UNK,
- "specified subsampling is not supported");
- goto exit;
- }
-
- if (format->allocbitspp != bits) {
- BVSETBLTERROR(BVERR_UNK,
- "unsupported bit width %d", bits);
- goto exit;
- }
- break;
-
- default:
- BVSETBLTERROR(BVERR_UNK,
- "unsupported color space %d", cs);
- goto exit;
- }
-
- GCDBG(GCZONE_FORMAT, "bpp = %d\n", format->bitspp);
- GCDBG(GCZONE_FORMAT, "gcformat = %d\n", format->format);
- GCDBG(GCZONE_FORMAT, "gcswizzle = %d\n", format->swizzle);
-
- bverror = BVERR_NONE;
-
-exit:
- GCEXITARG(GCZONE_FORMAT, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-
-/*******************************************************************************
- * Alpha blending parser.
- */
-
-#define BVBLENDMATCH(Mode, Inverse, Normal) \
-( \
- BVBLENDDEF_ ## Mode | \
- BVBLENDDEF_ ## Inverse | \
- BVBLENDDEF_ ## Normal \
-)
-
-#define BVSRC1USE(Use) \
- Use
-
-#define BVSRC2USE(Use) \
- Use
-
-#define BVBLENDUNDEFINED() \
- { ~0, ~0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }
-
-struct bvblendxlate {
- unsigned char match1;
- unsigned char match2;
-
- struct gcblendconfig k1;
- struct gcblendconfig k2;
-};
-
-static struct bvblendxlate blendxlate[64] = {
- /**********************************************************************/
- /* #0: color factor: 00 00 00 A:(1-C1,C1)=zero
- alpha factor: zero ==> 00 00 00 */
- {
- 0x00,
- 0x00,
-
- {
- GCREG_BLENDING_MODE_ZERO,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(false), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_ZERO,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(false), BVSRC2USE(false)
- }
- },
-
- /* #1: color factor: 00 00 01 A:(1-C1,A1)=A1
- alpha factor: A1 ==> 00 00 01 or 00 10 01 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A1),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A1),
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #2: color factor: 00 00 10 A:(1-C1,C2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #3: color factor: 00 00 11 A:(1-C1,A2)=A2
- alpha factor: A2 ==> 00 00 11 or 00 10 11 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A2),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A2),
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #4: color factor: 00 01 00 A:(1-A1,C1)=1-A1
- alpha factor: 1-A1 ==> 00 01 00 or 00 01 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #5: color factor: 00 01 01 A:(1-A1,A1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #6: color factor: 00 01 10 A:(1-A1,C2)=1-A1
- alpha factor: 1-A1 ==> 00 01 00 or 00 01 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #7: color factor: 00 01 11 A:(1-A1,A2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #8: color factor: 00 10 00 A:(1-C2,C1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #9: color factor: 00 10 01 A:(1-C2,A1)=A1
- alpha factor: A1 ==> 00 00 01 or 00 10 01 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A1),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A1),
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #10: color factor: 00 10 10 A:(1-C2,C2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #11: color factor: 00 10 11 A:(1-C2,A2)=A2
- alpha factor: A2 ==> 00 00 11 or 00 10 11 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A2),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A2),
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_NORMAL,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #12: color factor: 00 11 00 A:(1-A2,C1)=1-A2
- alpha factor: 1-A2 ==> 00 11 00 or 00 11 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #13: color factor: 00 11 01 A:(1-A2,A1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #14: color factor: 00 11 10 A:(1-A2,C2)=1-A2
- alpha factor: 1-A2 ==> 00 11 00 or 00 11 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #15: color factor: 00 11 11 A:(1-A2,A2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /**********************************************************************/
- /* #16: color factor: 01 00 00 MIN:(1-C1,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #17: color factor: 01 00 01 MIN:(1-C1,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #18: color factor: 01 00 10 MIN:(1-C1,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #19: color factor: 01 00 11 MIN:(1-C1,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #20: color factor: 01 01 00 MIN:(1-A1,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #21: color factor: 01 01 01 MIN:(1-A1,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #22: color factor: 01 01 10 MIN:(1-A1,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #23: color factor: 01 01 11 MIN:(1-A1,A2)
- alpha factor: one ==> 11 11 11 */
- {
- 0x3F,
- 0x3F,
-
- {
- GCREG_BLENDING_MODE_SATURATED_DEST_ALPHA,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_SATURATED_ALPHA,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #24: color factor: 01 10 00 MIN:(1-C2,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #25: color factor: 01 10 01 MIN:(1-C2,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #26: color factor: 01 10 10 MIN:(1-C2,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #27: color factor: 01 10 11 MIN:(1-C2,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #28: color factor: 01 11 00 MIN:(1-A2,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #29: color factor: 01 11 01 MIN:(1-A2,A1)
- alpha factor: one ==> 11 11 11 */
- {
- 0x3F,
- 0x3F,
-
- {
- GCREG_BLENDING_MODE_SATURATED_ALPHA,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_SATURATED_DEST_ALPHA,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #30: color factor: 01 11 10 MIN:(1-A2,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #31: color factor: 01 11 11 MIN:(1-A2,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /**********************************************************************/
- /* #32: color factor: 10 00 00 MAX:(1-C1,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #33: color factor: 10 00 01 MAX:(1-C1,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #34: color factor: 10 00 10 MAX:(1-C1,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #35: color factor: 10 00 11 MAX:(1-C1,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #36: color factor: 10 01 00 MAX:(1-A1,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #37: color factor: 10 01 01 MAX:(1-A1,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #38: color factor: 10 01 10 MAX:(1-A1,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #39: color factor: 10 01 11 MAX:(1-A1,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #40: color factor: 10 10 00 MAX:(1-C2,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #41: color factor: 10 10 01 MAX:(1-C2,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #42: color factor: 10 10 10 MAX:(1-C2,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #43: color factor: 10 10 11 MAX:(1-C2,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #44: color factor: 10 11 00 MAX:(1-A2,C1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #45: color factor: 10 11 01 MAX:(1-A2,A1) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #46: color factor: 10 11 10 MAX:(1-A2,C2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #47: color factor: 10 11 11 MAX:(1-A2,A2) ==> not supported
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /**********************************************************************/
- /* #48: color factor: 11 00 00 C:(1-C1,C1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #49: color factor: 11 00 01 C:(1-C1,A1)=1-C1
- alpha factor: 1-A1 ==> 00 01 00 or 00 01 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #50: color factor: 11 00 10 C:(1-C1,C2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #51: color factor: 11 00 11 C:(1-C1,A2)=1-C1
- alpha factor: 1-A1 ==> 00 01 00 or 00 01 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A1, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #52: color factor: 11 01 00 C:(1-A1,C1)=C1
- alpha factor: A1 ==> 00 00 01 or 00 10 01 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A1),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A1),
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #53: color factor: 11 01 01 C:(1-A1,A1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #54: color factor: 11 01 10 C:(1-A1,C2)=C2
- alpha factor: A2 ==> 00 00 11 or 00 10 11 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A2),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A2),
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #55: color factor: 11 01 11 C:(1-A1,A2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #56: color factor: 11 10 00 C:(1-C2,C1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #57: color factor: 11 10 01 C:(1-C2,A1)=1-C2
- alpha factor: 1-A2 ==> 00 11 00 or 00 11 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #58: color factor: 11 10 10 C:(1-C2,C2)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #59: color factor: 11 10 11 C:(1-C2,A2)=1-C2
- alpha factor: 1-A2 ==> 00 11 00 or 00 11 10 */
- {
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C1),
- BVBLENDMATCH(ONLY_A, INV_A2, NORM_C2),
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR_INVERSED,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(false)
- }
- },
-
- /* #60: color factor: 11 11 00 C:(1-A2,C1)=C1
- alpha factor: A1 ==> 00 00 01 or 00 10 01 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A1),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A1),
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- }
- },
-
- /* #61: color factor: 11 11 01 C:(1-A2,A1)=undefined
- alpha factor: N/A */
- BVBLENDUNDEFINED(),
-
- /* #62: color factor: 11 11 10 C:(1-A2,C2)=C2
- alpha factor: A2 ==> 00 00 11 or 00 10 11 */
- {
- BVBLENDMATCH(ONLY_A, INV_C1, NORM_A2),
- BVBLENDMATCH(ONLY_A, INV_C2, NORM_A2),
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(true)
- },
-
- {
- GCREG_BLENDING_MODE_COLOR,
- GCREG_FACTOR_INVERSE_ENABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- },
-
- /* #63: color factor: 11 11 11 C:(1-A2,A2)=one
- alpha factor: one ==> 11 11 11 */
- {
- 0x3F,
- 0x3F,
-
- {
- GCREG_BLENDING_MODE_ONE,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(true), BVSRC2USE(false)
- },
-
- {
- GCREG_BLENDING_MODE_ONE,
- GCREG_FACTOR_INVERSE_DISABLE,
- BVSRC1USE(false), BVSRC2USE(true)
- }
- }
-};
-
-enum bverror parse_blend(struct bvbltparams *bvbltparams,
- enum bvblend blend,
- struct gcalpha *gca)
-{
- enum bverror bverror;
- unsigned int global;
- unsigned int k1, k2, k3, k4;
- struct bvblendxlate *k1_xlate;
- struct bvblendxlate *k2_xlate;
- unsigned int alpha;
-
- GCENTERARG(GCZONE_BLEND, "blend = 0x%08X (%s)\n",
- blend, gc_bvblend_name(blend));
-
- if ((blend & BVBLENDDEF_REMOTE) != 0) {
- BVSETBLTERROR(BVERR_BLEND, "remote alpha not supported");
- goto exit;
- }
-
- global = (blend & BVBLENDDEF_GLOBAL_MASK) >> BVBLENDDEF_GLOBAL_SHIFT;
-
- switch (global) {
- case (BVBLENDDEF_GLOBAL_NONE >> BVBLENDDEF_GLOBAL_SHIFT):
- GCDBG(GCZONE_BLEND, "BVBLENDDEF_GLOBAL_NONE\n");
-
- gca->src_global_color =
- gca->dst_global_color = 0;
-
- gca->src_global_alpha_mode = GCREG_GLOBAL_ALPHA_MODE_NORMAL;
- gca->dst_global_alpha_mode = GCREG_GLOBAL_ALPHA_MODE_NORMAL;
- break;
-
- case (BVBLENDDEF_GLOBAL_UCHAR >> BVBLENDDEF_GLOBAL_SHIFT):
- GCDBG(GCZONE_BLEND, "BVBLENDDEF_GLOBAL_UCHAR\n");
-
- gca->src_global_color =
- gca->dst_global_color =
- ((unsigned int) bvbltparams->globalalpha.size8) << 24;
-
- gca->src_global_alpha_mode = GCREG_GLOBAL_ALPHA_MODE_GLOBAL;
- gca->dst_global_alpha_mode = GCREG_GLOBAL_ALPHA_MODE_GLOBAL;
- break;
-
- case (BVBLENDDEF_GLOBAL_FLOAT >> BVBLENDDEF_GLOBAL_SHIFT):
- GCDBG(GCZONE_BLEND, "BVBLENDDEF_GLOBAL_FLOAT\n");
-
- alpha = gcfp2norm8(bvbltparams->globalalpha.fp);
-
- gca->src_global_color =
- gca->dst_global_color = alpha << 24;
-
- gca->src_global_alpha_mode = GCREG_GLOBAL_ALPHA_MODE_GLOBAL;
- gca->dst_global_alpha_mode = GCREG_GLOBAL_ALPHA_MODE_GLOBAL;
- break;
-
- default:
- BVSETBLTERROR(BVERR_BLEND, "invalid global alpha mode");
- goto exit;
- }
-
- /*
- Co = k1 x C1 + k2 x C2
- Ao = k3 x A1 + k4 x A2
- */
-
- k1 = (blend >> 18) & 0x3F;
- k2 = (blend >> 12) & 0x3F;
- k3 = (blend >> 6) & 0x3F;
- k4 = blend & 0x3F;
-
- GCDBG(GCZONE_BLEND, "k1 = %d\n", k1);
- GCDBG(GCZONE_BLEND, "k2 = %d\n", k2);
- GCDBG(GCZONE_BLEND, "k3 = %d\n", k3);
- GCDBG(GCZONE_BLEND, "k4 = %d\n", k4);
-
- k1_xlate = &blendxlate[k1];
- k2_xlate = &blendxlate[k2];
-
- if (((k3 != k1_xlate->match1) && (k3 != k1_xlate->match2)) ||
- ((k4 != k2_xlate->match1) && (k4 != k2_xlate->match2))) {
- BVSETBLTERROR(BVERR_BLEND,
- "not supported coefficient combination");
- goto exit;
- }
-
- gca->k1 = &k1_xlate->k1;
- gca->k2 = &k2_xlate->k2;
-
- gca->src1used = gca->k1->src1used | gca->k2->src1used;
- gca->src2used = gca->k1->src2used | gca->k2->src2used;
-
- bverror = BVERR_NONE;
-
-exit:
- GCEXITARG(BVERR_BLEND, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-
-/*******************************************************************************
- * Rotation and mirror.
- */
-
-#define BVFLAG_FLIP_MASK 0x00000003
-
-#define BVFLAG_FLIP_SRC1_SHIFT 14
-#define BVFLAG_FLIP_SRC2_SHIFT 16
-#define BVFLAG_FLIP_MASK_SHIFT 18
-
-#define GCREG_MIRROR_NONE 0x0
-#define GCREG_MIRROR_X 0x1
-#define GCREG_MIRROR_Y 0x2
-#define GCREG_MIRROR_XY 0x3
-
-#define GCREG_ROT_ANGLE_ROT0 0x0
-#define GCREG_ROT_ANGLE_ROT90 0x4
-#define GCREG_ROT_ANGLE_ROT180 0x5
-#define GCREG_ROT_ANGLE_ROT270 0x6
-
-#define ROT_ANGLE_INVALID -1
-#define ROT_ANGLE_0 0
-#define ROT_ANGLE_90 1
-#define ROT_ANGLE_180 2
-#define ROT_ANGLE_270 3
-
-/* NOTE: BLTsville rotation is defined conunter clock wise. */
-const unsigned int rotencoding[] = {
- GCREG_ROT_ANGLE_ROT0, /* ROT_ANGLE_0 */
- GCREG_ROT_ANGLE_ROT270, /* ROT_ANGLE_90 */
- GCREG_ROT_ANGLE_ROT180, /* ROT_ANGLE_180 */
- GCREG_ROT_ANGLE_ROT90 /* ROT_ANGLE_270 */
-};
-
-static inline int get_angle(int orientation)
-{
- int angle;
-
- /* Normalize the angle. */
- angle = orientation % 360;
-
- /* Flip to positive. */
- if (angle < 0)
- angle = 360 + angle;
-
- /* Translate the angle. */
- switch (angle) {
- case 0: return ROT_ANGLE_0;
- case 90: return ROT_ANGLE_90;
- case 180: return ROT_ANGLE_180;
- case 270: return ROT_ANGLE_270;
- }
-
- /* Not supported angle. */
- return ROT_ANGLE_INVALID;
-}
-
-
-/*******************************************************************************
- * Surface compare and validation.
- */
-
-bool valid_rect(struct bvsurfgeom *bvsurfgeom, struct gcrect *gcrect)
-{
- int width, height;
-
- if ((gcrect->left < 0) || (gcrect->top < 0)) {
- GCERR("invalid rectangle origin: %d,%d.\n",
- gcrect->left, gcrect->top);
- return false;
- }
-
- width = gcrect->right - gcrect->left;
- height = gcrect->bottom - gcrect->top;
- if ((width <= 0) || (height <= 0)) {
- GCERR("invalid rectangle size: %d,%d.\n",
- width, height);
- return false;
- }
-
- if (gcrect->right > (int) bvsurfgeom->width) {
- GCERR("right coordinate (%d) exceeds surface width (%d).\n",
- gcrect->right, bvsurfgeom->width);
- return false;
- }
-
- if (gcrect->bottom > (int) bvsurfgeom->height) {
- GCERR("bottom coordinate (%d) exceeds surface height (%d).\n",
- gcrect->bottom, bvsurfgeom->height);
- return false;
- }
-
- return true;
-}
-
-static bool valid_geom(struct surfaceinfo *surfaceinfo)
-{
- unsigned int size;
- unsigned int height;
-
- /* Compute the size of the surface. */
- size = (surfaceinfo->geom->width *
- surfaceinfo->geom->height *
- surfaceinfo->format.allocbitspp) / 8;
-
- /* Make sure the size is not greater then the surface. */
- if (size > surfaceinfo->buf.desc->length) {
- GCERR("invalid geometry detected:\n");
- GCERR(" specified dimensions: %dx%d, %d bitspp\n",
- surfaceinfo->geom->width,
- surfaceinfo->geom->height,
- surfaceinfo->format.bitspp);
- GCERR(" surface size based on the dimensions: %d\n",
- size);
- GCERR(" specified surface size: %lu\n",
- surfaceinfo->buf.desc->length);
- return false;
- }
-
- /* Determine the height of the image. */
- height = ((surfaceinfo->angle % 2) == 0)
- ? surfaceinfo->geom->height
- : surfaceinfo->geom->width;
-
- /* Compute the size using the stide. */
- size = surfaceinfo->geom->virtstride * height;
-
- /* Make sure the size is not greater then the surface. */
- if (size > surfaceinfo->buf.desc->length) {
- GCERR("invalid geometry detected:\n");
- GCERR(" specified dimensions: %dx%d, %d bitspp\n",
- surfaceinfo->geom->width,
- surfaceinfo->geom->height,
- surfaceinfo->format.bitspp);
- GCERR(" physical image height = %d\n", height);
- GCERR(" image stride = %d\n", surfaceinfo->geom->virtstride);
- GCERR(" computed surface size = %d\n", size);
- GCERR(" specified surface size: %lu\n",
- surfaceinfo->buf.desc->length);
- return false;
- }
-
- return true;
-}
-
-int get_pixel_offset(struct surfaceinfo *surfaceinfo, int offset)
-{
- unsigned int alignment;
- int byteoffset;
- unsigned int alignedoffset;
- int pixeloffset;
-
- GCENTERARG(GCZONE_OFFSET, "surfaceinfo=0x%08X, offset=%d\n",
- surfaceinfo, offset);
-
- alignment = (surfaceinfo->format.type == BVFMT_YUV)
- ? (64 - 1)
- : (16 - 1);
-
- GCDBG(GCZONE_OFFSET, "bpp = %d\n", surfaceinfo->format.bitspp);
- GCDBG(GCZONE_OFFSET, "alignment = %d\n", alignment);
-
- /* Determine offset in bytes from the base modified by the
- * given offset. */
- if (surfaceinfo->buf.desc->auxtype == BVAT_PHYSDESC) {
- struct bvphysdesc *bvphysdesc;
- bvphysdesc = (struct bvphysdesc *)
- surfaceinfo->buf.desc->auxptr;
- GCDBG(GCZONE_OFFSET, "physical descriptor = 0x%08X\n",
- bvphysdesc);
- GCDBG(GCZONE_OFFSET, "first page = 0x%08X\n",
- bvphysdesc->pagearray[0]);
- GCDBG(GCZONE_OFFSET, "page offset = 0x%08X\n",
- bvphysdesc->pageoffset);
-
- byteoffset = bvphysdesc->pageoffset + offset;
- } else {
- GCDBG(GCZONE_OFFSET, "no physical descriptor.\n");
- byteoffset = (unsigned int)
- surfaceinfo->buf.desc->virtaddr + offset;
- }
-
- GCDBG(GCZONE_OFFSET, "byteoffset = %d\n", byteoffset);
-
- /* Compute the aligned offset. */
- alignedoffset = byteoffset & alignment;
-
- /* Convert to pixels. */
- pixeloffset = alignedoffset * 8 / surfaceinfo->format.bitspp;
-
- GCDBG(GCZONE_OFFSET, "alignedoffset = %d\n", alignedoffset);
- GCDBG(GCZONE_OFFSET, "pixeloffset = %d\n", -pixeloffset);
-
- GCEXIT(GCZONE_OFFSET);
- return -pixeloffset;
-}
-
-enum bverror parse_destination(struct bvbltparams *bvbltparams,
- struct gcbatch *batch)
-{
- enum bverror bverror = BVERR_NONE;
-
- GCENTER(GCZONE_DEST);
-
- GCDBG(GCZONE_DEST, "parsing destination\n");
-
- /* Did the destination surface change? */
- if ((batch->batchflags & BVBATCH_DST) != 0) {
- struct surfaceinfo *dstinfo;
-
- /* Initialize the destination descriptor. */
- dstinfo = &batch->dstinfo;
- dstinfo->index = -1;
- dstinfo->buf.desc = bvbltparams->dstdesc;
- dstinfo->geom = bvbltparams->dstgeom;
-
- /* Initialize members that are not used. */
- dstinfo->mirror = GCREG_MIRROR_NONE;
- dstinfo->rop = 0;
- dstinfo->gca = NULL;
-
- /* Parse the destination format. */
- if (parse_format(bvbltparams, dstinfo) != BVERR_NONE) {
- bverror = BVERR_DSTGEOM_FORMAT;
- goto exit;
- }
-
- /* Parse orientation. */
- dstinfo->angle = get_angle(dstinfo->geom->orientation);
- if (dstinfo->angle == ROT_ANGLE_INVALID) {
- BVSETBLTERROR(BVERR_DSTGEOM,
- "unsupported destination orientation %d.",
- dstinfo->geom->orientation);
- goto exit;
- }
-
- /* Compute the destination alignments needed to compensate
- * for the surface base address misalignment if any. */
- dstinfo->xpixalign = get_pixel_offset(dstinfo, 0);
- dstinfo->ypixalign = 0;
- dstinfo->bytealign = (dstinfo->xpixalign
- * (int) dstinfo->format.bitspp) / 8;
-
- GCDBG(GCZONE_DEST, " buffer length = %d\n",
- dstinfo->buf.desc->length);
- GCDBG(GCZONE_DEST, " rotation %d degrees.\n",
- dstinfo->angle * 90);
-
- if (dstinfo->buf.desc->auxtype == BVAT_PHYSDESC) {
- struct bvphysdesc *bvphysdesc;
- bvphysdesc = (struct bvphysdesc *)
- dstinfo->buf.desc->auxptr;
- GCDBG(GCZONE_DEST, " physical descriptor = 0x%08X\n",
- bvphysdesc);
- GCDBG(GCZONE_DEST, " first page = 0x%08X\n",
- bvphysdesc->pagearray[0]);
- GCDBG(GCZONE_DEST, " page offset = 0x%08X\n",
- bvphysdesc->pageoffset);
- } else {
- GCDBG(GCZONE_DEST, " virtual address = 0x%08X\n",
- (unsigned int) dstinfo->buf.desc->virtaddr);
- }
-
- GCDBG(GCZONE_DEST, " stride = %ld\n",
- dstinfo->geom->virtstride);
- GCDBG(GCZONE_DEST, " geometry size = %dx%d\n",
- dstinfo->geom->width, dstinfo->geom->height);
- GCDBG(GCZONE_DEST, " surface offset (pixels) = %d,%d\n",
- dstinfo->xpixalign, dstinfo->ypixalign);
- GCDBG(GCZONE_DEST, " surface offset (bytes) = %d\n",
- dstinfo->bytealign);
-
- /* Check for unsupported dest formats. */
- if ((dstinfo->format.type == BVFMT_YUV) &&
- (dstinfo->format.cs.yuv.planecount > 1)) {
- BVSETBLTERROR(BVERR_DSTGEOM_FORMAT,
- "destination format unsupported");
- goto exit;
- }
-
- /* Destination stride must be 8 pixel aligned. */
- if ((dstinfo->geom->virtstride
- & (dstinfo->format.bitspp - 1)) != 0) {
- BVSETBLTERROR(BVERR_DSTGEOM_STRIDE,
- "destination stride must be 8 pixel "
- "aligned.");
- goto exit;
- }
-
- /* Validate geometry. */
- if (!valid_geom(dstinfo)) {
- BVSETBLTERROR(BVERR_DSTGEOM,
- "destination geom exceeds surface size");
- goto exit;
- }
- }
-
- /* Did clipping/destination rects change? */
- if ((batch->batchflags & (BVBATCH_CLIPRECT |
- BVBATCH_DESTRECT |
- BVBATCH_DST)) != 0) {
- struct surfaceinfo *dstinfo;
- struct gcrect cliprect;
- struct gcrect *dstrect;
- struct gcrect *dstrectaux;
-
- /* Get a shortcut to the destination surface. */
- dstinfo = &batch->dstinfo;
-
- /* Determine destination rectangle. */
- dstrect = &dstinfo->rect;
- GCCONVERT_RECT(GCZONE_DEST,
- " rect",
- &bvbltparams->dstrect,
- dstrect);
-
- /* Determine whether aux destination is specified. */
- batch->haveaux
- = ((bvbltparams->flags & BVFLAG_SRC2_AUXDSTRECT) != 0);
- GCDBG(GCZONE_DEST, " have aux dest = %d\n", batch->haveaux);
-
- /* Is clipping rectangle specified? */
- if ((bvbltparams->flags & BVFLAG_CLIP) == BVFLAG_CLIP) {
- /* Convert the clipping rectangle. */
- GCCONVERT_RECT(GCZONE_DEST,
- " clipping",
- &bvbltparams->cliprect,
- &cliprect);
-
- if ((cliprect.left < GC_CLIP_RESET_LEFT) ||
- (cliprect.top < GC_CLIP_RESET_TOP) ||
- (cliprect.right > GC_CLIP_RESET_RIGHT) ||
- (cliprect.bottom > GC_CLIP_RESET_BOTTOM)) {
- BVSETERROR(BVERR_CLIP_RECT,
- "clip rect is invalid");
- goto exit;
- }
-
- /* Compute clipping deltas and the adjusted
- * destination rect. */
- if (cliprect.left <= dstrect->left) {
- batch->clipdelta.left = 0;
- batch->dstclipped.left = dstrect->left;
- } else {
- batch->clipdelta.left = cliprect.left
- - dstrect->left;
- batch->dstclipped.left = cliprect.left;
- }
-
- if (cliprect.top <= dstrect->top) {
- batch->clipdelta.top = 0;
- batch->dstclipped.top = dstrect->top;
- } else {
- batch->clipdelta.top = cliprect.top
- - dstrect->top;
- batch->dstclipped.top = cliprect.top;
- }
-
- if (cliprect.right >= dstrect->right) {
- batch->clipdelta.right = 0;
- batch->dstclipped.right = dstrect->right;
- } else {
- batch->clipdelta.right = cliprect.right
- - dstrect->right;
- batch->dstclipped.right = cliprect.right;
- }
-
- if (cliprect.bottom >= dstrect->bottom) {
- batch->clipdelta.bottom = 0;
- batch->dstclipped.bottom = dstrect->bottom;
- } else {
- batch->clipdelta.bottom = cliprect.bottom
- - dstrect->bottom;
- batch->dstclipped.bottom = cliprect.bottom;
- }
-
- /* Clip the aux destination. */
- if (batch->haveaux) {
- /* Convert the aux rectangle. */
- dstrectaux = &batch->dstrectaux;
- GCCONVERT_RECT(GCZONE_DEST,
- " aux rect",
- &bvbltparams->src2auxdstrect,
- dstrectaux);
-
- if (cliprect.left <= dstrectaux->left)
- batch->dstclippedaux.left
- = dstrectaux->left;
- else
- batch->dstclippedaux.left
- = cliprect.left;
-
- if (cliprect.top <= dstrectaux->top)
- batch->dstclippedaux.top
- = dstrectaux->top;
- else
- batch->dstclippedaux.top
- = cliprect.top;
-
- if (cliprect.right >= dstrectaux->right)
- batch->dstclippedaux.right
- = dstrectaux->right;
- else
- batch->dstclippedaux.right
- = cliprect.right;
-
- if (cliprect.bottom >= dstrectaux->bottom)
- batch->dstclippedaux.bottom
- = dstrectaux->bottom;
- else
- batch->dstclippedaux.bottom
- = cliprect.bottom;
- }
- } else {
- batch->clipdelta.left =
- batch->clipdelta.top =
- batch->clipdelta.right =
- batch->clipdelta.bottom = 0;
-
- batch->dstclipped = *dstrect;
- if (batch->haveaux)
- /* Convert the aux rectangle. */
- GCCONVERT_RECT(GCZONE_DEST,
- " aux rect",
- &bvbltparams->src2auxdstrect,
- &batch->dstclippedaux);
- }
-
- GCPRINT_RECT(GCZONE_DEST, " clipped dest",
- &batch->dstclipped);
-
- /* Validate the destination rectangle. */
- if (!valid_rect(dstinfo->geom, &batch->dstclipped)) {
- BVSETBLTERROR(BVERR_DSTRECT,
- "invalid destination rectangle.");
- goto exit;
- }
-
- if (batch->haveaux) {
- GCPRINT_RECT(GCZONE_DEST, " clipped aux dest",
- &batch->dstclippedaux);
-
- /* Validate the aux destination rectangle. */
- if (!valid_rect(dstinfo->geom, &batch->dstclippedaux)) {
- BVSETBLTERROR(BVERR_DSTRECT,
- "invalid aux destination "
- "rectangle.");
- goto exit;
- }
- }
-
- GCDBG(GCZONE_DEST,
- " clipping delta = (%d,%d)-(%d,%d)\n",
- batch->clipdelta.left,
- batch->clipdelta.top,
- batch->clipdelta.right,
- batch->clipdelta.bottom);
- }
-
-exit:
- GCEXITARG(GCZONE_DEST, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-void process_dest_rotation(struct bvbltparams *bvbltparams,
- struct gcbatch *batch)
-{
- GCENTER(GCZONE_DEST);
-
- /* Did clipping/destination rects change? */
- if ((batch->batchflags & (BVBATCH_CLIPRECT |
- BVBATCH_DESTRECT |
- BVBATCH_DST)) != 0) {
- struct surfaceinfo *dstinfo;
- int dstoffsetX, dstoffsetY;
-
- /* Initialize the destination descriptor. */
- dstinfo = &batch->dstinfo;
-
- switch (dstinfo->angle) {
- case ROT_ANGLE_0:
- /* Determine the origin offset. */
- dstoffsetX = dstinfo->xpixalign;
- dstoffsetY = dstinfo->ypixalign;
-
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->xpixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->ypixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = batch->dstwidth;
- dstinfo->physheight = batch->dstheight;
- break;
-
- case ROT_ANGLE_90:
- /* Determine the origin offset. */
- dstoffsetX = dstinfo->ypixalign;
- dstoffsetY = dstinfo->xpixalign;
-
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->ypixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->xpixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = dstinfo->geom->height
- - dstinfo->xpixalign;
- dstinfo->physheight = dstinfo->geom->width
- - dstinfo->ypixalign;
- break;
-
- case ROT_ANGLE_180:
- /* Determine the origin offset. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->xpixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->ypixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = batch->dstwidth;
- dstinfo->physheight = batch->dstheight;
- break;
-
- case ROT_ANGLE_270:
- /* Determine the origin offset. */
- dstoffsetX = 0;
- dstoffsetY = 0;
-
- /* Determine geometry size. */
- batch->dstwidth = dstinfo->geom->width
- - dstinfo->ypixalign;
- batch->dstheight = dstinfo->geom->height
- - dstinfo->xpixalign;
-
- /* Determine the physical size. */
- dstinfo->physwidth = dstinfo->geom->height
- - dstinfo->xpixalign;
- dstinfo->physheight = dstinfo->geom->width
- - dstinfo->ypixalign;
- break;
-
- default:
- dstoffsetX = 0;
- dstoffsetY = 0;
- }
-
- /* Compute adjusted destination rectangles. */
- batch->dstadjusted.left
- = batch->dstclipped.left
- - dstoffsetX;
- batch->dstadjusted.top
- = batch->dstclipped.top
- - dstoffsetY;
- batch->dstadjusted.right
- = batch->dstclipped.right
- - dstoffsetX;
- batch->dstadjusted.bottom
- = batch->dstclipped.bottom
- - dstoffsetY;
-
- GCPRINT_RECT(GCZONE_DEST, "adjusted dest",
- &batch->dstadjusted);
-
- GCDBG(GCZONE_DEST, "aligned geometry size = %dx%d\n",
- batch->dstwidth, batch->dstheight);
- GCDBG(GCZONE_DEST, "aligned physical size = %dx%d\n",
- dstinfo->physwidth, dstinfo->physheight);
- GCDBG(GCZONE_DEST, "origin offset (pixels) = %d,%d\n",
- dstoffsetX, dstoffsetY);
- }
-
- GCEXIT(GCZONE_DEST);
-}
-
-enum bverror parse_source(struct bvbltparams *bvbltparams,
- struct gcbatch *batch,
- struct bvrect *srcrect,
- struct surfaceinfo *srcinfo)
-{
- enum bverror bverror = BVERR_NONE;
-
- GCENTER(GCZONE_SRC);
- GCDBG(GCZONE_SRC, "parsing source #%d\n",
- srcinfo->index + 1);
-
- /* Parse the source format. */
- if (parse_format(bvbltparams, srcinfo) != BVERR_NONE) {
- bverror = (srcinfo->index == 0)
- ? BVERR_SRC1GEOM_FORMAT
- : BVERR_SRC2GEOM_FORMAT;
- goto exit;
- }
-
- /* Parse orientation. */
- srcinfo->angle = get_angle(srcinfo->geom->orientation);
- if (srcinfo->angle == ROT_ANGLE_INVALID) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1GEOM
- : BVERR_SRC2GEOM,
- "unsupported source%d orientation %d.",
- srcinfo->index + 1,
- srcinfo->geom->orientation);
- goto exit;
- }
-
- /* Determine source mirror. */
- srcinfo->mirror = (srcinfo->index == 0)
- ? (bvbltparams->flags >> BVFLAG_FLIP_SRC1_SHIFT)
- & BVFLAG_FLIP_MASK
- : (bvbltparams->flags >> BVFLAG_FLIP_SRC2_SHIFT)
- & BVFLAG_FLIP_MASK;
-
- GCDBG(GCZONE_SRC, " buffer length = %d\n", srcinfo->buf.desc->length);
- GCDBG(GCZONE_SRC, " rotation %d degrees.\n", srcinfo->angle * 90);
-
- if (srcinfo->buf.desc->auxtype == BVAT_PHYSDESC) {
- struct bvphysdesc *bvphysdesc;
- bvphysdesc = (struct bvphysdesc *) srcinfo->buf.desc->auxptr;
- GCDBG(GCZONE_SRC, " physical descriptor = 0x%08X\n",
- bvphysdesc);
- GCDBG(GCZONE_SRC, " first page = 0x%08X\n",
- bvphysdesc->pagearray[0]);
- GCDBG(GCZONE_SRC, " page offset = 0x%08X\n",
- bvphysdesc->pageoffset);
- } else {
- GCDBG(GCZONE_SRC, " virtual address = 0x%08X\n",
- (unsigned int) srcinfo->buf.desc->virtaddr);
- }
-
- GCDBG(GCZONE_SRC, " stride = %ld\n",
- srcinfo->geom->virtstride);
- GCDBG(GCZONE_SRC, " geometry size = %dx%d\n",
- srcinfo->geom->width, srcinfo->geom->height);
- GCDBG(GCZONE_SRC, " mirror = %d\n", srcinfo->mirror);
-
- /* Convert the rectangle. */
- GCCONVERT_RECT(GCZONE_SRC,
- " rect", srcrect, &srcinfo->rect);
-
- /* Source must be 8 pixel aligned. */
- if ((srcinfo->geom->virtstride
- & (srcinfo->format.bitspp - 1)) != 0) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1GEOM_STRIDE
- : BVERR_SRC2GEOM_STRIDE,
- "source stride must be 8 pixel aligned.");
- goto exit;
- }
-
- /* Planar YUV? */
- if ((srcinfo->format.type == BVFMT_YUV) &&
- (srcinfo->format.cs.yuv.planecount > 1)) {
- int xpixalign;
-
- /* Source rotation is not supported. */
- if (srcinfo->angle != ROT_ANGLE_0) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1_ROT
- : BVERR_SRC2_ROT,
- "rotation of planar YUV is "
- "not supported");
- goto exit;
- }
-
- /* Check base address alignment. */
- xpixalign = get_pixel_offset(srcinfo, 0);
- if (xpixalign != 0) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1DESC_ALIGNMENT
- : BVERR_SRC2DESC_ALIGNMENT,
- "planar YUV base address must be "
- "64 byte aligned.");
- goto exit;
- }
- }
-
- /* Validate source geometry. */
- if (!valid_geom(srcinfo)) {
- BVSETBLTERROR((srcinfo->index == 0)
- ? BVERR_SRC1GEOM
- : BVERR_SRC2GEOM,
- "source%d geom exceeds surface size.",
- srcinfo->index + 1);
- goto exit;
- }
-
-exit:
- GCEXITARG(GCZONE_SRC, "bv%s = %d\n",
- (bverror == BVERR_NONE) ? "result" : "error", bverror);
- return bverror;
-}
-
-static enum bverror parse_implicitscale(struct bvbltparams *bvbltparams,
- struct gcbatch *batch)
-{
- enum bverror bverror = BVERR_NONE;
- unsigned int quality;
- unsigned int technique;
- unsigned int imagetype;
-
- GCENTER(GCZONE_SCALING);
-
- quality = (bvbltparams->scalemode & BVSCALEDEF_QUALITY_MASK)
- >> BVSCALEDEF_QUALITY_SHIFT;
- technique = (bvbltparams->scalemode & BVSCALEDEF_TECHNIQUE_MASK)
- >> BVSCALEDEF_TECHNIQUE_SHIFT;
- imagetype = (bvbltparams->scalemode & BVSCALEDEF_TYPE_MASK)
- >> BVSCALEDEF_TYPE_SHIFT;
-
- GCDBG(GCZONE_SCALING, "quality = %d\n", quality);
- GCDBG(GCZONE_SCALING, "technique = %d\n", technique);
- GCDBG(GCZONE_SCALING, "imagetype = %d\n", imagetype);
-
- switch (quality) {
- case BVSCALEDEF_FASTEST >> BVSCALEDEF_QUALITY_SHIFT:
- batch->op.filter.horkernelsize = 3;
- batch->op.filter.verkernelsize = 3;
- break;
-
- case BVSCALEDEF_GOOD >> BVSCALEDEF_QUALITY_SHIFT:
- batch->op.filter.horkernelsize = 5;
- batch->op.filter.verkernelsize = 5;
- break;
-
- case BVSCALEDEF_BETTER >> BVSCALEDEF_QUALITY_SHIFT:
- batch->op.filter.horkernelsize = 7;
- batch->op.filter.verkernelsize = 7;
- break;
-
- case BVSCALEDEF_BEST >> BVSCALEDEF_QUALITY_SHIFT:
- batch->op.filter.horkernelsize = 9;
- batch->op.filter.verkernelsize = 9;
- break;
-
- default:
- BVSETBLTERROR(BVERR_SCALE_MODE,
- "unsupported scale quality 0x%02X", quality);
- goto exit;
- }
-
- switch (technique) {
- case BVSCALEDEF_DONT_CARE >> BVSCALEDEF_TECHNIQUE_SHIFT:
- case BVSCALEDEF_NOT_NEAREST_NEIGHBOR >> BVSCALEDEF_TECHNIQUE_SHIFT:
- break;
-
- case BVSCALEDEF_POINT_SAMPLE >> BVSCALEDEF_TECHNIQUE_SHIFT:
- batch->op.filter.horkernelsize = 1;
- batch->op.filter.verkernelsize = 1;
- break;
-
- case BVSCALEDEF_INTERPOLATED >> BVSCALEDEF_TECHNIQUE_SHIFT:
- break;
-
- default:
- BVSETBLTERROR(BVERR_SCALE_MODE,
- "unsupported scale technique %d", technique);
- goto exit;
- }
-
- switch (imagetype) {
- case 0:
- case BVSCALEDEF_PHOTO >> BVSCALEDEF_TYPE_SHIFT:
- case BVSCALEDEF_DRAWING >> BVSCALEDEF_TYPE_SHIFT:
- break;
-
- default:
- BVSETBLTERROR(BVERR_SCALE_MODE,
- "unsupported image type %d", imagetype);
- goto exit;
- }
-
- GCDBG(GCZONE_SCALING, "kernel size = %dx%d\n",
- batch->op.filter.horkernelsize,
- batch->op.filter.verkernelsize);
-
-exit:
- GCEXIT(GCZONE_SCALING);
- return bverror;
-}
-
-static enum bverror parse_explicitscale(struct bvbltparams *bvbltparams,
- struct gcbatch *batch)
-{
- enum bverror bverror = BVERR_NONE;
- unsigned int horsize;
- unsigned int versize;
-
- GCENTER(GCZONE_SCALING);
-
- horsize = (bvbltparams->scalemode & BVSCALEDEF_HORZ_MASK)
- >> BVSCALEDEF_HORZ_SHIFT;
- versize = (bvbltparams->scalemode & BVSCALEDEF_VERT_MASK)
- >> BVSCALEDEF_VERT_SHIFT;
-
- GCDBG(GCZONE_SCALING, "horsize = %d\n", horsize);
- GCDBG(GCZONE_SCALING, "versize = %d\n", versize);
-
- switch (horsize) {
- case BVSCALEDEF_NEAREST_NEIGHBOR:
- batch->op.filter.horkernelsize = 1;
- break;
-
- case BVSCALEDEF_LINEAR:
- case BVSCALEDEF_CUBIC:
- case BVSCALEDEF_3_TAP:
- batch->op.filter.horkernelsize = 3;
- break;
-
- case BVSCALEDEF_5_TAP:
- batch->op.filter.horkernelsize = 5;
- break;
-
- case BVSCALEDEF_7_TAP:
- batch->op.filter.horkernelsize = 7;
- break;
-
- case BVSCALEDEF_9_TAP:
- batch->op.filter.horkernelsize = 9;
- break;
-
- default:
- BVSETBLTERROR(BVERR_SCALE_MODE,
- "unsupported horizontal kernel size %d", horsize);
- goto exit;
- }
-
- switch (versize) {
- case BVSCALEDEF_NEAREST_NEIGHBOR:
- batch->op.filter.verkernelsize = 1;
- break;
-
- case BVSCALEDEF_LINEAR:
- case BVSCALEDEF_CUBIC:
- case BVSCALEDEF_3_TAP:
- batch->op.filter.verkernelsize = 3;
- break;
-
- case BVSCALEDEF_5_TAP:
- batch->op.filter.verkernelsize = 5;
- break;
-
- case BVSCALEDEF_7_TAP:
- batch->op.filter.verkernelsize = 7;
- break;
-
- case BVSCALEDEF_9_TAP:
- batch->op.filter.verkernelsize = 9;
- break;
-
- default:
- BVSETBLTERROR(BVERR_SCALE_MODE,
- "unsupported vertical kernel size %d", versize);
- goto exit;
- }
-
- GCDBG(GCZONE_SCALING, "kernel size = %dx%d\n",
- batch->op.filter.horkernelsize,
- batch->op.filter.verkernelsize);
-
-exit:
- GCEXIT(GCZONE_SCALING);
- return bverror;
-}
-
-enum bverror parse_scalemode(struct bvbltparams *bvbltparams,
- struct gcbatch *batch)
-{
- enum bverror bverror;
- unsigned int scaleclass;
-
- GCENTER(GCZONE_SCALING);
-
- scaleclass = (bvbltparams->scalemode & BVSCALEDEF_CLASS_MASK)
- >> BVSCALEDEF_CLASS_SHIFT;
-
- GCDBG(GCZONE_SCALING, "scaleclass = %d\n", scaleclass);
-
- switch (scaleclass) {
- case BVSCALEDEF_IMPLICIT >> BVSCALEDEF_CLASS_SHIFT:
- bverror = parse_implicitscale(bvbltparams, batch);
- break;
-
- case BVSCALEDEF_EXPLICIT >> BVSCALEDEF_CLASS_SHIFT:
- bverror = parse_explicitscale(bvbltparams, batch);
- break;
-
- default:
- BVSETBLTERROR(BVERR_SCALE_MODE,
- "unsupported scale class %d", scaleclass);
- goto exit;
- }
-
-exit:
- GCEXIT(GCZONE_SCALING);
- return bverror;
-}
diff --git a/bltsville/gcbv/mirror/include/cache-2dmanager.h b/bltsville/gcbv/mirror/include/cache-2dmanager.h
deleted file mode 100644
index 9740314..0000000
--- a/bltsville/gcbv/mirror/include/cache-2dmanager.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CACHE_2DMANAGER_H_
-#define CACHE_2DMANAGER_H_
-
-/* The value below only applies to OMAP4 */
-#define L1CACHE_SIZE 32768
-#define L2CACHE_SIZE 1048576
-
-#define L1THRESHOLD L1CACHE_SIZE
-#define L2THRESHOLD L2CACHE_SIZE
-
-struct c2dmrgn {
- char *start; /* addr of upper left of rect */
- size_t span; /* bytes to be operated on per line */
- size_t lines; /* lines to be operated on */
- long stride; /* bytes per line */
-};
-
-/*
- * c2dm_l1cache(count, rgns, dir)
- *
- * L1 Cache operations in 2D
- *
- * - count - number of regions
- * - rgns - array of regions
- * - dir - cache operation direction
- *
- */
-void c2dm_l1cache(int count, struct c2dmrgn rgns[], int dir);
-
-/*
- * c2dm_l2cache(count, rgns, dir)
- *
- * L2 Cache operations in 2D
- *
- * - count - number of regions
- * - rgns - array of regions
- * - dir - cache operation direction
- *
- */
-void c2dm_l2cache(int count, struct c2dmrgn rgns[], int dir);
-
-
-#endif /* CACHE_2DMANAGER_H_ */
diff --git a/bltsville/gcbv/mirror/include/gcdbglog.h b/bltsville/gcbv/mirror/include/gcdbglog.h
deleted file mode 100644
index a4e759a..0000000
--- a/bltsville/gcbv/mirror/include/gcdbglog.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCDBGLOG_H
-#define GCDBGLOG_H
-
-#include "gclist.h"
-#include <bltsville.h>
-struct gcmmucontext;
-
-
-/*******************************************************************************
- * Debug logging switches.
- */
-
-/* Enables internal gccore logging backend. */
-#if !defined(GCDEBUG_ENABLE)
-#define GCDEBUG_ENABLE 0 /* Enabled for development branch only. */
-#endif
-
-/* Enables linux builtin logging backend. */
-#if !defined(GCDEBUG_LINUXLOGS)
-#define GCDEBUG_LINUXLOGS 0
-#endif
-
-#if GCDEBUG_ENABLE && GCDEBUG_LINUXLOGS
-#error GCDEBUG_ENABLE and GCDEBUG_LINUXLOGS cannot be enabled simultaneously.
-#endif
-
-
-/*******************************************************************************
- * Dumping interface macro for release mode.
- */
-
-#if !GCDEBUG_ENABLE && !GCDEBUG_LINUXLOGS
-#define GCDBG_INIT(...)
-#define GCDBG_EXIT(...)
-#define GCDBG_FILTERDEF(...)
-#define GCDBG_REGISTER(...)
-#define GCENTER(...)
-#define GCEXIT(...)
-#define GCENTERARG(...)
-#define GCEXITARG(...)
-#define GCDBG(...) {}
-#define GCERR(...) {}
-#define GCDUMPSTRING(...) {}
-#define GCDUMPBUFFER(...) {}
-#define GCDUMPARENA(...) {}
-#define GCDUMPARENAS(...) {}
-#define GCGPUSTATUS(...) {}
-#endif
-
-#if !GCDEBUG_ENABLE
-#define GCDBG_REPORT_MISSING() \
- printf("gcx logging is not integrated.\n")
-
-#define GCDBG_SHOWENABLED(s) \
- GCDBG_REPORT_MISSING()
-
-#define GCDBG_ENABLEDUMP() \
- GCDBG_REPORT_MISSING()
-
-#define GCDBG_DISABLEDUMP() \
- GCDBG_REPORT_MISSING()
-
-#define GCDBG_SETFILTER(filtername, zone) \
- GCDBG_REPORT_MISSING()
-
-#define GCDBG_FLUSHDUMP(s) \
- GCDBG_REPORT_MISSING()
-
-#define GCDBG_RESETDUMP() \
- GCDBG_REPORT_MISSING()
-
-#endif
-
-
-/*******************************************************************************
- * Dumping macros not specific to a particular logging backend.
- */
-
-#if GCDEBUG_ENABLE || GCDEBUG_LINUXLOGS
-
-#define GC_MOD_PREFIX \
- GC_DEV_NAME ": %s(%d) "
-
-#define GCDUMPARENA(zone, text, arena) \
-do { \
- GCDBG(zone, text " @ 0x%08X:\n", (unsigned int) arena); \
- GCDBG(zone, " number of pages = %u\n", \
- (arena)->count); \
- GCDBG(zone, " from (absolute/mtlb/stlb) = 0x%08X / %u / %u\n", \
- (arena)->start.absolute, \
- (arena)->start.loc.mtlb, \
- (arena)->start.loc.stlb); \
- GCDBG(zone, " to (absolute/mtlb/stlb) = 0x%08X / %u / %u\n", \
- (arena)->end.absolute, \
- (arena)->end.loc.mtlb, \
- (arena)->end.loc.stlb); \
-} while (false)
-
-#define GCDUMPARENAS(zone, text, arenahead) \
-do { \
- GCDBG(zone, "%s:\n", text); \
- \
- if (list_empty(arenahead)) { \
- GCDBG(zone, " no arenas defined in the list.\n"); \
- } else { \
- struct list_head *entry; \
- struct gcmmuarena *arena; \
- \
- list_for_each(entry, arenahead) { \
- arena = list_entry(entry, struct gcmmuarena, link); \
- GCDUMPARENA(zone, "arena", arena); \
- } \
- } \
-} while (false)
-
-#endif
-
-#define GC_FUNC_ENTER "++"
-#define GC_FUNC_EXIT "--"
-
-
-/*******************************************************************************
- * Dumping macros for internal gccore logging backend.
- */
-
-#if GCDEBUG_ENABLE
-
-#define GCDBGFILTER \
- g_gcdbgfilter
-
-#define GCDBG_INIT() \
- gcdbg_init()
-
-#define GCDBG_EXIT() \
- gcdbg_exit()
-
-#define GCDBG_FILTERDEF(name, initzone, ...) \
- static struct gcdbgfilter GCDBGFILTER = { \
- .link = LIST_HEAD_INIT(GCDBGFILTER.link), \
- .filtername = #name, \
- .zone = initzone, \
- .zonename = { __VA_ARGS__, NULL } \
- }; \
- \
- struct gcdbgfilter *name ## _dbgfilter(void) \
- { \
- return &GCDBGFILTER; \
- }
-
-#define GCDBG_REGISTER(name) \
-do { \
- struct gcdbgfilter *name ## _dbgfilter(void); \
- gc_dbg_add_client(name ## _dbgfilter()); \
-} while (0)
-
-#define GCDBG_SHOWENABLED(s) \
- gc_dump_show_enabled(s)
-
-#define GCDBG_ENABLEDUMP() \
- gc_dump_enable()
-
-#define GCDBG_DISABLEDUMP() \
- gc_dump_disable()
-
-#define GCDBG_SETFILTER(filtername, zone) \
- gc_dump_filter_enable(filtername, zone)
-
-#define GCDBG_FLUSHDUMP(s) \
- gc_dump_flush(s)
-
-#define GCDBG_RESETDUMP() \
- gc_dump_reset()
-
-#define GCENTER(zone) \
- gc_dump_string(&GCDBGFILTER, zone, GC_FUNC_ENTER GC_MOD_PREFIX "\n", \
- __func__, __LINE__)
-
-#define GCEXIT(zone) \
- gc_dump_string(&GCDBGFILTER, zone, GC_FUNC_EXIT GC_MOD_PREFIX "\n", \
- __func__, __LINE__)
-
-#define GCENTERARG(zone, msg, ...) \
- gc_dump_string(&GCDBGFILTER, zone, GC_FUNC_ENTER GC_MOD_PREFIX msg, \
- __func__, __LINE__, ##__VA_ARGS__)
-
-#define GCEXITARG(zone, msg, ...) \
- gc_dump_string(&GCDBGFILTER, zone, GC_FUNC_EXIT GC_MOD_PREFIX msg, \
- __func__, __LINE__, ##__VA_ARGS__)
-
-#define GCDBG(zone, msg, ...) \
- gc_dump_string(&GCDBGFILTER, zone, GC_MOD_PREFIX msg, \
- __func__, __LINE__, ##__VA_ARGS__)
-
-#define GCERR(msg, ...) \
- gc_dump_string(NULL, 0, GC_MOD_PREFIX "[ERROR] " msg, \
- __func__, __LINE__, ##__VA_ARGS__)
-
-#define GCDUMPSTRING(msg, ...) \
- gc_dump_string(NULL, 0, msg, ##__VA_ARGS__)
-
-#define GCDUMPBUFFER(zone, ptr, gpuaddr, datasize) \
- gc_dump_cmd_buffer(&GCDBGFILTER, zone, ptr, gpuaddr, datasize)
-
-#endif
-
-
-/*******************************************************************************
- * Dumping macros for linux builtin logging backend.
- */
-
-#if GCDEBUG_LINUXLOGS
-
-#define GCDBG_INIT()
-#define GCDBG_EXIT()
-#define GCDBG_FILTERDEF(...)
-#define GCDBG_REGISTER(...)
-
-#define GCENTER(zone) \
- GCDBG(zone, GC_FUNC_ENTER " %s(%d)\n", __func__, __LINE__)
-
-#define GCEXIT(zone) \
- GCDBG(zone, GC_FUNC_EXIT " %s(%d)\n", __func__, __LINE__)
-
-#define GCENTERARG(zone, msg, ...) \
- GCDBG(zone, GC_FUNC_ENTER " %s(%d) " msg "\n", \
- __func__, __LINE__, ##__VA_ARGS__)
-
-#define GCEXITARG(zone, msg, ...) \
- GCDBG(zone, GC_FUNC_EXIT " %s(%d) " msg "\n", \
- __func__, __LINE__, ##__VA_ARGS__)
-
-#define GCDBG(zone, msg, ...) \
- dev_dbg(gc_get_dev(), msg, ##__VA_ARGS__)
-
-#define GCERR(msg, ...) \
- GCDBG(0, msg, ##__VA_ARGS__)
-
-#define GCDUMPSTRING(msg, ...) \
- GCDBG(0, msg, ##__VA_ARGS__)
-
-#define GCDUMPBUFFER(...) {}
-#define GCGPUSTATUS(...) {}
-
-#endif
-
-
-/*******************************************************************************
- * Command buffer parser.
- */
-
-struct gcsurfaceinfo {
- unsigned int width;
- unsigned int height;
- unsigned int address;
- unsigned int stride;
- unsigned int swizzle;
- unsigned int format;
- unsigned int bpp;
-};
-
-struct gcrect {
- int left;
- int top;
- int right;
- int bottom;
-};
-
-struct gcsourceinfo {
- struct gcsurfaceinfo surf;
- struct gcrect rect;
-};
-
-struct gcdestinfo {
- struct gcsurfaceinfo surf;
- unsigned int rectcount;
- struct gcrect rect[256];
-};
-
-struct gccommandinfo {
- unsigned int command;
- unsigned int srccount;
- struct gcsourceinfo src[4];
- struct gcdestinfo dst;
-};
-
-/* Parse the specified command buffer and fill in the structure. */
-int gc_parse_command_buffer(unsigned int *buffer, unsigned int size,
- struct gccommandinfo *info);
-
-
-/*******************************************************************************
- * Filter structure.
- */
-
-struct gcdbgfilter {
- struct list_head link;
- char *filtername;
- unsigned int zone;
- const char *zonename[];
-};
-
-
-/*******************************************************************************
- * Debug init/exit functions.
- */
-
-void gcdbg_init(void);
-void gcdbg_exit(void);
-
-
-/*******************************************************************************
- * Dumping functions.
- */
-
-/* String dumping. */
-void gc_dump_string(struct gcdbgfilter *filter, unsigned int zone,
- const char *message, ...);
-void gc_dump_string_sized(struct gcdbgfilter *filter, unsigned int zone,
- unsigned int argsize, const char *message, ...);
-
-/* Dump command buffer. */
-void gc_dump_cmd_buffer(struct gcdbgfilter *filter, unsigned int zone,
- void *ptr, unsigned int gpuaddr, unsigned int datasize);
-
-/* Dump generic buffer. */
-void gc_dump_buffer(struct gcdbgfilter *filter, unsigned int zone,
- void *ptr, unsigned int gpuaddr, unsigned int datasize);
-
-
-/*******************************************************************************
- * Bltsville debugging.
- */
-
-char *gc_bvblend_name(enum bvblend blend);
-
-
-/*******************************************************************************
- * Dumping control.
- */
-
-struct seq_file;
-
-struct device *gc_get_dev(void);
-void gc_dump_show_enabled(struct seq_file *s);
-void gc_dump_enable(void);
-void gc_dump_disable(void);
-void gc_dump_filter_enable(const char *filtername, int zone);
-void gc_dump_flush(struct seq_file *s);
-void gc_dump_reset(void);
-void gc_dbg_add_client(struct gcdbgfilter *filter);
-
-#endif
diff --git a/bltsville/gcbv/mirror/include/gcerror.h b/bltsville/gcbv/mirror/include/gcerror.h
deleted file mode 100644
index 2efcf39..0000000
--- a/bltsville/gcbv/mirror/include/gcerror.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCERROR_H
-#define GCERROR_H
-
-#define GCERR_SETGRP(error, group) \
-( \
- (enum gcerror) \
- ((error & GCERR_GENERIC_MASK) | group) \
-)
-
-#define GCERR_GENERIC(error) \
-( \
- (error & GCERR_GENERIC_MASK) << GCERR_GENERIC_SHIFT \
-)
-
-#define GCERR_GROUP(error) \
-( \
- (error & GCERR_GROUP_MASK) << GCERR_GROUP_SHIFT \
-)
-
-enum gcerror {
- /***********************************************************************
- ** No error / success.
- */
- GCERR_NONE = 0,
-
- /***********************************************************************
- ** Error code zones.
- */
-
- /* Generic error code zone. These errors inform of the low level
- reason of the faulure, but don't carry information about which
- logical part of the code generated the error. */
- GCERR_GENERIC_SIZE = 12,
- GCERR_GENERIC_SHIFT = 0,
- GCERR_GENERIC_MASK
- = ((1 << GCERR_GENERIC_SIZE) - 1) << GCERR_GENERIC_SHIFT,
-
- /* Group error code zone. These errors inform about the logical part
- of the code where the error occurred. */
- GCERR_GROUP_SIZE = (32 - GCERR_GENERIC_SIZE),
- GCERR_GROUP_SHIFT = GCERR_GENERIC_SIZE,
- GCERR_GROUP_MASK
- = ((1 << GCERR_GROUP_SIZE) - 1) << GCERR_GROUP_SHIFT,
-
- /***********************************************************************
- ** Generic zone errors.
- */
-
- GCERR_OODM /* Out of dynamic memory. */
- = GCERR_GENERIC(1),
-
- GCERR_OOPM /* Out of paged memory. */
- = GCERR_GENERIC(2),
-
- GCERR_PMMAP /* Paged memory mapping. */
- = GCERR_GENERIC(3),
-
- GCERR_USER_READ /* Reading user input. */
- = GCERR_GENERIC(4),
-
- GCERR_USER_WRITE /* Writing user output. */
- = GCERR_GENERIC(5),
-
- GCERR_INTERRUPTED /* Interrupted by a signal. */
- = GCERR_GENERIC(6),
-
- GCERR_TIMEOUT /* Timeout. */
- = GCERR_GENERIC(7),
-
- GCERR_NOT_FOUND /* Data/entry not found. */
- = GCERR_GENERIC(8),
-
- GCERR_IOCTL /* IOCTL failed. */
- = GCERR_GENERIC(9),
-
- /***********************************************************************
- ** Group zone errors.
- */
-
- /**** Context errors. */
- GCERR_CTX_ALLOC /* Context allocation. */
- = GCERR_GROUP(0x01000),
-
- GCERR_CTX_CHANGE /* Lock/unlock error. */
- = GCERR_GROUP(0x01010),
-
- GCERR_CTX_NULL /* Context not set. */
- = GCERR_GROUP(0x01020),
-
- /**** Command queue errors. */
- GCERR_CMD_ENTRY_PIPE /* Entry pipe is invalid. */
- = GCERR_GROUP(0x02000),
-
- GCERR_CMD_EXIT_PIPE /* Exit pipe is invalid. */
- = GCERR_GROUP(0x02010),
-
- GCERR_CMD_MAPPED /* Command buffer mapping error. */
- = GCERR_GROUP(0x02020),
-
- GCERR_CMD_CONSISTENCY /* Inconsistent mapping. */
- = GCERR_GROUP(0x02030),
-
- GCERR_CMD_ALLOC /* Buffer allocation. */
- = GCERR_GROUP(0x02040),
-
- GCERR_CMD_QUEUE_ALLOC /* Buffer queue allocation. */
- = GCERR_GROUP(0x02050),
-
- GCERR_CMD_EVENT_ALLOC /* Event allocation. */
- = GCERR_GROUP(0x02060),
-
- GCERR_CMD_INT_ALLOC /* Interrupt allocation. */
- = GCERR_GROUP(0x02070),
-
- GCERR_CMD_ISR /* ISR initialization. */
- = GCERR_GROUP(0x02080),
-
- GCERR_CMD_THREAD /* Thread initialization. */
- = GCERR_GROUP(0x02090),
-
- /**** MMU errors. */
- GCERR_MMU_CTXT_BAD /* Invalid context. */
- = GCERR_GROUP(0x03000),
-
- GCERR_MMU_MTLB_ALLOC /* MTLB allocation. */
- = GCERR_GROUP(0x03010),
-
- GCERR_MMU_MTLB_SET /* MTLB setting. */
- = GCERR_GROUP(0x03020),
-
- GCERR_MMU_STLB_ALLOC /* STLB allocation. */
- = GCERR_GROUP(0x03030),
-
- GCERR_MMU_STLBIDX_ALLOC /* STLB index allocation. */
- = GCERR_GROUP(0x03040),
-
- GCERR_MMU_ARENA_ALLOC /* Vacant arena allocation. */
- = GCERR_GROUP(0x03050),
-
- GCERR_MMU_OOM /* No available arenas to allocate. */
- = GCERR_GROUP(0x03060),
-
- GCERR_MMU_SAFE_ALLOC /* Safe zone allocation. */
- = GCERR_GROUP(0x03070),
-
- GCERR_MMU_INIT /* MMU initialization. */
- = GCERR_GROUP(0x03080),
-
- GCERR_MMU_ARG /* Invalid argument. */
- = GCERR_GROUP(0x03090),
-
- GCERR_MMU_CLIENT /* Client initialization. */
- = GCERR_GROUP(0x030A0),
-
- GCERR_MMU_BUFFER_BAD /* Invalid buffer to map. */
- = GCERR_GROUP(0x030B0),
-
- GCERR_MMU_PAGE_BAD /* Bad page within the buffer. */
- = GCERR_GROUP(0x030C0),
-
- GCERR_MMU_DESC_ALLOC /* Bad page within the buffer. */
- = GCERR_GROUP(0x030D0),
-
- GCERR_MMU_PHYS_ALLOC /* Bad page within the buffer. */
- = GCERR_GROUP(0x030E0),
-
- GCERR_MMU_OFFSET /* Bad buffer offset. */
- = GCERR_GROUP(0x030F0),
-
- /**** Power management. */
- GCERR_POWER_MODE /* Invlalid power mode requested. */
- = GCERR_GROUP(0x04000),
-
- GCERR_POWER_CLOCK_ON /* Failed to enable clock. */
- = GCERR_GROUP(0x04010),
-
- GCERR_POWER_IRQ_ON /* Failed to install IRQ handler. */
- = GCERR_GROUP(0x04020),
-
- GCERR_POWER_PULSE /* Pulse skipping error. */
- = GCERR_GROUP(0x04030),
-
- /**** GCIOCTL module errors. */
- GCERR_IOCTL_CTX_ALLOC /* Context wrapper allocation. */
- = GCERR_GROUP(0x11000),
-
- GCERR_IOCTL_BUF_ALLOC /* Command buffer allocation. */
- = GCERR_GROUP(0x11010),
-
- GCERR_IOCTL_FIXUP_ALLOC /* Fixup buffer allocation. */
- = GCERR_GROUP(0x11020),
-};
-
-#endif
diff --git a/bltsville/gcbv/mirror/include/gcioctl.h b/bltsville/gcbv/mirror/include/gcioctl.h
deleted file mode 100644
index 4f31b5a..0000000
--- a/bltsville/gcbv/mirror/include/gcioctl.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCIOCTL_H
-#define GCIOCTL_H
-
-#include "gclist.h"
-#include "gcerror.h"
-#include "gcreg.h"
-#include "cache-2dmanager.h"
-#include <bverror.h>
-
-/* IOCTL parameters. */
-#define GCIOCTL_TYPE 0x5D
-#define GCIOCTL_BASE 0x5D
-
-
-/*******************************************************************************
- * Capability query API entry.
- */
-
-#define GCIOCTL_GETCAPS _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x00, \
- struct gcicaps)
-
-/* GCIOCTL_CALLBACK_ALLOC / GCIOCTL_CALLBACK_FREE:
- * To be able to use the callback mechanism each user space client must
- * use the ALLOC/FREE APIs to manage a kernel side callback object
- * represented by the handle member of struct gcicallback.
- * ALLOC API allocates the object and returns the handle to it. */
-struct gcicaps {
- /* Error code. */
- enum gcerror gcerror;
-
- /* Capabilities and characteristics. */
- unsigned int gcmodel;
- unsigned int gcrevision;
- unsigned int gcdate;
- unsigned int gctime;
- union gcfeatures gcfeatures;
- union gcfeatures0 gcfeatures0;
- union gcfeatures1 gcfeatures1;
- union gcfeatures2 gcfeatures2;
- union gcfeatures3 gcfeatures3;
-};
-
-/*******************************************************************************
- * Commit API entry.
- */
-
-#define GCIOCTL_COMMIT _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x10, \
- struct gcicommit)
-
-/* GPU graphics pipe definition. */
-enum gcpipe {
- GCPIPE_UNKNOWN,
- GCPIPE_2D,
- GCPIPE_3D
-};
-
-/* Commit header; contains pointers to the head and the tail of a linked list
- of command buffers to execute. */
-struct gcicommit {
- /* Return status code. */
- enum gcerror gcerror;
-
- /* Entry graphics pipe specifies the pipe the GPU is expected to be in
- * for successfull execution of the specified command buffers in this
- * call. Exit graphics pipe specifies the state of the GPU after the
- * buffers are executed. */
- enum gcpipe entrypipe;
- enum gcpipe exitpipe;
-
- /* List of command buffers to be executed (gcbuffer). */
- struct list_head buffer;
-
- /* Pointer to the callback function to be called when the GPU completes
- * execution of all buffers specified in this call. This member can be
- * NULL if no callback is desired. callbackparam specifies data to be
- * passed to the callback. */
- void (*callback) (void *callbackparam);
- void *callbackparam;
-
- /* Callback object handle allocated with GCIOCTL_CALLBACK_ALLOC API. */
- unsigned long handle;
-
- /* If asynchronous is set to true, the call returns immediately without
- * waiting until all specified buffers have been executed. If set to
- * false, the call does not return until execution is finished. */
- bool asynchronous;
-
- /* Scheduled unmappings (gcschedunmap). */
- struct list_head unmap;
-};
-
-/* Command buffer header. */
-#define GC_BUFFER_SIZE (32 * 1024)
-struct gcbuffer {
- /* Fixup list (gcfixup). */
- struct list_head fixup;
-
- /* Number of pixels to be rendered. */
- unsigned int pixelcount;
-
- /* Pointers to the head and tail of the command buffer list. */
- unsigned int *head;
- unsigned int *tail;
-
- /* Number of bytes available in the buffer for allocation. */
- unsigned int available;
-
- /* Commmand buffer list (gcbuffer). */
- struct list_head link;
-};
-
-/* Fixup entry. */
-struct gcfixupentry {
- /* Offset into the commmand buffer where fixup is to be performed. */
- unsigned int dataoffset;
-
- /* Offset to be added to the translated address. */
- unsigned int surfoffset;
-};
-
-/* Address fixup array. */
-#define GC_FIXUP_MAX 1024
-struct gcfixup {
- /* Fixup list (gcfixup). */
- struct list_head link;
-
- /* Fixup array. */
- unsigned int count;
- struct gcfixupentry fixup[GC_FIXUP_MAX];
-};
-
-/* Defines a link list of scheduled unmappings. */
-struct gcschedunmap {
- /* Map handle. */
- unsigned long handle;
-
- /* Previous/next unmapping info (gcschedunmap). */
- struct list_head link;
-};
-
-
-/*******************************************************************************
- * Map/unmap API entries.
- */
-
-#define GCIOCTL_MAP _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x20, \
- struct gcimap)
-#define GCIOCTL_UNMAP _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x21, \
- struct gcimap)
-
-struct gcimap {
- /* Return status code. */
- enum gcerror gcerror;
-
- /* Mapped handle of the buffer. */
- unsigned long handle;
-
- union {
- /* Pointer to the buffer to be mapped;
- * used when pagearray is not provided (set to NULL). */
- void *logical;
-
- /* Page offset of the buffer to be mapped;
- * used when pagearray is provided. */
- unsigned int offset;
- } buf;
-
- /* Size of a physical page, 0 for default. */
- unsigned int pagesize;
-
- /* Pointer to array of physical pages. */
- unsigned long *pagearray;
-
- /* Size of the buffer to be mappped. */
- unsigned int size;
-};
-
-
-/*******************************************************************************
- * Cache manipulation API entries.
- */
-
-#define GCIOCTL_CACHE _IOW(GCIOCTL_TYPE, GCIOCTL_BASE + 0x30, \
- struct gcicache)
-
-struct gcicache {
- /* Number of regions. */
- int count;
-
- /* The most regions that we deal with is 3. */
- struct c2dmrgn rgn[3];
-
- /* Direction of data. */
- int dir;
-};
-
-
-/*******************************************************************************
- * Callback API entry.
- */
-
-#define GCIOCTL_CALLBACK_ALLOC _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x40, \
- struct gcicallback)
-#define GCIOCTL_CALLBACK_FREE _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x41, \
- struct gcicallback)
-#define GCIOCTL_CALLBACK_WAIT _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x42, \
- struct gcicallbackwait)
-#define GCIOCTL_CALLBACK_ARM _IOWR(GCIOCTL_TYPE, GCIOCTL_BASE + 0x43, \
- struct gcicallbackarm)
-
-/* GCIOCTL_CALLBACK_ALLOC / GCIOCTL_CALLBACK_FREE:
- * To be able to use the callback mechanism each user space client must
- * use the ALLOC/FREE APIs to manage a kernel side callback object
- * represented by the handle member of struct gcicallback.
- * ALLOC API allocates the object and returns the handle to it. */
-struct gcicallback {
- /* Error code. */
- enum gcerror gcerror;
-
- /* Callback object handle. */
- unsigned long handle;
-};
-
-/* GCIOCTL_CALLBACK_WAIT:
- * Called by the user level client to block and wait until the hardware
- * has executed a callback that was previosuly scheduled for the handle. */
-struct gcicallbackwait {
- /* Error code. */
- enum gcerror gcerror;
-
- /* Callback object handle. */
- unsigned long handle;
-
- /* Timeout in milliseconds. */
- unsigned long timeoutms;
-
- /* OUT: if the call succeeds, callback and callbackparam are
- * initialized with the callback to call. */
- void (*callback) (void *callbackparam);
- void *callbackparam;
-};
-
-/* GCIOCTL_CALLBACK_ARM:
- * Called by the client to arm a callback. This is similar to what
- * COMMIT API does, but in a separate API. */
-struct gcicallbackarm {
- /* Return status code. */
- enum gcerror gcerror;
-
- /* Pointer to the callback function to be called when the GPU completes
- * execution of all buffers specified in this call. This member can be
- * NULL if no callback is desired. callbackparam specifies data to be
- * passed to the callback. */
- void (*callback) (void *callbackparam);
- void *callbackparam;
-
- /* Callback object handle allocated with GCIOCTL_CALLBACK_ALLOC API. */
- unsigned long handle;
-};
-
-#endif
diff --git a/bltsville/gcbv/mirror/include/gclist.h b/bltsville/gcbv/mirror/include/gclist.h
deleted file mode 100644
index 614f76e..0000000
--- a/bltsville/gcbv/mirror/include/gclist.h
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * The full GNU General Public License is included in this distribution in
- * the file called "COPYING".
- */
-
-#ifndef _GCLIST_H
-#define _GCLIST_H
-
-/* Adaptation of Linux kernel double linked list. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LIST_POISON1 ((void *) 0x00100100)
-#define LIST_POISON2 ((void *) 0x00200200)
-
-#if !defined(countof)
-#define countof(a) \
- (sizeof(a) / sizeof(a[0]))
-#endif
-
-#if !defined(offsetof)
-#define offsetof(type, member) \
- ((size_t) &((type *) 0)->member)
-#endif
-
-#if !defined(containerof)
-#define containerof(ptr, type, member) \
- ((type *) ((char *) ptr - offsetof(type, member)))
-#endif
-
-struct list_head {
- struct list_head *next, *prev;
-};
-
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
-static void INIT_LIST_HEAD(struct list_head *list)
-{
- list->next = list;
- list->prev = list;
-}
-
-/* Insert a new entry between two known consecutive entries.
- * This is only for internal list manipulation where we know
- * the prev/next entries already! */
-static void __list_add(struct list_head *entry,
- struct list_head *prev,
- struct list_head *next)
-{
- next->prev = entry;
- entry->next = next;
- entry->prev = prev;
- prev->next = entry;
-}
-
-/**
- * list_add - add a new entry
- * @newentry: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-static void list_add(struct list_head *newentry,
- struct list_head *head)
-{
- __list_add(newentry, head, head->next);
-}
-
-
-/**
- * list_add_tail - add a new entry
- * @newentry: new entry to be added
- * @head: list head to add it before
- *
- * Insert a new entry before the specified head.
- * This is useful for implementing queues.
- */
-static void list_add_tail(struct list_head *newentry,
- struct list_head *head)
-{
- __list_add(newentry, head->prev, head);
-}
-
-/* Delete a list entry by making the prev/next entries point to each other.
- * This is only for internal list manipulation where we know
- * the prev/next entries already! */
-static void __list_del(struct list_head *prev,
- struct list_head *next)
-{
- next->prev = prev;
- prev->next = next;
-}
-
-/**
- * list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty() on entry does not return true after this,
- * the entry is in an undefined state.
- */
-static void __list_del_entry(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
-}
-
-static void list_del(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- entry->next = LIST_POISON1;
- entry->prev = LIST_POISON2;
-}
-
-/**
- * list_replace - replace old entry by new one
- * @oldentry : the element to be replaced
- * @newentry : the new element to insert
- *
- * If @old was empty, it will be overwritten.
- */
-static void list_replace(struct list_head *oldentry,
- struct list_head *newentry)
-{
- newentry->next = oldentry->next;
- newentry->next->prev = newentry;
- newentry->prev = oldentry->prev;
- newentry->prev->next = newentry;
-}
-
-static void list_replace_init(struct list_head *oldentry,
- struct list_head *newentry)
-{
- list_replace(oldentry, newentry);
- INIT_LIST_HEAD(oldentry);
-}
-
-/**
- * list_del_init - deletes entry from list and reinitialize it.
- * @entry: the element to delete from the list.
- */
-static void list_del_init(struct list_head *entry)
-{
- __list_del_entry(entry);
- INIT_LIST_HEAD(entry);
-}
-
-/**
- * list_move - delete from one list and add as another's head
- * @list: the entry to move
- * @head: the head that will precede our entry
- */
-static void list_move(struct list_head *list,
- struct list_head *head)
-{
- __list_del_entry(list);
- list_add(list, head);
-}
-
-/**
- * list_move_tail - delete from one list and add as another's tail
- * @list: the entry to move
- * @head: the head that will follow our entry
- */
-static void list_move_tail(struct list_head *list,
- struct list_head *head)
-{
- __list_del_entry(list);
- list_add_tail(list, head);
-}
-
-/**
- * list_is_last - tests whether @list is the last entry in list @head
- * @list: the entry to test
- * @head: the head of the list
- */
-static int list_is_last(const struct list_head *list,
- const struct list_head *head)
-{
- return list->next == head;
-}
-
-/**
- * list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static int list_empty(const struct list_head *head)
-{
- return (head->next == NULL) || (head->next == head);
-}
-
-/**
- * list_empty_careful - tests whether a list is empty and not being modified
- * @head: the list to test
- *
- * Description:
- * tests whether a list is empty _and_ checks that no other CPU might be
- * in the process of modifying either member (next or prev)
- *
- * NOTE: using list_empty_careful() without synchronization
- * can only be safe if the only activity that can happen
- * to the list entry is list_del_init(). Eg. it cannot be used
- * if another CPU could re-list_add() it.
- */
-static int list_empty_careful(const struct list_head *head)
-{
- struct list_head *next = head->next;
- return (next == head) && (next == head->prev);
-}
-
-/**
- * list_rotate_left - rotate the list to the left
- * @head: the head of the list
- */
-static void list_rotate_left(struct list_head *head)
-{
- struct list_head *first;
-
- if (!list_empty(head)) {
- first = head->next;
- list_move_tail(first, head);
- }
-}
-
-/**
- * list_is_singular - tests whether a list has just one entry.
- * @head: the list to test.
- */
-static int list_is_singular(const struct list_head *head)
-{
- return !list_empty(head) && (head->next == head->prev);
-}
-
-static void __list_cut_position(struct list_head *list,
- struct list_head *head,
- struct list_head *entry)
-{
- struct list_head *new_first = entry->next;
- list->next = head->next;
- list->next->prev = list;
- list->prev = entry;
- entry->next = list;
- head->next = new_first;
- new_first->prev = head;
-}
-
-/**
- * list_cut_position - cut a list into two
- * @list: a new list to add all removed entries
- * @head: a list with entries
- * @entry: an entry within head, could be the head itself
- * and if so we won't cut the list
- *
- * This helper moves the initial part of @head, up to and
- * including @entry, from @head to @list. You should
- * pass on @entry an element you know is on @head. @list
- * should be an empty list or a list you do not care about
- * losing its data.
- */
-static void list_cut_position(struct list_head *list,
- struct list_head *head,
- struct list_head *entry)
-{
- if (list_empty(head))
- return;
- if (list_is_singular(head) &&
- (head->next != entry && head != entry))
- return;
- if (entry == head)
- INIT_LIST_HEAD(list);
- else
- __list_cut_position(list, head, entry);
-}
-
-static void __list_splice(const struct list_head *list,
- struct list_head *prev,
- struct list_head *next)
-{
- struct list_head *first = list->next;
- struct list_head *last = list->prev;
-
- first->prev = prev;
- prev->next = first;
-
- last->next = next;
- next->prev = last;
-}
-
-/**
- * list_splice - join two lists, this is designed for stacks
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- */
-static void list_splice(const struct list_head *list,
- struct list_head *head)
-{
- if (!list_empty(list))
- __list_splice(list, head, head->next);
-}
-
-/**
- * list_splice_tail - join two lists, each list being a queue
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- */
-static void list_splice_tail(struct list_head *list,
- struct list_head *head)
-{
- if (!list_empty(list))
- __list_splice(list, head->prev, head);
-}
-
-/**
- * list_splice_init - join two lists and reinitialise the emptied list.
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- *
- * The list at @list is reinitialised
- */
-static void list_splice_init(struct list_head *list,
- struct list_head *head)
-{
- if (!list_empty(list)) {
- __list_splice(list, head, head->next);
- INIT_LIST_HEAD(list);
- }
-}
-
-/**
- * list_splice_tail_init - join two lists and reinitialise the emptied list
- * @list: the new list to add.
- * @head: the place to add it in the first list.
- *
- * Each of the lists is a queue.
- * The list at @list is reinitialised
- */
-static void list_splice_tail_init(struct list_head *list,
- struct list_head *head)
-{
- if (!list_empty(list)) {
- __list_splice(list, head->prev, head);
- INIT_LIST_HEAD(list);
- }
-}
-
-/**
- * list_entry - get the struct for this entry
- * @ptr: the &struct list_head pointer.
- * @type: the type of the struct this is embedded in.
- * @member: the name of the list_struct within the struct.
- */
-#define list_entry(ptr, type, member) \
- containerof(ptr, type, member)
-
-/**
- * list_first_entry - get the first element from a list
- * @ptr: the list head to take the element from.
- * @type: the type of the struct this is embedded in.
- * @member: the name of the list_struct within the struct.
- *
- * Note, that list is expected to be not empty.
- */
-#define list_first_entry(ptr, type, member) \
- list_entry((ptr)->next, type, member)
-
-/**
- * list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop cursor.
- * @head: the head for your list.
- */
-#define list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * __list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop cursor.
- * @head: the head for your list.
- *
- * This variant doesn't differ from list_for_each() any more.
- * We don't do prefetching in either case.
- */
-#define __list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * list_for_each_prev - iterate over a list backwards
- * @pos: the &struct list_head to use as a loop cursor.
- * @head: the head for your list.
- */
-#define list_for_each_prev(pos, head) \
- for (pos = (head)->prev; pos != (head); pos = pos->prev)
-
-/**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the &struct list_head to use as a loop cursor.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- */
-#define list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
-
-/**
- * list_for_each_prev_safe - iterate over a list backwards safe against removal
- * of list entry
- * @pos: the &struct list_head to use as a loop cursor.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- */
-#define list_for_each_prev_safe(pos, n, head) \
- for (pos = (head)->prev, n = pos->prev; \
- pos != (head); \
- pos = n, n = pos->prev)
-
-/**
- * list_for_each_entry - iterate over list of given type
- * @pos: the type * to use as a loop cursor.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- */
-#define list_for_each_entry(pos, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member))
-
-/**
- * list_for_each_entry_reverse - iterate backwards over list of given type.
- * @pos: the type * to use as a loop cursor.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- */
-#define list_for_each_entry_reverse(pos, head, member) \
- for (pos = list_entry((head)->prev, typeof(*pos), member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.prev, typeof(*pos), member))
-
-/**
- * list_prepare_entry - prepare a pos entry for use in
- * list_for_each_entry_continue()
- * @pos: the type * to use as a start point
- * @head: the head of the list
- * @member: the name of the list_struct within the struct.
- *
- * Prepares a pos entry for use as a start point in
- * list_for_each_entry_continue().
- */
-#define list_prepare_entry(pos, head, member) \
- ((pos) ? : list_entry(head, typeof(*pos), member))
-
-/**
- * list_for_each_entry_continue - continue iteration over list of given type
- * @pos: the type * to use as a loop cursor.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Continue to iterate over list of given type, continuing after
- * the current position.
- */
- #define list_for_each_entry_continue(pos, head, member) \
- for (pos = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member))
-
-/**
- * list_for_each_entry_continue_reverse - iterate backwards from the given point
- * @pos: the type * to use as a loop cursor.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Start to iterate over list of given type backwards, continuing after
- * the current position.
- */
-#define list_for_each_entry_continue_reverse(pos, head, member) \
- for (pos = list_entry(pos->member.prev, typeof(*pos), member); \
- &pos->member != (head); \
- pos = list_entry(pos->member.prev, typeof(*pos), member))
-
-/**
- * list_for_each_entry_from - iterate over list of given type from the current
- * point
- * @pos: the type * to use as a loop cursor.
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Iterate over list of given type, continuing from current position.
- */
-#define list_for_each_entry_from(pos, head, member) \
- for (; &pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member))
-
-/**
- * list_for_each_entry_safe - iterate over list of given type safe against
- * removal of list entry
- * @pos: the type * to use as a loop cursor.
- * @n: another type * to use as temporary storage
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- */
-#define list_for_each_entry_safe(pos, n, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- n = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.next, typeof(*n), member))
-
-/**
- * list_for_each_entry_safe_continue - continue list iteration safe against
- * removal
- * @pos: the type * to use as a loop cursor.
- * @n: another type * to use as temporary storage
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Iterate over list of given type, continuing after current point,
- * safe against removal of list entry.
- */
-#define list_for_each_entry_safe_continue(pos, n, head, member) \
- for (pos = list_entry(pos->member.next, typeof(*pos), member), \
- n = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.next, typeof(*n), member))
-
-/**
- * list_for_each_entry_safe_from - iterate over list from current point
- * safe against removal
- * @pos: the type * to use as a loop cursor.
- * @n: another type * to use as temporary storage
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Iterate over list of given type from current point, safe against
- * removal of list entry.
- */
-#define list_for_each_entry_safe_from(pos, n, head, member) \
- for (n = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.next, typeof(*n), member))
-
-/**
- * list_for_each_entry_safe_reverse - iterate backwards over list safe
- * against removal
- * @pos: the type * to use as a loop cursor.
- * @n: another type * to use as temporary storage
- * @head: the head for your list.
- * @member: the name of the list_struct within the struct.
- *
- * Iterate backwards over list of given type, safe against removal
- * of list entry.
- */
-#define list_for_each_entry_safe_reverse(pos, n, head, member) \
- for (pos = list_entry((head)->prev, typeof(*pos), member), \
- n = list_entry(pos->member.prev, typeof(*pos), member); \
- &pos->member != (head); \
- pos = n, n = list_entry(n->member.prev, typeof(*n), member))
-
-/**
- * list_safe_reset_next - reset a stale list_for_each_entry_safe loop
- * @pos: the loop cursor used in the list_for_each_entry_safe loop
- * @n: temporary storage used in list_for_each_entry_safe
- * @member: the name of the list_struct within the struct.
- *
- * list_safe_reset_next is not safe to use in general if the list may be
- * modified concurrently (eg. the lock is dropped in the loop body). An
- * exception to this is if the cursor element (pos) is pinned in the list,
- * and list_safe_reset_next is called after re-taking the lock and before
- * completing the current iteration of the loop body.
- */
-#define list_safe_reset_next(pos, n, member) \
- n = list_entry(pos->member.next, typeof(*pos), member)
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/bltsville/gcbv/mirror/include/gcreg.h b/bltsville/gcbv/mirror/include/gcreg.h
deleted file mode 100644
index 0328c25..0000000
--- a/bltsville/gcbv/mirror/include/gcreg.h
+++ /dev/null
@@ -1,10269 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __gcreg_h
-#define __gcreg_h
-
-/*******************************************************************************
-** Register access macros.
-*/
-
-#define GCREGSTART(reg_field) \
-( \
- 0 ? reg_field \
-)
-
-#define GCREGEND(reg_field) \
-( \
- 1 ? reg_field \
-)
-
-#define GCREGSIZE(reg_field) \
-( \
- GCREGEND(reg_field) - GCREGSTART(reg_field) + 1 \
-)
-
-#define GCREGALIGN(data, reg_field) \
-( \
- ((unsigned int) (data)) << GCREGSTART(reg_field) \
-)
-
-#define GCREGMASK(reg_field) \
-( \
- GCREGALIGN(~0UL >> (32 - GCREGSIZE(reg_field)), reg_field) \
-)
-
-#define GCSETFIELDVAL(data, reg, field, value) \
-( \
- (((unsigned int) (data)) & ~GCREGMASK(reg##_##field)) \
- | (GCREGALIGN(reg##_##field##_##value, reg##_##field) \
- & GCREGMASK(reg##_##field)) \
-)
-
-#define GCSETFIELD(data, reg, field, value) \
-( \
- (((unsigned int) (data)) & ~GCREGMASK(reg##_##field)) \
- | (GCREGALIGN((unsigned int) (value), reg##_##field) \
- & GCREGMASK(reg##_##field)) \
-)
-
-#define GCGETFIELD(data, reg, field) \
-( \
- (((unsigned int) (data)) & GCREGMASK(reg##_##field)) \
- >> GCREGSTART(reg##_##field) \
-)
-
-#define GCREGVALUE(reg, field, val) \
-( \
- reg##_##field##_##val \
-)
-
-/*******************************************************************************
-** Register gcregHiClockControl
-*/
-
-#define GCREG_HI_CLOCK_CONTROL_Address 0x00000
-#define GCREG_HI_CLOCK_CONTROL_MSB 15
-#define GCREG_HI_CLOCK_CONTROL_LSB 0
-#define GCREG_HI_CLOCK_CONTROL_BLK 0
-#define GCREG_HI_CLOCK_CONTROL_Count 1
-#define GCREG_HI_CLOCK_CONTROL_FieldMask 0x000A17FE
-#define GCREG_HI_CLOCK_CONTROL_ReadMask 0x000A17FE
-#define GCREG_HI_CLOCK_CONTROL_WriteMask 0x000817FE
-#define GCREG_HI_CLOCK_CONTROL_ResetValue 0x00000100
-
-/* Disable 3D clock. */
-#define GCREG_HI_CLOCK_CONTROL_CLK3D_DIS 0 : 0
-#define GCREG_HI_CLOCK_CONTROL_CLK3D_DIS_End 0
-#define GCREG_HI_CLOCK_CONTROL_CLK3D_DIS_Start 0
-#define GCREG_HI_CLOCK_CONTROL_CLK3D_DIS_Type U01
-
-/* Disable 2D clock. */
-#define GCREG_HI_CLOCK_CONTROL_CLK2D_DIS 1 : 1
-#define GCREG_HI_CLOCK_CONTROL_CLK2D_DIS_End 1
-#define GCREG_HI_CLOCK_CONTROL_CLK2D_DIS_Start 1
-#define GCREG_HI_CLOCK_CONTROL_CLK2D_DIS_Type U01
-
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_VAL 8 : 2
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_VAL_End 8
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_VAL_Start 2
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_VAL_Type U07
-
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_CMD_LOAD 9 : 9
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_CMD_LOAD_End 9
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_CMD_LOAD_Start 9
-#define GCREG_HI_CLOCK_CONTROL_FSCALE_CMD_LOAD_Type U01
-
-/* Disables clock gating for rams. */
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_RAM_CLK_GATING 10 : 10
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_RAM_CLK_GATING_End 10
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_RAM_CLK_GATING_Start 10
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_RAM_CLK_GATING_Type U01
-
-/* Disable debug registers. If this bit is 1, debug regs are clock gated. */
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_DEBUG_REGISTERS 11 : 11
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_DEBUG_REGISTERS_End 11
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_DEBUG_REGISTERS_Start 11
-#define GCREG_HI_CLOCK_CONTROL_DISABLE_DEBUG_REGISTERS_Type U01
-
-/* Soft resets the IP. */
-#define GCREG_HI_CLOCK_CONTROL_SOFT_RESET 12 : 12
-#define GCREG_HI_CLOCK_CONTROL_SOFT_RESET_End 12
-#define GCREG_HI_CLOCK_CONTROL_SOFT_RESET_Start 12
-#define GCREG_HI_CLOCK_CONTROL_SOFT_RESET_Type U01
-
-/* 3D pipe is idle. */
-#define GCREG_HI_CLOCK_CONTROL_IDLE_3D 16 : 16
-#define GCREG_HI_CLOCK_CONTROL_IDLE_3D_End 16
-#define GCREG_HI_CLOCK_CONTROL_IDLE_3D_Start 16
-#define GCREG_HI_CLOCK_CONTROL_IDLE_3D_Type U01
-
-/* 2D pipe is idle. */
-#define GCREG_HI_CLOCK_CONTROL_IDLE_2D 17 : 17
-#define GCREG_HI_CLOCK_CONTROL_IDLE_2D_End 17
-#define GCREG_HI_CLOCK_CONTROL_IDLE_2D_Start 17
-#define GCREG_HI_CLOCK_CONTROL_IDLE_2D_Type U01
-
-/* VG pipe is idle. */
-#define GCREG_HI_CLOCK_CONTROL_IDLE_VG 18 : 18
-#define GCREG_HI_CLOCK_CONTROL_IDLE_VG_End 18
-#define GCREG_HI_CLOCK_CONTROL_IDLE_VG_Start 18
-#define GCREG_HI_CLOCK_CONTROL_IDLE_VG_Type U01
-
-/* Isolate GPU bit */
-#define GCREG_HI_CLOCK_CONTROL_ISOLATE_GPU 19 : 19
-#define GCREG_HI_CLOCK_CONTROL_ISOLATE_GPU_End 19
-#define GCREG_HI_CLOCK_CONTROL_ISOLATE_GPU_Start 19
-#define GCREG_HI_CLOCK_CONTROL_ISOLATE_GPU_Type U01
-
-union gcclockcontrol {
- struct {
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_CLK3D_DIS */
- unsigned int disable3d:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_CLK2D_DIS */
- unsigned int disable2d:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_FSCALE_VAL */
- unsigned int pulsecount:7;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_FSCALE_CMD_LOAD */
- unsigned int pulseset:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_DISABLE_RAM_CLK_GATING */
- unsigned int ramgate:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_DISABLE_DEBUG_REGISTERS */
- unsigned int disabledbg:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_SOFT_RESET */
- unsigned int reset:1;
-
- /* gcregHiClockControl:
- reserved */
- unsigned int _reserved_13_15:3;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_IDLE_3D */
- unsigned int idle3d:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_IDLE_2D */
- unsigned int idle2d:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_IDLE_VG */
- unsigned int idlevg:1;
-
- /* gcregHiClockControl:
- GCREG_HI_CLOCK_CONTROL_ISOLATE_GPU */
- unsigned int isolate:1;
-
- /* gcregHiClockControl:
- reserved */
- unsigned int _reserved_20_31:12;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register gcregHiIdle
-*/
-
-#define GCREG_HI_IDLE_Address 0x00004
-#define GCREG_HI_IDLE_MSB 15
-#define GCREG_HI_IDLE_LSB 0
-#define GCREG_HI_IDLE_BLK 0
-#define GCREG_HI_IDLE_Count 1
-#define GCREG_HI_IDLE_FieldMask 0x80000007
-#define GCREG_HI_IDLE_ReadMask 0x80000007
-#define GCREG_HI_IDLE_WriteMask 0x00000000
-#define GCREG_HI_IDLE_ResetValue 0x00000007
-
-/* FE is idle. */
-#define GCREG_HI_IDLE_IDLE_FE 0 : 0
-#define GCREG_HI_IDLE_IDLE_FE_End 0
-#define GCREG_HI_IDLE_IDLE_FE_Start 0
-#define GCREG_HI_IDLE_IDLE_FE_Type U01
-
-/* DE is idle. */
-#define GCREG_HI_IDLE_IDLE_DE 1 : 1
-#define GCREG_HI_IDLE_IDLE_DE_End 1
-#define GCREG_HI_IDLE_IDLE_DE_Start 1
-#define GCREG_HI_IDLE_IDLE_DE_Type U01
-
-/* PE is idle. */
-#define GCREG_HI_IDLE_IDLE_PE 2 : 2
-#define GCREG_HI_IDLE_IDLE_PE_End 2
-#define GCREG_HI_IDLE_IDLE_PE_Start 2
-#define GCREG_HI_IDLE_IDLE_PE_Type U01
-
-/* AXI is in low power mode. */
-#define GCREG_HI_IDLE_AXI_LP 31 : 31
-#define GCREG_HI_IDLE_AXI_LP_End 31
-#define GCREG_HI_IDLE_AXI_LP_Start 31
-#define GCREG_HI_IDLE_AXI_LP_Type U01
-
-union gcidle {
- struct {
- /* gcregHiIdle: GCREG_HI_IDLE_IDLE_FE */
- unsigned int fe:1;
-
- /* gcregHiIdle: GCREG_HI_IDLE_IDLE_DE */
- unsigned int de:1;
-
- /* gcregHiIdle: GCREG_HI_IDLE_IDLE_PE */
- unsigned int pe:1;
-
- /* gcregHiIdle: reserved */
- unsigned int _reserved_3_30:28;
-
- /* gcregHiIdle: GCREG_HI_IDLE_AXI_LP */
- unsigned int axilp:1;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register gcregAxiConfig
-*/
-
-#define GCREG_AXI_CONFIG_Address 0x00008
-#define GCREG_AXI_CONFIG_MSB 15
-#define GCREG_AXI_CONFIG_LSB 0
-#define GCREG_AXI_CONFIG_BLK 0
-#define GCREG_AXI_CONFIG_Count 1
-#define GCREG_AXI_CONFIG_FieldMask 0x0000FFFF
-#define GCREG_AXI_CONFIG_ReadMask 0x0000FFFF
-#define GCREG_AXI_CONFIG_WriteMask 0x0000FFFF
-#define GCREG_AXI_CONFIG_ResetValue 0x00000000
-
-#define GCREG_AXI_CONFIG_AWID 3 : 0
-#define GCREG_AXI_CONFIG_AWID_End 3
-#define GCREG_AXI_CONFIG_AWID_Start 0
-#define GCREG_AXI_CONFIG_AWID_Type U04
-
-#define GCREG_AXI_CONFIG_ARID 7 : 4
-#define GCREG_AXI_CONFIG_ARID_End 7
-#define GCREG_AXI_CONFIG_ARID_Start 4
-#define GCREG_AXI_CONFIG_ARID_Type U04
-
-#define GCREG_AXI_CONFIG_AWCACHE 11 : 8
-#define GCREG_AXI_CONFIG_AWCACHE_End 11
-#define GCREG_AXI_CONFIG_AWCACHE_Start 8
-#define GCREG_AXI_CONFIG_AWCACHE_Type U04
-
-#define GCREG_AXI_CONFIG_ARCACHE 15 : 12
-#define GCREG_AXI_CONFIG_ARCACHE_End 15
-#define GCREG_AXI_CONFIG_ARCACHE_Start 12
-#define GCREG_AXI_CONFIG_ARCACHE_Type U04
-
-/*******************************************************************************
-** Register gcregAxiStatus
-*/
-
-#define GCREG_AXI_STATUS_Address 0x0000C
-#define GCREG_AXI_STATUS_MSB 15
-#define GCREG_AXI_STATUS_LSB 0
-#define GCREG_AXI_STATUS_BLK 0
-#define GCREG_AXI_STATUS_Count 1
-#define GCREG_AXI_STATUS_FieldMask 0x000003FF
-#define GCREG_AXI_STATUS_ReadMask 0x000003FF
-#define GCREG_AXI_STATUS_WriteMask 0x00000000
-#define GCREG_AXI_STATUS_ResetValue 0x00000000
-
-#define GCREG_AXI_STATUS_DET_RD_ERR 9 : 9
-#define GCREG_AXI_STATUS_DET_RD_ERR_End 9
-#define GCREG_AXI_STATUS_DET_RD_ERR_Start 9
-#define GCREG_AXI_STATUS_DET_RD_ERR_Type U01
-
-#define GCREG_AXI_STATUS_DET_WR_ERR 8 : 8
-#define GCREG_AXI_STATUS_DET_WR_ERR_End 8
-#define GCREG_AXI_STATUS_DET_WR_ERR_Start 8
-#define GCREG_AXI_STATUS_DET_WR_ERR_Type U01
-
-#define GCREG_AXI_STATUS_RD_ERR_ID 7 : 4
-#define GCREG_AXI_STATUS_RD_ERR_ID_End 7
-#define GCREG_AXI_STATUS_RD_ERR_ID_Start 4
-#define GCREG_AXI_STATUS_RD_ERR_ID_Type U04
-
-#define GCREG_AXI_STATUS_WR_ERR_ID 3 : 0
-#define GCREG_AXI_STATUS_WR_ERR_ID_End 3
-#define GCREG_AXI_STATUS_WR_ERR_ID_Start 0
-#define GCREG_AXI_STATUS_WR_ERR_ID_Type U04
-
-/*******************************************************************************
-** Register gcregIntrAcknowledge
-*/
-
-/* Interrupt acknowledge register. Each bit represents a corresponding event
-** being triggered. Reading from this register clears the outstanding interrupt.
-*/
-
-#define GCREG_INTR_ACKNOWLEDGE_Address 0x00010
-#define GCREG_INTR_ACKNOWLEDGE_MSB 15
-#define GCREG_INTR_ACKNOWLEDGE_LSB 0
-#define GCREG_INTR_ACKNOWLEDGE_BLK 0
-#define GCREG_INTR_ACKNOWLEDGE_Count 1
-#define GCREG_INTR_ACKNOWLEDGE_FieldMask 0xFFFFFFFF
-#define GCREG_INTR_ACKNOWLEDGE_ReadMask 0xFFFFFFFF
-#define GCREG_INTR_ACKNOWLEDGE_WriteMask 0x00000000
-#define GCREG_INTR_ACKNOWLEDGE_ResetValue 0x00000000
-
-#define GCREG_INTR_ACKNOWLEDGE_INTR_VEC 31 : 0
-#define GCREG_INTR_ACKNOWLEDGE_INTR_VEC_End 31
-#define GCREG_INTR_ACKNOWLEDGE_INTR_VEC_Start 0
-#define GCREG_INTR_ACKNOWLEDGE_INTR_VEC_Type U32
-
-/*******************************************************************************
-** Register gcregIntrEnbl
-*/
-
-/* Interrupt enable register. Each bit enables a corresponding event. */
-
-#define GCREG_INTR_ENBL_Address 0x00014
-#define GCREG_INTR_ENBL_MSB 15
-#define GCREG_INTR_ENBL_LSB 0
-#define GCREG_INTR_ENBL_BLK 0
-#define GCREG_INTR_ENBL_Count 1
-#define GCREG_INTR_ENBL_FieldMask 0xFFFFFFFF
-#define GCREG_INTR_ENBL_ReadMask 0xFFFFFFFF
-#define GCREG_INTR_ENBL_WriteMask 0xFFFFFFFF
-#define GCREG_INTR_ENBL_ResetValue 0x00000000
-
-#define GCREG_INTR_ENBL_INTR_ENBL_VEC 31 : 0
-#define GCREG_INTR_ENBL_INTR_ENBL_VEC_End 31
-#define GCREG_INTR_ENBL_INTR_ENBL_VEC_Start 0
-#define GCREG_INTR_ENBL_INTR_ENBL_VEC_Type U32
-
-/*******************************************************************************
-** Register GCFeatures
-*/
-
-/* Shows which features are enabled in this chip. This register has no set
-** reset value. It varies with the implementation.
-*/
-
-#define GC_FEATURES_Address 0x0001C
-#define GC_FEATURES_MSB 15
-#define GC_FEATURES_LSB 0
-#define GC_FEATURES_BLK 0
-#define GC_FEATURES_Count 1
-#define GC_FEATURES_FieldMask 0xFFFFFFFF
-#define GC_FEATURES_ReadMask 0xFFFFFFFF
-#define GC_FEATURES_WriteMask 0x00000000
-#define GC_FEATURES_ResetValue 0x00000000
-
-/* Fast clear. */
-#define GC_FEATURES_FAST_CLEAR 0 : 0
-#define GC_FEATURES_FAST_CLEAR_End 0
-#define GC_FEATURES_FAST_CLEAR_Start 0
-#define GC_FEATURES_FAST_CLEAR_Type U01
-#define GC_FEATURES_FAST_CLEAR_NONE 0x0
-#define GC_FEATURES_FAST_CLEAR_AVAILABLE 0x1
-
-/* Full-screen anti-aliasing. */
-#define GC_FEATURES_SPECIAL_ANTI_ALIASING 1 : 1
-#define GC_FEATURES_SPECIAL_ANTI_ALIASING_End 1
-#define GC_FEATURES_SPECIAL_ANTI_ALIASING_Start 1
-#define GC_FEATURES_SPECIAL_ANTI_ALIASING_Type U01
-#define GC_FEATURES_SPECIAL_ANTI_ALIASING_NONE 0x0
-#define GC_FEATURES_SPECIAL_ANTI_ALIASING_AVAILABLE 0x1
-
-/* 3D pipe. */
-#define GC_FEATURES_PIPE_3D 2 : 2
-#define GC_FEATURES_PIPE_3D_End 2
-#define GC_FEATURES_PIPE_3D_Start 2
-#define GC_FEATURES_PIPE_3D_Type U01
-#define GC_FEATURES_PIPE_3D_NONE 0x0
-#define GC_FEATURES_PIPE_3D_AVAILABLE 0x1
-
-/* DXT texture compression. */
-#define GC_FEATURES_DXT_TEXTURE_COMPRESSION 3 : 3
-#define GC_FEATURES_DXT_TEXTURE_COMPRESSION_End 3
-#define GC_FEATURES_DXT_TEXTURE_COMPRESSION_Start 3
-#define GC_FEATURES_DXT_TEXTURE_COMPRESSION_Type U01
-#define GC_FEATURES_DXT_TEXTURE_COMPRESSION_NONE 0x0
-#define GC_FEATURES_DXT_TEXTURE_COMPRESSION_AVAILABLE 0x1
-
-/* Debug registers. */
-#define GC_FEATURES_DEBUG_MODE 4 : 4
-#define GC_FEATURES_DEBUG_MODE_End 4
-#define GC_FEATURES_DEBUG_MODE_Start 4
-#define GC_FEATURES_DEBUG_MODE_Type U01
-#define GC_FEATURES_DEBUG_MODE_NONE 0x0
-#define GC_FEATURES_DEBUG_MODE_AVAILABLE 0x1
-
-/* Depth and color compression. */
-#define GC_FEATURES_ZCOMPRESSION 5 : 5
-#define GC_FEATURES_ZCOMPRESSION_End 5
-#define GC_FEATURES_ZCOMPRESSION_Start 5
-#define GC_FEATURES_ZCOMPRESSION_Type U01
-#define GC_FEATURES_ZCOMPRESSION_NONE 0x0
-#define GC_FEATURES_ZCOMPRESSION_AVAILABLE 0x1
-
-/* YUV 4:2:0 support in filter blit. */
-#define GC_FEATURES_YUV420_FILTER 6 : 6
-#define GC_FEATURES_YUV420_FILTER_End 6
-#define GC_FEATURES_YUV420_FILTER_Start 6
-#define GC_FEATURES_YUV420_FILTER_Type U01
-#define GC_FEATURES_YUV420_FILTER_NONE 0x0
-#define GC_FEATURES_YUV420_FILTER_AVAILABLE 0x1
-
-/* MSAA support. */
-#define GC_FEATURES_MSAA 7 : 7
-#define GC_FEATURES_MSAA_End 7
-#define GC_FEATURES_MSAA_Start 7
-#define GC_FEATURES_MSAA_Type U01
-#define GC_FEATURES_MSAA_NONE 0x0
-#define GC_FEATURES_MSAA_AVAILABLE 0x1
-
-/* Shows if there is a display controller in the IP. */
-#define GC_FEATURES_DC 8 : 8
-#define GC_FEATURES_DC_End 8
-#define GC_FEATURES_DC_Start 8
-#define GC_FEATURES_DC_Type U01
-#define GC_FEATURES_DC_NONE 0x0
-#define GC_FEATURES_DC_AVAILABLE 0x1
-
-/* Shows if there is 2D engine. */
-#define GC_FEATURES_PIPE_2D 9 : 9
-#define GC_FEATURES_PIPE_2D_End 9
-#define GC_FEATURES_PIPE_2D_Start 9
-#define GC_FEATURES_PIPE_2D_Type U01
-#define GC_FEATURES_PIPE_2D_NONE 0x0
-#define GC_FEATURES_PIPE_2D_AVAILABLE 0x1
-
-/* ETC1 texture compression. */
-#define GC_FEATURES_ETC1_TEXTURE_COMPRESSION 10 : 10
-#define GC_FEATURES_ETC1_TEXTURE_COMPRESSION_End 10
-#define GC_FEATURES_ETC1_TEXTURE_COMPRESSION_Start 10
-#define GC_FEATURES_ETC1_TEXTURE_COMPRESSION_Type U01
-#define GC_FEATURES_ETC1_TEXTURE_COMPRESSION_NONE 0x0
-#define GC_FEATURES_ETC1_TEXTURE_COMPRESSION_AVAILABLE 0x1
-
-/* Shows if the IP has HD scaler. */
-#define GC_FEATURES_FAST_SCALER 11 : 11
-#define GC_FEATURES_FAST_SCALER_End 11
-#define GC_FEATURES_FAST_SCALER_Start 11
-#define GC_FEATURES_FAST_SCALER_Type U01
-#define GC_FEATURES_FAST_SCALER_NONE 0x0
-#define GC_FEATURES_FAST_SCALER_AVAILABLE 0x1
-
-/* Shows if the IP has HDR support. */
-#define GC_FEATURES_HIGH_DYNAMIC_RANGE 12 : 12
-#define GC_FEATURES_HIGH_DYNAMIC_RANGE_End 12
-#define GC_FEATURES_HIGH_DYNAMIC_RANGE_Start 12
-#define GC_FEATURES_HIGH_DYNAMIC_RANGE_Type U01
-#define GC_FEATURES_HIGH_DYNAMIC_RANGE_NONE 0x0
-#define GC_FEATURES_HIGH_DYNAMIC_RANGE_AVAILABLE 0x1
-
-/* YUV 4:2:0 tiler is available. */
-#define GC_FEATURES_YUV420_TILER 13 : 13
-#define GC_FEATURES_YUV420_TILER_End 13
-#define GC_FEATURES_YUV420_TILER_Start 13
-#define GC_FEATURES_YUV420_TILER_Type U01
-#define GC_FEATURES_YUV420_TILER_NONE 0x0
-#define GC_FEATURES_YUV420_TILER_AVAILABLE 0x1
-
-/* Second level clock gating is available. */
-#define GC_FEATURES_MODULE_CG 14 : 14
-#define GC_FEATURES_MODULE_CG_End 14
-#define GC_FEATURES_MODULE_CG_Start 14
-#define GC_FEATURES_MODULE_CG_Type U01
-#define GC_FEATURES_MODULE_CG_NONE 0x0
-#define GC_FEATURES_MODULE_CG_AVAILABLE 0x1
-
-/* IP is configured to have minimum area. */
-#define GC_FEATURES_MIN_AREA 15 : 15
-#define GC_FEATURES_MIN_AREA_End 15
-#define GC_FEATURES_MIN_AREA_Start 15
-#define GC_FEATURES_MIN_AREA_Type U01
-#define GC_FEATURES_MIN_AREA_NONE 0x0
-#define GC_FEATURES_MIN_AREA_AVAILABLE 0x1
-
-/* IP does not have early-Z. */
-#define GC_FEATURES_NO_EZ 16 : 16
-#define GC_FEATURES_NO_EZ_End 16
-#define GC_FEATURES_NO_EZ_Start 16
-#define GC_FEATURES_NO_EZ_Type U01
-#define GC_FEATURES_NO_EZ_NONE 0x0
-#define GC_FEATURES_NO_EZ_AVAILABLE 0x1
-
-/* IP does not have 422 texture input format. */
-#define GC_FEATURES_NO422_TEXTURE 17 : 17
-#define GC_FEATURES_NO422_TEXTURE_End 17
-#define GC_FEATURES_NO422_TEXTURE_Start 17
-#define GC_FEATURES_NO422_TEXTURE_Type U01
-#define GC_FEATURES_NO422_TEXTURE_NONE 0x0
-#define GC_FEATURES_NO422_TEXTURE_AVAILABLE 0x1
-
-/* IP supports interleaving depth and color buffers. */
-#define GC_FEATURES_BUFFER_INTERLEAVING 18 : 18
-#define GC_FEATURES_BUFFER_INTERLEAVING_End 18
-#define GC_FEATURES_BUFFER_INTERLEAVING_Start 18
-#define GC_FEATURES_BUFFER_INTERLEAVING_Type U01
-#define GC_FEATURES_BUFFER_INTERLEAVING_NONE 0x0
-#define GC_FEATURES_BUFFER_INTERLEAVING_AVAILABLE 0x1
-
-/* Supports byte write in 2D. */
-#define GC_FEATURES_BYTE_WRITE_2D 19 : 19
-#define GC_FEATURES_BYTE_WRITE_2D_End 19
-#define GC_FEATURES_BYTE_WRITE_2D_Start 19
-#define GC_FEATURES_BYTE_WRITE_2D_Type U01
-#define GC_FEATURES_BYTE_WRITE_2D_NONE 0x0
-#define GC_FEATURES_BYTE_WRITE_2D_AVAILABLE 0x1
-
-/* IP does not have 2D scaler. */
-#define GC_FEATURES_NO_SCALER 20 : 20
-#define GC_FEATURES_NO_SCALER_End 20
-#define GC_FEATURES_NO_SCALER_Start 20
-#define GC_FEATURES_NO_SCALER_Type U01
-#define GC_FEATURES_NO_SCALER_NONE 0x0
-#define GC_FEATURES_NO_SCALER_AVAILABLE 0x1
-
-/* YUY2 averaging support in resolve. */
-#define GC_FEATURES_YUY2_AVERAGING 21 : 21
-#define GC_FEATURES_YUY2_AVERAGING_End 21
-#define GC_FEATURES_YUY2_AVERAGING_Start 21
-#define GC_FEATURES_YUY2_AVERAGING_Type U01
-#define GC_FEATURES_YUY2_AVERAGING_NONE 0x0
-#define GC_FEATURES_YUY2_AVERAGING_AVAILABLE 0x1
-
-/* PE cache is half. */
-#define GC_FEATURES_HALF_PE_CACHE 22 : 22
-#define GC_FEATURES_HALF_PE_CACHE_End 22
-#define GC_FEATURES_HALF_PE_CACHE_Start 22
-#define GC_FEATURES_HALF_PE_CACHE_Type U01
-#define GC_FEATURES_HALF_PE_CACHE_NONE 0x0
-#define GC_FEATURES_HALF_PE_CACHE_AVAILABLE 0x1
-
-/* TX cache is half. */
-#define GC_FEATURES_HALF_TX_CACHE 23 : 23
-#define GC_FEATURES_HALF_TX_CACHE_End 23
-#define GC_FEATURES_HALF_TX_CACHE_Start 23
-#define GC_FEATURES_HALF_TX_CACHE_Type U01
-#define GC_FEATURES_HALF_TX_CACHE_NONE 0x0
-#define GC_FEATURES_HALF_TX_CACHE_AVAILABLE 0x1
-
-/* YUY2 support in PE and YUY2 to RGB conversion in resolve. */
-#define GC_FEATURES_YUY2_RENDER_TARGET 24 : 24
-#define GC_FEATURES_YUY2_RENDER_TARGET_End 24
-#define GC_FEATURES_YUY2_RENDER_TARGET_Start 24
-#define GC_FEATURES_YUY2_RENDER_TARGET_Type U01
-#define GC_FEATURES_YUY2_RENDER_TARGET_NONE 0x0
-#define GC_FEATURES_YUY2_RENDER_TARGET_AVAILABLE 0x1
-
-/* 32 bit memory address support. */
-#define GC_FEATURES_MEM32_BIT_SUPPORT 25 : 25
-#define GC_FEATURES_MEM32_BIT_SUPPORT_End 25
-#define GC_FEATURES_MEM32_BIT_SUPPORT_Start 25
-#define GC_FEATURES_MEM32_BIT_SUPPORT_Type U01
-#define GC_FEATURES_MEM32_BIT_SUPPORT_NONE 0x0
-#define GC_FEATURES_MEM32_BIT_SUPPORT_AVAILABLE 0x1
-
-/* VG pipe is present. */
-#define GC_FEATURES_PIPE_VG 26 : 26
-#define GC_FEATURES_PIPE_VG_End 26
-#define GC_FEATURES_PIPE_VG_Start 26
-#define GC_FEATURES_PIPE_VG_Type U01
-#define GC_FEATURES_PIPE_VG_NONE 0x0
-#define GC_FEATURES_PIPE_VG_AVAILABLE 0x1
-
-/* VG tesselator is present. */
-#define GC_FEATURES_VGTS 27 : 27
-#define GC_FEATURES_VGTS_End 27
-#define GC_FEATURES_VGTS_Start 27
-#define GC_FEATURES_VGTS_Type U01
-#define GC_FEATURES_VGTS_NONE 0x0
-#define GC_FEATURES_VGTS_AVAILABLE 0x1
-
-/* FE 2.0 is present. */
-#define GC_FEATURES_FE20 28 : 28
-#define GC_FEATURES_FE20_End 28
-#define GC_FEATURES_FE20_Start 28
-#define GC_FEATURES_FE20_Type U01
-#define GC_FEATURES_FE20_NONE 0x0
-#define GC_FEATURES_FE20_AVAILABLE 0x1
-
-/* 3D PE has byte write capability. */
-#define GC_FEATURES_BYTE_WRITE_3D 29 : 29
-#define GC_FEATURES_BYTE_WRITE_3D_End 29
-#define GC_FEATURES_BYTE_WRITE_3D_Start 29
-#define GC_FEATURES_BYTE_WRITE_3D_Type U01
-#define GC_FEATURES_BYTE_WRITE_3D_NONE 0x0
-#define GC_FEATURES_BYTE_WRITE_3D_AVAILABLE 0x1
-
-/* Supports resolveing into YUV target. */
-#define GC_FEATURES_RS_YUV_TARGET 30 : 30
-#define GC_FEATURES_RS_YUV_TARGET_End 30
-#define GC_FEATURES_RS_YUV_TARGET_Start 30
-#define GC_FEATURES_RS_YUV_TARGET_Type U01
-#define GC_FEATURES_RS_YUV_TARGET_NONE 0x0
-#define GC_FEATURES_RS_YUV_TARGET_AVAILABLE 0x1
-
-/* Supports 20 bit index. */
-#define GC_FEATURES_FE20_BIT_INDEX 31 : 31
-#define GC_FEATURES_FE20_BIT_INDEX_End 31
-#define GC_FEATURES_FE20_BIT_INDEX_Start 31
-#define GC_FEATURES_FE20_BIT_INDEX_Type U01
-#define GC_FEATURES_FE20_BIT_INDEX_NONE 0x0
-#define GC_FEATURES_FE20_BIT_INDEX_AVAILABLE 0x1
-
-union gcfeatures {
- struct {
- /* GC_FEATURES_Address:FAST_CLEAR */
- unsigned int fastclear:1;
-
- /* GC_FEATURES_Address:SPECIAL_ANTI_ALIASING */
- unsigned int specialantialiasing:1;
-
- /* GC_FEATURES_Address:PIPE_3D */
- unsigned int pipe3d:1;
-
- /* GC_FEATURES_Address:DXT_TEXTURE_COMPRESSION */
- unsigned int dxt:1;
-
- /* GC_FEATURES_Address:DEBUG_MODE */
- unsigned int debugmode:1;
-
- /* GC_FEATURES_Address:ZCOMPRESSION */
- unsigned int zcompression:1;
-
- /* GC_FEATURES_Address:YUV420_FILTER */
- unsigned int yuv420filter:1;
-
- /* GC_FEATURES_Address:MSAA */
- unsigned int msaa:1;
-
- /* GC_FEATURES_Address:DC */
- unsigned int dc:1;
-
- /* GC_FEATURES_Address:PIPE_2D */
- unsigned int pipe2d:1;
-
- /* GC_FEATURES_Address:ETC1_TEXTURE_COMPRESSION */
- unsigned int etc:1;
-
- /* GC_FEATURES_Address:FAST_SCALER */
- unsigned int fastscaler:1;
-
- /* GC_FEATURES_Address:HIGH_DYNAMIC_RANGE */
- unsigned int hdr:1;
-
- /* GC_FEATURES_Address:YUV420_TILER */
- unsigned int yuv420tiler:1;
-
- /* GC_FEATURES_Address:MODULE_CG */
- unsigned int clockgating:1;
-
- /* GC_FEATURES_Address:MIN_AREA */
- unsigned int minarea:1;
-
- /* GC_FEATURES_Address:NO_EZ */
- unsigned int noez:1;
-
- /* GC_FEATURES_Address:NO422_TEXTURE */
- unsigned int no422texture:1;
-
- /* GC_FEATURES_Address:BUFFER_INTERLEAVING */
- unsigned int bufinterleaving:1;
-
- /* GC_FEATURES_Address:BYTE_WRITE_2D */
- unsigned int bytewrite2d:1;
-
- /* GC_FEATURES_Address:NO_SCALER */
- unsigned int noscaler:1;
-
- /* GC_FEATURES_Address:YUY2_AVERAGING */
- unsigned int yuy2averaging:1;
-
- /* GC_FEATURES_Address:HALF_PE_CACHE */
- unsigned int halfpecache:1;
-
- /* GC_FEATURES_Address:HALF_TX_CACHE */
- unsigned int halftxcache:1;
-
- /* GC_FEATURES_Address:YUY2_RENDER_TARGET */
- unsigned int yuy2target:1;
-
- /* GC_FEATURES_Address:MEM32_BIT_SUPPORT */
- unsigned int mem32:1;
-
- /* GC_FEATURES_Address:PIPE_VG */
- unsigned int pipevg:1;
-
- /* GC_FEATURES_Address:VGTS */
- unsigned int vgts:1;
-
- /* GC_FEATURES_Address:FE20 */
- unsigned int fe20:1;
-
- /* GC_FEATURES_Address:BYTE_WRITE_3D */
- unsigned int bytewrite3d:1;
-
- /* GC_FEATURES_Address:RS_YUV_TARGET */
- unsigned int rsyuvtarget:1;
-
- /* GC_FEATURES_Address:FE20_BIT_INDEX */
- unsigned int fe20bit:1;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register GCChipId
-*/
-
-/* Shows the ID for the chip in BCD. This register has no set reset value.
-** It varies with the implementation.
-*/
-
-#define GC_CHIP_ID_Address 0x00020
-#define GC_CHIP_ID_MSB 15
-#define GC_CHIP_ID_LSB 0
-#define GC_CHIP_ID_BLK 0
-#define GC_CHIP_ID_Count 1
-#define GC_CHIP_ID_FieldMask 0xFFFFFFFF
-#define GC_CHIP_ID_ReadMask 0xFFFFFFFF
-#define GC_CHIP_ID_WriteMask 0x00000000
-#define GC_CHIP_ID_ResetValue 0x00000000
-
-/* Id. */
-#define GC_CHIP_ID_ID 31 : 0
-#define GC_CHIP_ID_ID_End 31
-#define GC_CHIP_ID_ID_Start 0
-#define GC_CHIP_ID_ID_Type U32
-
-/*******************************************************************************
-** Register GCChipRev
-*/
-
-/* Shows the revision for the chip in BCD. This register has no set reset
-** value. It varies with the implementation.
-*/
-
-#define GC_CHIP_REV_Address 0x00024
-#define GC_CHIP_REV_MSB 15
-#define GC_CHIP_REV_LSB 0
-#define GC_CHIP_REV_BLK 0
-#define GC_CHIP_REV_Count 1
-#define GC_CHIP_REV_FieldMask 0xFFFFFFFF
-#define GC_CHIP_REV_ReadMask 0xFFFFFFFF
-#define GC_CHIP_REV_WriteMask 0x00000000
-#define GC_CHIP_REV_ResetValue 0x00000000
-
-/* Revision. */
-#define GC_CHIP_REV_REV 31 : 0
-#define GC_CHIP_REV_REV_End 31
-#define GC_CHIP_REV_REV_Start 0
-#define GC_CHIP_REV_REV_Type U32
-
-/*******************************************************************************
-** Register GCChipDate
-*/
-
-/* Shows the release date for the IP. This register has no set reset value.
-** It varies with the implementation.
-*/
-
-#define GC_CHIP_DATE_Address 0x00028
-#define GC_CHIP_DATE_MSB 15
-#define GC_CHIP_DATE_LSB 0
-#define GC_CHIP_DATE_BLK 0
-#define GC_CHIP_DATE_Count 1
-#define GC_CHIP_DATE_FieldMask 0xFFFFFFFF
-#define GC_CHIP_DATE_ReadMask 0xFFFFFFFF
-#define GC_CHIP_DATE_WriteMask 0x00000000
-#define GC_CHIP_DATE_ResetValue 0x00000000
-
-/* Date. */
-#define GC_CHIP_DATE_DATE 31 : 0
-#define GC_CHIP_DATE_DATE_End 31
-#define GC_CHIP_DATE_DATE_Start 0
-#define GC_CHIP_DATE_DATE_Type U32
-
-/*******************************************************************************
-** Register GCChipTime
-*/
-
-/* Shows the release time for the IP. This register has no set reset value.
-** It varies with the implementation.
-*/
-
-#define GC_CHIP_TIME_Address 0x0002C
-#define GC_CHIP_TIME_MSB 15
-#define GC_CHIP_TIME_LSB 0
-#define GC_CHIP_TIME_BLK 0
-#define GC_CHIP_TIME_Count 1
-#define GC_CHIP_TIME_FieldMask 0xFFFFFFFF
-#define GC_CHIP_TIME_ReadMask 0xFFFFFFFF
-#define GC_CHIP_TIME_WriteMask 0x00000000
-#define GC_CHIP_TIME_ResetValue 0x00000000
-
-/* Time. */
-#define GC_CHIP_TIME_TIME 31 : 0
-#define GC_CHIP_TIME_TIME_End 31
-#define GC_CHIP_TIME_TIME_Start 0
-#define GC_CHIP_TIME_TIME_Type U32
-
-/*******************************************************************************
-** Register GCMinorFeatures0
-*/
-
-/* Shows which minor features are enabled in this chip. This register has no
-** set reset value. It varies with the implementation.
-*/
-
-#define GC_FEATURES0_Address 0x00034
-#define GC_FEATURES0_MSB 15
-#define GC_FEATURES0_LSB 0
-#define GC_FEATURES0_BLK 0
-#define GC_FEATURES0_Count 1
-#define GC_FEATURES0_FieldMask 0xFFFFFFFF
-#define GC_FEATURES0_ReadMask 0xFFFFFFFF
-#define GC_FEATURES0_WriteMask 0x00000000
-#define GC_FEATURES0_ResetValue 0x00000000
-
-/* Y flipping capability is added to resolve. */
-#define GC_FEATURES0_FLIP_Y 0 : 0
-#define GC_FEATURES0_FLIP_Y_End 0
-#define GC_FEATURES0_FLIP_Y_Start 0
-#define GC_FEATURES0_FLIP_Y_Type U01
-#define GC_FEATURES0_FLIP_Y_NONE 0x0
-#define GC_FEATURES0_FLIP_Y_AVAILABLE 0x1
-
-/* Dual Return Bus from HI to clients. */
-#define GC_FEATURES0_DUAL_RETURN_BUS 1 : 1
-#define GC_FEATURES0_DUAL_RETURN_BUS_End 1
-#define GC_FEATURES0_DUAL_RETURN_BUS_Start 1
-#define GC_FEATURES0_DUAL_RETURN_BUS_Type U01
-#define GC_FEATURES0_DUAL_RETURN_BUS_NONE 0x0
-#define GC_FEATURES0_DUAL_RETURN_BUS_AVAILABLE 0x1
-
-/* Configurable endianness support. */
-#define GC_FEATURES0_ENDIANNESS_CONFIG 2 : 2
-#define GC_FEATURES0_ENDIANNESS_CONFIG_End 2
-#define GC_FEATURES0_ENDIANNESS_CONFIG_Start 2
-#define GC_FEATURES0_ENDIANNESS_CONFIG_Type U01
-#define GC_FEATURES0_ENDIANNESS_CONFIG_NONE 0x0
-#define GC_FEATURES0_ENDIANNESS_CONFIG_AVAILABLE 0x1
-
-/* Supports 8Kx8K textures. */
-#define GC_FEATURES0_TEXTURE8_K 3 : 3
-#define GC_FEATURES0_TEXTURE8_K_End 3
-#define GC_FEATURES0_TEXTURE8_K_Start 3
-#define GC_FEATURES0_TEXTURE8_K_Type U01
-#define GC_FEATURES0_TEXTURE8_K_NONE 0x0
-#define GC_FEATURES0_TEXTURE8_K_AVAILABLE 0x1
-
-/* Driver hack is not needed. */
-#define GC_FEATURES0_CORRECT_TEXTURE_CONVERTER 4 : 4
-#define GC_FEATURES0_CORRECT_TEXTURE_CONVERTER_End 4
-#define GC_FEATURES0_CORRECT_TEXTURE_CONVERTER_Start 4
-#define GC_FEATURES0_CORRECT_TEXTURE_CONVERTER_Type U01
-#define GC_FEATURES0_CORRECT_TEXTURE_CONVERTER_NONE 0x0
-#define GC_FEATURES0_CORRECT_TEXTURE_CONVERTER_AVAILABLE 0x1
-
-/* Special LOD calculation when MSAA is on. */
-#define GC_FEATURES0_SPECIAL_MSAA_LOD 5 : 5
-#define GC_FEATURES0_SPECIAL_MSAA_LOD_End 5
-#define GC_FEATURES0_SPECIAL_MSAA_LOD_Start 5
-#define GC_FEATURES0_SPECIAL_MSAA_LOD_Type U01
-#define GC_FEATURES0_SPECIAL_MSAA_LOD_NONE 0x0
-#define GC_FEATURES0_SPECIAL_MSAA_LOD_AVAILABLE 0x1
-
-/* Proper flush is done in fast clear cache. */
-#define GC_FEATURES0_FAST_CLEAR_FLUSH 6 : 6
-#define GC_FEATURES0_FAST_CLEAR_FLUSH_End 6
-#define GC_FEATURES0_FAST_CLEAR_FLUSH_Start 6
-#define GC_FEATURES0_FAST_CLEAR_FLUSH_Type U01
-#define GC_FEATURES0_FAST_CLEAR_FLUSH_NONE 0x0
-#define GC_FEATURES0_FAST_CLEAR_FLUSH_AVAILABLE 0x1
-
-/* 2D PE 2.0 is present. */
-#define GC_FEATURES0_2DPE20 7 : 7
-#define GC_FEATURES0_2DPE20_End 7
-#define GC_FEATURES0_2DPE20_Start 7
-#define GC_FEATURES0_2DPE20_Type U01
-#define GC_FEATURES0_2DPE20_NONE 0x0
-#define GC_FEATURES0_2DPE20_AVAILABLE 0x1
-
-/* Reserved. */
-#define GC_FEATURES0_CORRECT_AUTO_DISABLE 8 : 8
-#define GC_FEATURES0_CORRECT_AUTO_DISABLE_End 8
-#define GC_FEATURES0_CORRECT_AUTO_DISABLE_Start 8
-#define GC_FEATURES0_CORRECT_AUTO_DISABLE_Type U01
-#define GC_FEATURES0_CORRECT_AUTO_DISABLE_NONE 0x0
-#define GC_FEATURES0_CORRECT_AUTO_DISABLE_AVAILABLE 0x1
-
-/* Supports 8K render target. */
-#define GC_FEATURES0_RENDER_8K 9 : 9
-#define GC_FEATURES0_RENDER_8K_End 9
-#define GC_FEATURES0_RENDER_8K_Start 9
-#define GC_FEATURES0_RENDER_8K_Type U01
-#define GC_FEATURES0_RENDER_8K_NONE 0x0
-#define GC_FEATURES0_RENDER_8K_AVAILABLE 0x1
-
-/* 2 bits are used instead of 4 bits for tile status. */
-#define GC_FEATURES0_TILE_STATUS_2BITS 10 : 10
-#define GC_FEATURES0_TILE_STATUS_2BITS_End 10
-#define GC_FEATURES0_TILE_STATUS_2BITS_Start 10
-#define GC_FEATURES0_TILE_STATUS_2BITS_Type U01
-#define GC_FEATURES0_TILE_STATUS_2BITS_NONE 0x0
-#define GC_FEATURES0_TILE_STATUS_2BITS_AVAILABLE 0x1
-
-/* Use 2 separate tile status buffers in interleaved mode. */
-#define GC_FEATURES0_SEPARATE_TILE_STATUS_WHEN_INTERLEAVED 11 : 11
-#define GC_FEATURES0_SEPARATE_TILE_STATUS_WHEN_INTERLEAVED_End 11
-#define GC_FEATURES0_SEPARATE_TILE_STATUS_WHEN_INTERLEAVED_Start 11
-#define GC_FEATURES0_SEPARATE_TILE_STATUS_WHEN_INTERLEAVED_Type U01
-#define GC_FEATURES0_SEPARATE_TILE_STATUS_WHEN_INTERLEAVED_NONE 0x0
-#define GC_FEATURES0_SEPARATE_TILE_STATUS_WHEN_INTERLEAVED_AVAILABLE 0x1
-
-/* 32x32 super tile is available. */
-#define GC_FEATURES0_SUPER_TILED_32X32 12 : 12
-#define GC_FEATURES0_SUPER_TILED_32X32_End 12
-#define GC_FEATURES0_SUPER_TILED_32X32_Start 12
-#define GC_FEATURES0_SUPER_TILED_32X32_Type U01
-#define GC_FEATURES0_SUPER_TILED_32X32_NONE 0x0
-#define GC_FEATURES0_SUPER_TILED_32X32_AVAILABLE 0x1
-
-/* Major updates to VG pipe (TS buffer tiling. State masking.). */
-#define GC_FEATURES0_VG_20 13 : 13
-#define GC_FEATURES0_VG_20_End 13
-#define GC_FEATURES0_VG_20_Start 13
-#define GC_FEATURES0_VG_20_Type U01
-#define GC_FEATURES0_VG_20_NONE 0x0
-#define GC_FEATURES0_VG_20_AVAILABLE 0x1
-
-/* New commands added to the tessellator. */
-#define GC_FEATURES0_TS_EXTENDED_COMMANDS 14 : 14
-#define GC_FEATURES0_TS_EXTENDED_COMMANDS_End 14
-#define GC_FEATURES0_TS_EXTENDED_COMMANDS_Start 14
-#define GC_FEATURES0_TS_EXTENDED_COMMANDS_Type U01
-#define GC_FEATURES0_TS_EXTENDED_COMMANDS_NONE 0x0
-#define GC_FEATURES0_TS_EXTENDED_COMMANDS_AVAILABLE 0x1
-
-/* If this bit is not set, the FIFO counter should be set to 50. Else, the **
-** default should remain. */
-#define GC_FEATURES0_COMPRESSION_FIFO_FIXED 15 : 15
-#define GC_FEATURES0_COMPRESSION_FIFO_FIXED_End 15
-#define GC_FEATURES0_COMPRESSION_FIFO_FIXED_Start 15
-#define GC_FEATURES0_COMPRESSION_FIFO_FIXED_Type U01
-#define GC_FEATURES0_COMPRESSION_FIFO_FIXED_NONE 0x0
-#define GC_FEATURES0_COMPRESSION_FIFO_FIXED_AVAILABLE 0x1
-
-/* Floor, ceil, and sign instructions are available. */
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS0 16 : 16
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS0_End 16
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS0_Start 16
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS0_Type U01
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS0_NONE 0x0
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS0_AVAILABLE 0x1
-
-/* VG filter is available. */
-#define GC_FEATURES0_VG_FILTER 17 : 17
-#define GC_FEATURES0_VG_FILTER_End 17
-#define GC_FEATURES0_VG_FILTER_Start 17
-#define GC_FEATURES0_VG_FILTER_Type U01
-#define GC_FEATURES0_VG_FILTER_NONE 0x0
-#define GC_FEATURES0_VG_FILTER_AVAILABLE 0x1
-
-/* Minor updates to VG pipe (Event generation from VG, TS, PE). Tiled image **
-** support. */
-#define GC_FEATURES0_VG_21 18 : 18
-#define GC_FEATURES0_VG_21_End 18
-#define GC_FEATURES0_VG_21_Start 18
-#define GC_FEATURES0_VG_21_Type U01
-#define GC_FEATURES0_VG_21_NONE 0x0
-#define GC_FEATURES0_VG_21_AVAILABLE 0x1
-
-/* W is sent to SH from RA. */
-#define GC_FEATURES0_SHADER_GETS_W 19 : 19
-#define GC_FEATURES0_SHADER_GETS_W_End 19
-#define GC_FEATURES0_SHADER_GETS_W_Start 19
-#define GC_FEATURES0_SHADER_GETS_W_Type U01
-#define GC_FEATURES0_SHADER_GETS_W_NONE 0x0
-#define GC_FEATURES0_SHADER_GETS_W_AVAILABLE 0x1
-
-/* Sqrt, sin, cos instructions are available. */
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS1 20 : 20
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS1_End 20
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS1_Start 20
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS1_Type U01
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS1_NONE 0x0
-#define GC_FEATURES0_EXTRA_SHADER_INSTRUCTIONS1_AVAILABLE 0x1
-
-/* Unavailable registers will return 0. */
-#define GC_FEATURES0_DEFAULT_REG0 21 : 21
-#define GC_FEATURES0_DEFAULT_REG0_End 21
-#define GC_FEATURES0_DEFAULT_REG0_Start 21
-#define GC_FEATURES0_DEFAULT_REG0_Type U01
-#define GC_FEATURES0_DEFAULT_REG0_NONE 0x0
-#define GC_FEATURES0_DEFAULT_REG0_AVAILABLE 0x1
-
-/* New style MC with separate paths for color and depth. */
-#define GC_FEATURES0_MC_20 22 : 22
-#define GC_FEATURES0_MC_20_End 22
-#define GC_FEATURES0_MC_20_Start 22
-#define GC_FEATURES0_MC_20_Type U01
-#define GC_FEATURES0_MC_20_NONE 0x0
-#define GC_FEATURES0_MC_20_AVAILABLE 0x1
-
-/* Put the MSAA data into sideband fifo. */
-#define GC_FEATURES0_SHADER_MSAA_SIDEBAND 23 : 23
-#define GC_FEATURES0_SHADER_MSAA_SIDEBAND_End 23
-#define GC_FEATURES0_SHADER_MSAA_SIDEBAND_Start 23
-#define GC_FEATURES0_SHADER_MSAA_SIDEBAND_Type U01
-#define GC_FEATURES0_SHADER_MSAA_SIDEBAND_NONE 0x0
-#define GC_FEATURES0_SHADER_MSAA_SIDEBAND_AVAILABLE 0x1
-
-#define GC_FEATURES0_BUG_FIXES0 24 : 24
-#define GC_FEATURES0_BUG_FIXES0_End 24
-#define GC_FEATURES0_BUG_FIXES0_Start 24
-#define GC_FEATURES0_BUG_FIXES0_Type U01
-#define GC_FEATURES0_BUG_FIXES0_NONE 0x0
-#define GC_FEATURES0_BUG_FIXES0_AVAILABLE 0x1
-
-/* VAA is available or not. */
-#define GC_FEATURES0_VAA 25 : 25
-#define GC_FEATURES0_VAA_End 25
-#define GC_FEATURES0_VAA_Start 25
-#define GC_FEATURES0_VAA_Type U01
-#define GC_FEATURES0_VAA_NONE 0x0
-#define GC_FEATURES0_VAA_AVAILABLE 0x1
-
-/* Shader supports bypass mode when MSAA is enabled. */
-#define GC_FEATURES0_BYPASS_IN_MSAA 26 : 26
-#define GC_FEATURES0_BYPASS_IN_MSAA_End 26
-#define GC_FEATURES0_BYPASS_IN_MSAA_Start 26
-#define GC_FEATURES0_BYPASS_IN_MSAA_Type U01
-#define GC_FEATURES0_BYPASS_IN_MSAA_NONE 0x0
-#define GC_FEATURES0_BYPASS_IN_MSAA_AVAILABLE 0x1
-
-/* Hierarchiccal Z is supported. */
-#define GC_FEATURES0_HIERARCHICAL_Z 27 : 27
-#define GC_FEATURES0_HIERARCHICAL_Z_End 27
-#define GC_FEATURES0_HIERARCHICAL_Z_Start 27
-#define GC_FEATURES0_HIERARCHICAL_Z_Type U01
-#define GC_FEATURES0_HIERARCHICAL_Z_NONE 0x0
-#define GC_FEATURES0_HIERARCHICAL_Z_AVAILABLE 0x1
-
-/* New texture unit is available. */
-#define GC_FEATURES0_NEW_TEXTURE 28 : 28
-#define GC_FEATURES0_NEW_TEXTURE_End 28
-#define GC_FEATURES0_NEW_TEXTURE_Start 28
-#define GC_FEATURES0_NEW_TEXTURE_Type U01
-#define GC_FEATURES0_NEW_TEXTURE_NONE 0x0
-#define GC_FEATURES0_NEW_TEXTURE_AVAILABLE 0x1
-
-/* 2D engine supports A8 target. */
-#define GC_FEATURES0_A8_TARGET_SUPPORT 29 : 29
-#define GC_FEATURES0_A8_TARGET_SUPPORT_End 29
-#define GC_FEATURES0_A8_TARGET_SUPPORT_Start 29
-#define GC_FEATURES0_A8_TARGET_SUPPORT_Type U01
-#define GC_FEATURES0_A8_TARGET_SUPPORT_NONE 0x0
-#define GC_FEATURES0_A8_TARGET_SUPPORT_AVAILABLE 0x1
-
-/* Correct stencil behavior in depth only. */
-#define GC_FEATURES0_CORRECT_STENCIL 30 : 30
-#define GC_FEATURES0_CORRECT_STENCIL_End 30
-#define GC_FEATURES0_CORRECT_STENCIL_Start 30
-#define GC_FEATURES0_CORRECT_STENCIL_Type U01
-#define GC_FEATURES0_CORRECT_STENCIL_NONE 0x0
-#define GC_FEATURES0_CORRECT_STENCIL_AVAILABLE 0x1
-
-/* Enhance VR and add a mode to walk 16 pixels in 16-bit mode in Vertical **
-** pass to improve $ hit rate when rotating 90/270. */
-#define GC_FEATURES0_ENHANCE_VR 31 : 31
-#define GC_FEATURES0_ENHANCE_VR_End 31
-#define GC_FEATURES0_ENHANCE_VR_Start 31
-#define GC_FEATURES0_ENHANCE_VR_Type U01
-#define GC_FEATURES0_ENHANCE_VR_NONE 0x0
-#define GC_FEATURES0_ENHANCE_VR_AVAILABLE 0x1
-
-union gcfeatures0 {
- struct {
- /* GC_FEATURES0_Address:FLIP_Y */
- unsigned int flipy:1;
-
- /* GC_FEATURES0_Address:DUAL_RETURN_BUS */
- unsigned int dualreturnbus:1;
-
- /* GC_FEATURES0_Address:ENDIANNESS_CONFIG */
- unsigned int endianessconfig:1;
-
- /* GC_FEATURES0_Address:TEXTURE8_K */
- unsigned int texture8k:1;
-
- /* GC_FEATURES0_Address:CORRECT_TEXTURE_CONVERTER */
- unsigned int correcttextureconverter:1;
-
- /* GC_FEATURES0_Address:SPECIAL_MSAA_LOD */
- unsigned int specialmsaalod:1;
-
- /* GC_FEATURES0_Address:FAST_CLEAR_FLUSH */
- unsigned int fastclearflush:1;
-
- /* GC_FEATURES0_Address:2DPE20 */
- unsigned int pe2d20:1;
-
- /* GC_FEATURES0_Address:CORRECT_AUTO_DISABLE */
- unsigned int correctautodisable:1;
-
- /* GC_FEATURES0_Address:RENDER_8K */
- unsigned int render8k:1;
-
- /* GC_FEATURES0_Address:TILE_STATUS_2BITS */
- unsigned int tilestatus2bits:1;
-
- /* GC_FEATURES0_Address:SEPARATE_TILE_STATUS_WHEN_INTERLEAVED */
- unsigned int separatetilestatus:1;
-
- /* GC_FEATURES0_Address:SUPER_TILED_32X32 */
- unsigned int supertiled32x32:1;
-
- /* GC_FEATURES0_Address:VG_20 */
- unsigned int vg20:1;
-
- /* GC_FEATURES0_Address:TS_EXTENDED_COMMANDS */
- unsigned int tsplus:1;
-
- /* GC_FEATURES0_Address:COMPRESSION_FIFO_FIXED */
- unsigned int compressionfifo:1;
-
- /* GC_FEATURES0_Address:EXTRA_SHADER_INSTRUCTIONS0 */
- unsigned int shaderinst0:1;
-
- /* GC_FEATURES0_Address:VG_FILTER */
- unsigned int vgfilter:1;
-
- /* GC_FEATURES0_Address:VG_21 */
- unsigned int vg21:1;
-
- /* GC_FEATURES0_Address:SHADER_GETS_W */
- unsigned int shadergetsw:1;
-
- /* GC_FEATURES0_Address:EXTRA_SHADER_INSTRUCTIONS1 */
- unsigned int shaderinst1:1;
-
- /* GC_FEATURES0_Address:DEFAULT_REG0 */
- unsigned int defaultreg0:1;
-
- /* GC_FEATURES0_Address:MC_20 */
- unsigned int mc20:1;
-
- /* GC_FEATURES0_Address:SHADER_MSAA_SIDEBAND */
- unsigned int shadermsaasideband:1;
-
- /* GC_FEATURES0_Address:BUG_FIXES0 */
- unsigned int bugfixes0:1;
-
- /* GC_FEATURES0_Address:VAA */
- unsigned int vaa:1;
-
- /* GC_FEATURES0_Address:BYPASS_IN_MSAA */
- unsigned int bypassmsaa:1;
-
- /* GC_FEATURES0_Address:HIERARCHICAL_Z */
- unsigned int hz:1;
-
- /* GC_FEATURES0_Address:NEW_TEXTURE */
- unsigned int newtx:1;
-
- /* GC_FEATURES0_Address:A8_TARGET_SUPPORT */
- unsigned int a8target:1;
-
- /* GC_FEATURES0_Address:CORRECT_STENCIL */
- unsigned int correctstencil:1;
-
- /* GC_FEATURES0_Address:ENHANCE_VR */
- unsigned int vr20:1;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register GCMinorFeatures1
-*/
-
-/* Shows which features are enabled in this chip. This register has no set
-** reset value. It varies with the implementation.
-*/
-
-#define GC_FEATURES1_Address 0x00074
-#define GC_FEATURES1_MSB 15
-#define GC_FEATURES1_LSB 0
-#define GC_FEATURES1_BLK 0
-#define GC_FEATURES1_Count 1
-#define GC_FEATURES1_FieldMask 0xFFFFFFFF
-#define GC_FEATURES1_ReadMask 0xFFFFFFFF
-#define GC_FEATURES1_WriteMask 0x00000000
-#define GC_FEATURES1_ResetValue 0x00000000
-
-/* Resolve UV swizzle. */
-#define GC_FEATURES1_RSUV_SWIZZLE 0 : 0
-#define GC_FEATURES1_RSUV_SWIZZLE_End 0
-#define GC_FEATURES1_RSUV_SWIZZLE_Start 0
-#define GC_FEATURES1_RSUV_SWIZZLE_Type U01
-#define GC_FEATURES1_RSUV_SWIZZLE_NONE 0x0
-#define GC_FEATURES1_RSUV_SWIZZLE_AVAILABLE 0x1
-
-/* V2 compression. */
-#define GC_FEATURES1_V2_COMPRESSION 1 : 1
-#define GC_FEATURES1_V2_COMPRESSION_End 1
-#define GC_FEATURES1_V2_COMPRESSION_Start 1
-#define GC_FEATURES1_V2_COMPRESSION_Type U01
-#define GC_FEATURES1_V2_COMPRESSION_NONE 0x0
-#define GC_FEATURES1_V2_COMPRESSION_AVAILABLE 0x1
-
-/* Double buffering support for VG (second TS-->VG semaphore is present). */
-#define GC_FEATURES1_VG_DOUBLE_BUFFER 2 : 2
-#define GC_FEATURES1_VG_DOUBLE_BUFFER_End 2
-#define GC_FEATURES1_VG_DOUBLE_BUFFER_Start 2
-#define GC_FEATURES1_VG_DOUBLE_BUFFER_Type U01
-#define GC_FEATURES1_VG_DOUBLE_BUFFER_NONE 0x0
-#define GC_FEATURES1_VG_DOUBLE_BUFFER_AVAILABLE 0x1
-
-#define GC_FEATURES1_BUG_FIXES1 3 : 3
-#define GC_FEATURES1_BUG_FIXES1_End 3
-#define GC_FEATURES1_BUG_FIXES1_Start 3
-#define GC_FEATURES1_BUG_FIXES1_Type U01
-#define GC_FEATURES1_BUG_FIXES1_NONE 0x0
-#define GC_FEATURES1_BUG_FIXES1_AVAILABLE 0x1
-
-#define GC_FEATURES1_BUG_FIXES2 4 : 4
-#define GC_FEATURES1_BUG_FIXES2_End 4
-#define GC_FEATURES1_BUG_FIXES2_Start 4
-#define GC_FEATURES1_BUG_FIXES2_Type U01
-#define GC_FEATURES1_BUG_FIXES2_NONE 0x0
-#define GC_FEATURES1_BUG_FIXES2_AVAILABLE 0x1
-
-/* Texture has stride and memory addressing. */
-#define GC_FEATURES1_TEXTURE_STRIDE 5 : 5
-#define GC_FEATURES1_TEXTURE_STRIDE_End 5
-#define GC_FEATURES1_TEXTURE_STRIDE_Start 5
-#define GC_FEATURES1_TEXTURE_STRIDE_Type U01
-#define GC_FEATURES1_TEXTURE_STRIDE_NONE 0x0
-#define GC_FEATURES1_TEXTURE_STRIDE_AVAILABLE 0x1
-
-#define GC_FEATURES1_BUG_FIXES3 6 : 6
-#define GC_FEATURES1_BUG_FIXES3_End 6
-#define GC_FEATURES1_BUG_FIXES3_Start 6
-#define GC_FEATURES1_BUG_FIXES3_Type U01
-#define GC_FEATURES1_BUG_FIXES3_NONE 0x0
-#define GC_FEATURES1_BUG_FIXES3_AVAILABLE 0x1
-
-#define GC_FEATURES1_CORRECT_AUTO_DISABLE 7 : 7
-#define GC_FEATURES1_CORRECT_AUTO_DISABLE_End 7
-#define GC_FEATURES1_CORRECT_AUTO_DISABLE_Start 7
-#define GC_FEATURES1_CORRECT_AUTO_DISABLE_Type U01
-#define GC_FEATURES1_CORRECT_AUTO_DISABLE_NONE 0x0
-#define GC_FEATURES1_CORRECT_AUTO_DISABLE_AVAILABLE 0x1
-
-#define GC_FEATURES1_AUTO_RESTART_TS 8 : 8
-#define GC_FEATURES1_AUTO_RESTART_TS_End 8
-#define GC_FEATURES1_AUTO_RESTART_TS_Start 8
-#define GC_FEATURES1_AUTO_RESTART_TS_Type U01
-#define GC_FEATURES1_AUTO_RESTART_TS_NONE 0x0
-#define GC_FEATURES1_AUTO_RESTART_TS_AVAILABLE 0x1
-
-#define GC_FEATURES1_BUG_FIXES4 9 : 9
-#define GC_FEATURES1_BUG_FIXES4_End 9
-#define GC_FEATURES1_BUG_FIXES4_Start 9
-#define GC_FEATURES1_BUG_FIXES4_Type U01
-#define GC_FEATURES1_BUG_FIXES4_NONE 0x0
-#define GC_FEATURES1_BUG_FIXES4_AVAILABLE 0x1
-
-#define GC_FEATURES1_L2_WINDOWING 10 : 10
-#define GC_FEATURES1_L2_WINDOWING_End 10
-#define GC_FEATURES1_L2_WINDOWING_Start 10
-#define GC_FEATURES1_L2_WINDOWING_Type U01
-#define GC_FEATURES1_L2_WINDOWING_NONE 0x0
-#define GC_FEATURES1_L2_WINDOWING_AVAILABLE 0x1
-
-#define GC_FEATURES1_HALF_FLOAT_PIPE 11 : 11
-#define GC_FEATURES1_HALF_FLOAT_PIPE_End 11
-#define GC_FEATURES1_HALF_FLOAT_PIPE_Start 11
-#define GC_FEATURES1_HALF_FLOAT_PIPE_Type U01
-#define GC_FEATURES1_HALF_FLOAT_PIPE_NONE 0x0
-#define GC_FEATURES1_HALF_FLOAT_PIPE_AVAILABLE 0x1
-
-#define GC_FEATURES1_PIXEL_DITHER 12 : 12
-#define GC_FEATURES1_PIXEL_DITHER_End 12
-#define GC_FEATURES1_PIXEL_DITHER_Start 12
-#define GC_FEATURES1_PIXEL_DITHER_Type U01
-#define GC_FEATURES1_PIXEL_DITHER_NONE 0x0
-#define GC_FEATURES1_PIXEL_DITHER_AVAILABLE 0x1
-
-#define GC_FEATURES1_TWO_STENCIL_REFERENCE 13 : 13
-#define GC_FEATURES1_TWO_STENCIL_REFERENCE_End 13
-#define GC_FEATURES1_TWO_STENCIL_REFERENCE_Start 13
-#define GC_FEATURES1_TWO_STENCIL_REFERENCE_Type U01
-#define GC_FEATURES1_TWO_STENCIL_REFERENCE_NONE 0x0
-#define GC_FEATURES1_TWO_STENCIL_REFERENCE_AVAILABLE 0x1
-
-#define GC_FEATURES1_EXTENDED_PIXEL_FORMAT 14 : 14
-#define GC_FEATURES1_EXTENDED_PIXEL_FORMAT_End 14
-#define GC_FEATURES1_EXTENDED_PIXEL_FORMAT_Start 14
-#define GC_FEATURES1_EXTENDED_PIXEL_FORMAT_Type U01
-#define GC_FEATURES1_EXTENDED_PIXEL_FORMAT_NONE 0x0
-#define GC_FEATURES1_EXTENDED_PIXEL_FORMAT_AVAILABLE 0x1
-
-/* EEZ and HZ are correct. */
-#define GC_FEATURES1_CORRECT_MIN_MAX_DEPTH 15 : 15
-#define GC_FEATURES1_CORRECT_MIN_MAX_DEPTH_End 15
-#define GC_FEATURES1_CORRECT_MIN_MAX_DEPTH_Start 15
-#define GC_FEATURES1_CORRECT_MIN_MAX_DEPTH_Type U01
-#define GC_FEATURES1_CORRECT_MIN_MAX_DEPTH_NONE 0x0
-#define GC_FEATURES1_CORRECT_MIN_MAX_DEPTH_AVAILABLE 0x1
-
-/* Dither and filter+alpha available. */
-#define GC_FEATURES1_DITHER_AND_FILTER_PLUS_ALPHA_2D 16 : 16
-#define GC_FEATURES1_DITHER_AND_FILTER_PLUS_ALPHA_2D_End 16
-#define GC_FEATURES1_DITHER_AND_FILTER_PLUS_ALPHA_2D_Start 16
-#define GC_FEATURES1_DITHER_AND_FILTER_PLUS_ALPHA_2D_Type U01
-#define GC_FEATURES1_DITHER_AND_FILTER_PLUS_ALPHA_2D_NONE 0x0
-#define GC_FEATURES1_DITHER_AND_FILTER_PLUS_ALPHA_2D_AVAILABLE 0x1
-
-#define GC_FEATURES1_BUG_FIXES5 17 : 17
-#define GC_FEATURES1_BUG_FIXES5_End 17
-#define GC_FEATURES1_BUG_FIXES5_Start 17
-#define GC_FEATURES1_BUG_FIXES5_Type U01
-#define GC_FEATURES1_BUG_FIXES5_NONE 0x0
-#define GC_FEATURES1_BUG_FIXES5_AVAILABLE 0x1
-
-#define GC_FEATURES1_NEW_2D 18 : 18
-#define GC_FEATURES1_NEW_2D_End 18
-#define GC_FEATURES1_NEW_2D_Start 18
-#define GC_FEATURES1_NEW_2D_Type U01
-#define GC_FEATURES1_NEW_2D_NONE 0x0
-#define GC_FEATURES1_NEW_2D_AVAILABLE 0x1
-
-#define GC_FEATURES1_NEW_FLOATING_POINT_ARITHMETIC 19 : 19
-#define GC_FEATURES1_NEW_FLOATING_POINT_ARITHMETIC_End 19
-#define GC_FEATURES1_NEW_FLOATING_POINT_ARITHMETIC_Start 19
-#define GC_FEATURES1_NEW_FLOATING_POINT_ARITHMETIC_Type U01
-#define GC_FEATURES1_NEW_FLOATING_POINT_ARITHMETIC_NONE 0x0
-#define GC_FEATURES1_NEW_FLOATING_POINT_ARITHMETIC_AVAILABLE 0x1
-
-#define GC_FEATURES1_TEXTURE_HORIZONTAL_ALIGNMENT_SELECT 20 : 20
-#define GC_FEATURES1_TEXTURE_HORIZONTAL_ALIGNMENT_SELECT_End 20
-#define GC_FEATURES1_TEXTURE_HORIZONTAL_ALIGNMENT_SELECT_Start 20
-#define GC_FEATURES1_TEXTURE_HORIZONTAL_ALIGNMENT_SELECT_Type U01
-#define GC_FEATURES1_TEXTURE_HORIZONTAL_ALIGNMENT_SELECT_NONE 0x0
-#define GC_FEATURES1_TEXTURE_HORIZONTAL_ALIGNMENT_SELECT_AVAILABLE 0x1
-
-#define GC_FEATURES1_NON_POWER_OF_TWO 21 : 21
-#define GC_FEATURES1_NON_POWER_OF_TWO_End 21
-#define GC_FEATURES1_NON_POWER_OF_TWO_Start 21
-#define GC_FEATURES1_NON_POWER_OF_TWO_Type U01
-#define GC_FEATURES1_NON_POWER_OF_TWO_NONE 0x0
-#define GC_FEATURES1_NON_POWER_OF_TWO_AVAILABLE 0x1
-
-#define GC_FEATURES1_LINEAR_TEXTURE_SUPPORT 22 : 22
-#define GC_FEATURES1_LINEAR_TEXTURE_SUPPORT_End 22
-#define GC_FEATURES1_LINEAR_TEXTURE_SUPPORT_Start 22
-#define GC_FEATURES1_LINEAR_TEXTURE_SUPPORT_Type U01
-#define GC_FEATURES1_LINEAR_TEXTURE_SUPPORT_NONE 0x0
-#define GC_FEATURES1_LINEAR_TEXTURE_SUPPORT_AVAILABLE 0x1
-
-#define GC_FEATURES1_HALTI0 23 : 23
-#define GC_FEATURES1_HALTI0_End 23
-#define GC_FEATURES1_HALTI0_Start 23
-#define GC_FEATURES1_HALTI0_Type U01
-#define GC_FEATURES1_HALTI0_NONE 0x0
-#define GC_FEATURES1_HALTI0_AVAILABLE 0x1
-
-#define GC_FEATURES1_CORRECT_OVERFLOW_VG 24 : 24
-#define GC_FEATURES1_CORRECT_OVERFLOW_VG_End 24
-#define GC_FEATURES1_CORRECT_OVERFLOW_VG_Start 24
-#define GC_FEATURES1_CORRECT_OVERFLOW_VG_Type U01
-#define GC_FEATURES1_CORRECT_OVERFLOW_VG_NONE 0x0
-#define GC_FEATURES1_CORRECT_OVERFLOW_VG_AVAILABLE 0x1
-
-#define GC_FEATURES1_NEGATIVE_LOG_FIX 25 : 25
-#define GC_FEATURES1_NEGATIVE_LOG_FIX_End 25
-#define GC_FEATURES1_NEGATIVE_LOG_FIX_Start 25
-#define GC_FEATURES1_NEGATIVE_LOG_FIX_Type U01
-#define GC_FEATURES1_NEGATIVE_LOG_FIX_NONE 0x0
-#define GC_FEATURES1_NEGATIVE_LOG_FIX_AVAILABLE 0x1
-
-#define GC_FEATURES1_RESOLVE_OFFSET 26 : 26
-#define GC_FEATURES1_RESOLVE_OFFSET_End 26
-#define GC_FEATURES1_RESOLVE_OFFSET_Start 26
-#define GC_FEATURES1_RESOLVE_OFFSET_Type U01
-#define GC_FEATURES1_RESOLVE_OFFSET_NONE 0x0
-#define GC_FEATURES1_RESOLVE_OFFSET_AVAILABLE 0x1
-
-#define GC_FEATURES1_OK_TO_GATE_AXI_CLOCK 27 : 27
-#define GC_FEATURES1_OK_TO_GATE_AXI_CLOCK_End 27
-#define GC_FEATURES1_OK_TO_GATE_AXI_CLOCK_Start 27
-#define GC_FEATURES1_OK_TO_GATE_AXI_CLOCK_Type U01
-#define GC_FEATURES1_OK_TO_GATE_AXI_CLOCK_NONE 0x0
-#define GC_FEATURES1_OK_TO_GATE_AXI_CLOCK_AVAILABLE 0x1
-
-#define GC_FEATURES1_MMU 28 : 28
-#define GC_FEATURES1_MMU_End 28
-#define GC_FEATURES1_MMU_Start 28
-#define GC_FEATURES1_MMU_Type U01
-#define GC_FEATURES1_MMU_NONE 0x0
-#define GC_FEATURES1_MMU_AVAILABLE 0x1
-
-#define GC_FEATURES1_WIDE_LINE 29 : 29
-#define GC_FEATURES1_WIDE_LINE_End 29
-#define GC_FEATURES1_WIDE_LINE_Start 29
-#define GC_FEATURES1_WIDE_LINE_Type U01
-#define GC_FEATURES1_WIDE_LINE_NONE 0x0
-#define GC_FEATURES1_WIDE_LINE_AVAILABLE 0x1
-
-#define GC_FEATURES1_BUG_FIXES6 30 : 30
-#define GC_FEATURES1_BUG_FIXES6_End 30
-#define GC_FEATURES1_BUG_FIXES6_Start 30
-#define GC_FEATURES1_BUG_FIXES6_Type U01
-#define GC_FEATURES1_BUG_FIXES6_NONE 0x0
-#define GC_FEATURES1_BUG_FIXES6_AVAILABLE 0x1
-
-#define GC_FEATURES1_FC_FLUSH_STALL 31 : 31
-#define GC_FEATURES1_FC_FLUSH_STALL_End 31
-#define GC_FEATURES1_FC_FLUSH_STALL_Start 31
-#define GC_FEATURES1_FC_FLUSH_STALL_Type U01
-#define GC_FEATURES1_FC_FLUSH_STALL_NONE 0x0
-#define GC_FEATURES1_FC_FLUSH_STALL_AVAILABLE 0x1
-
-union gcfeatures1 {
- struct {
- /* GC_FEATURES1_Address:RSUV_SWIZZLE */
- unsigned int rsuvswizzle:1;
-
- /* GC_FEATURES1_Address:V2_COMPRESSION */
- unsigned int v2compression:1;
-
- /* GC_FEATURES1_Address:VG_DOUBLE_BUFFER */
- unsigned int vgdblbuffer:1;
-
- /* GC_FEATURES1_Address:BUG_FIXES1 */
- unsigned int bugfixes1:1;
-
- /* GC_FEATURES1_Address:BUG_FIXES2 */
- unsigned int bugfixes2:1;
-
- /* GC_FEATURES1_Address:TEXTURE_STRIDE */
- unsigned int txstride:1;
-
- /* GC_FEATURES1_Address:BUG_FIXES3 */
- unsigned int bugfixes3:1;
-
- /* GC_FEATURES1_Address:CORRECT_AUTO_DISABLE */
- unsigned int correctautodisable:1;
-
- /* GC_FEATURES1_Address:AUTO_RESTART_TS */
- unsigned int autorestartts:1;
-
- /* GC_FEATURES1_Address:BUG_FIXES4 */
- unsigned int bugfixes4:1;
-
- /* GC_FEATURES1_Address:L2_WINDOWING */
- unsigned int l2win:1;
-
- /* GC_FEATURES1_Address:HALF_FLOAT_PIPE */
- unsigned int halffloatpipe:1;
-
- /* GC_FEATURES1_Address:PIXEL_DITHER */
- unsigned int pixeldither:1;
-
- /* GC_FEATURES1_Address:TWO_STENCIL_REFERENCE */
- unsigned int twostencilref:1;
-
- /* GC_FEATURES1_Address:EXTENDED_PIXEL_FORMAT */
- unsigned int pixformatex:1;
-
- /* GC_FEATURES1_Address:CORRECT_MIN_MAX_DEPTH */
- unsigned int correctminmaxdepth:1;
-
- /* GC_FEATURES1_Address:DITHER_AND_FILTER_PLUS_ALPHA_2D */
- unsigned int ditherfilter:1;
-
- /* GC_FEATURES1_Address:BUG_FIXES5 */
- unsigned int bugfixes5:1;
-
- /* GC_FEATURES1_Address:NEW_2D */
- unsigned int new2d:1;
-
- /* GC_FEATURES1_Address:NEW_FLOATING_POINT_ARITHMETIC */
- unsigned int newfp:1;
-
- /* GC_FEATURES1_Address:TEXTURE_HORIZONTAL_ALIGNMENT_SELECT */
- unsigned int txalign:1;
-
- /* GC_FEATURES1_Address:NON_POWER_OF_TWO */
- unsigned int nonpowof2:1;
-
- /* GC_FEATURES1_Address:LINEAR_TEXTURE_SUPPORT */
- unsigned int lineartx:1;
-
- /* GC_FEATURES1_Address:HALTI0 */
- unsigned int halti0:1;
-
- /* GC_FEATURES1_Address:CORRECT_OVERFLOW_VG */
- unsigned int correctoverflowvg:1;
-
- /* GC_FEATURES1_Address:NEGATIVE_LOG_FIX */
- unsigned int neglogfix:1;
-
- /* GC_FEATURES1_Address:RESOLVE_OFFSET */
- unsigned int rsoffset:1;
-
- /* GC_FEATURES1_Address:OK_TO_GATE_AXI_CLOCK */
- unsigned int axiclockgating:1;
-
- /* GC_FEATURES1_Address:MMU */
- unsigned int mmu:1;
-
- /* GC_FEATURES1_Address:WIDE_LINE */
- unsigned int wideline:1;
-
- /* GC_FEATURES1_Address:BUG_FIXES6 */
- unsigned int bugfixes6:1;
-
- /* GC_FEATURES1_Address:FC_FLUSH_STALL */
- unsigned int fcflushstall:1;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register GCMinorFeatures2
-*/
-
-/* Shows which features are enabled in this chip. This register has no set **
-** reset value. It varies with the implementation. */
-
-#define GC_FEATURES2_Address 0x00084
-#define GC_FEATURES2_MSB 15
-#define GC_FEATURES2_LSB 0
-#define GC_FEATURES2_BLK 0
-#define GC_FEATURES2_Count 1
-#define GC_FEATURES2_FieldMask 0xFFFFFFFF
-#define GC_FEATURES2_ReadMask 0xFFFFFFFF
-#define GC_FEATURES2_WriteMask 0x00000000
-#define GC_FEATURES2_ResetValue 0x00000000
-
-#define GC_FEATURES2_LINE_LOOP 0 : 0
-#define GC_FEATURES2_LINE_LOOP_End 0
-#define GC_FEATURES2_LINE_LOOP_Start 0
-#define GC_FEATURES2_LINE_LOOP_Type U01
-#define GC_FEATURES2_LINE_LOOP_NONE 0x0
-#define GC_FEATURES2_LINE_LOOP_AVAILABLE 0x1
-
-#define GC_FEATURES2_LOGIC_OP 1 : 1
-#define GC_FEATURES2_LOGIC_OP_End 1
-#define GC_FEATURES2_LOGIC_OP_Start 1
-#define GC_FEATURES2_LOGIC_OP_Type U01
-#define GC_FEATURES2_LOGIC_OP_NONE 0x0
-#define GC_FEATURES2_LOGIC_OP_AVAILABLE 0x1
-
-#define GC_FEATURES2_SEAMLESS_CUBE_MAP 2 : 2
-#define GC_FEATURES2_SEAMLESS_CUBE_MAP_End 2
-#define GC_FEATURES2_SEAMLESS_CUBE_MAP_Start 2
-#define GC_FEATURES2_SEAMLESS_CUBE_MAP_Type U01
-#define GC_FEATURES2_SEAMLESS_CUBE_MAP_NONE 0x0
-#define GC_FEATURES2_SEAMLESS_CUBE_MAP_AVAILABLE 0x1
-
-#define GC_FEATURES2_SUPER_TILED_TEXTURE 3 : 3
-#define GC_FEATURES2_SUPER_TILED_TEXTURE_End 3
-#define GC_FEATURES2_SUPER_TILED_TEXTURE_Start 3
-#define GC_FEATURES2_SUPER_TILED_TEXTURE_Type U01
-#define GC_FEATURES2_SUPER_TILED_TEXTURE_NONE 0x0
-#define GC_FEATURES2_SUPER_TILED_TEXTURE_AVAILABLE 0x1
-
-#define GC_FEATURES2_LINEAR_PE 4 : 4
-#define GC_FEATURES2_LINEAR_PE_End 4
-#define GC_FEATURES2_LINEAR_PE_Start 4
-#define GC_FEATURES2_LINEAR_PE_Type U01
-#define GC_FEATURES2_LINEAR_PE_NONE 0x0
-#define GC_FEATURES2_LINEAR_PE_AVAILABLE 0x1
-
-#define GC_FEATURES2_RECT_PRIMITIVE 5 : 5
-#define GC_FEATURES2_RECT_PRIMITIVE_End 5
-#define GC_FEATURES2_RECT_PRIMITIVE_Start 5
-#define GC_FEATURES2_RECT_PRIMITIVE_Type U01
-#define GC_FEATURES2_RECT_PRIMITIVE_NONE 0x0
-#define GC_FEATURES2_RECT_PRIMITIVE_AVAILABLE 0x1
-
-#define GC_FEATURES2_COMPOSITION 6 : 6
-#define GC_FEATURES2_COMPOSITION_End 6
-#define GC_FEATURES2_COMPOSITION_Start 6
-#define GC_FEATURES2_COMPOSITION_Type U01
-#define GC_FEATURES2_COMPOSITION_NONE 0x0
-#define GC_FEATURES2_COMPOSITION_AVAILABLE 0x1
-
-#define GC_FEATURES2_CORRECT_AUTO_DISABLE_COUNT_WIDTH 7 : 7
-#define GC_FEATURES2_CORRECT_AUTO_DISABLE_COUNT_WIDTH_End 7
-#define GC_FEATURES2_CORRECT_AUTO_DISABLE_COUNT_WIDTH_Start 7
-#define GC_FEATURES2_CORRECT_AUTO_DISABLE_COUNT_WIDTH_Type U01
-#define GC_FEATURES2_CORRECT_AUTO_DISABLE_COUNT_WIDTH_NONE 0x0
-#define GC_FEATURES2_CORRECT_AUTO_DISABLE_COUNT_WIDTH_AVAILABLE 0x1
-
-#define GC_FEATURES2_PE_SWIZZLE 8 : 8
-#define GC_FEATURES2_PE_SWIZZLE_End 8
-#define GC_FEATURES2_PE_SWIZZLE_Start 8
-#define GC_FEATURES2_PE_SWIZZLE_Type U01
-#define GC_FEATURES2_PE_SWIZZLE_NONE 0x0
-#define GC_FEATURES2_PE_SWIZZLE_AVAILABLE 0x1
-
-#define GC_FEATURES2_END_EVENT 9 : 9
-#define GC_FEATURES2_END_EVENT_End 9
-#define GC_FEATURES2_END_EVENT_Start 9
-#define GC_FEATURES2_END_EVENT_Type U01
-#define GC_FEATURES2_END_EVENT_NONE 0x0
-#define GC_FEATURES2_END_EVENT_AVAILABLE 0x1
-
-#define GC_FEATURES2_S1S8 10 : 10
-#define GC_FEATURES2_S1S8_End 10
-#define GC_FEATURES2_S1S8_Start 10
-#define GC_FEATURES2_S1S8_Type U01
-#define GC_FEATURES2_S1S8_NONE 0x0
-#define GC_FEATURES2_S1S8_AVAILABLE 0x1
-
-#define GC_FEATURES2_HALTI1 11 : 11
-#define GC_FEATURES2_HALTI1_End 11
-#define GC_FEATURES2_HALTI1_Start 11
-#define GC_FEATURES2_HALTI1_Type U01
-#define GC_FEATURES2_HALTI1_NONE 0x0
-#define GC_FEATURES2_HALTI1_AVAILABLE 0x1
-
-#define GC_FEATURES2_RGB888 12 : 12
-#define GC_FEATURES2_RGB888_End 12
-#define GC_FEATURES2_RGB888_Start 12
-#define GC_FEATURES2_RGB888_Type U01
-#define GC_FEATURES2_RGB888_NONE 0x0
-#define GC_FEATURES2_RGB888_AVAILABLE 0x1
-
-#define GC_FEATURES2_TX__YUV_ASSEMBLER 13 : 13
-#define GC_FEATURES2_TX__YUV_ASSEMBLER_End 13
-#define GC_FEATURES2_TX__YUV_ASSEMBLER_Start 13
-#define GC_FEATURES2_TX__YUV_ASSEMBLER_Type U01
-#define GC_FEATURES2_TX__YUV_ASSEMBLER_NONE 0x0
-#define GC_FEATURES2_TX__YUV_ASSEMBLER_AVAILABLE 0x1
-
-#define GC_FEATURES2_DYNAMIC_FREQUENCY_SCALING 14 : 14
-#define GC_FEATURES2_DYNAMIC_FREQUENCY_SCALING_End 14
-#define GC_FEATURES2_DYNAMIC_FREQUENCY_SCALING_Start 14
-#define GC_FEATURES2_DYNAMIC_FREQUENCY_SCALING_Type U01
-#define GC_FEATURES2_DYNAMIC_FREQUENCY_SCALING_NONE 0x0
-#define GC_FEATURES2_DYNAMIC_FREQUENCY_SCALING_AVAILABLE 0x1
-
-#define GC_FEATURES2_TX_FILTER 15 : 15
-#define GC_FEATURES2_TX_FILTER_End 15
-#define GC_FEATURES2_TX_FILTER_Start 15
-#define GC_FEATURES2_TX_FILTER_Type U01
-#define GC_FEATURES2_TX_FILTER_NONE 0x0
-#define GC_FEATURES2_TX_FILTER_AVAILABLE 0x1
-
-#define GC_FEATURES2_FULL_DIRECT_FB 16 : 16
-#define GC_FEATURES2_FULL_DIRECT_FB_End 16
-#define GC_FEATURES2_FULL_DIRECT_FB_Start 16
-#define GC_FEATURES2_FULL_DIRECT_FB_Type U01
-#define GC_FEATURES2_FULL_DIRECT_FB_NONE 0x0
-#define GC_FEATURES2_FULL_DIRECT_FB_AVAILABLE 0x1
-
-#define GC_FEATURES2_ONE_PASS_2D_FILTER 17 : 17
-#define GC_FEATURES2_ONE_PASS_2D_FILTER_End 17
-#define GC_FEATURES2_ONE_PASS_2D_FILTER_Start 17
-#define GC_FEATURES2_ONE_PASS_2D_FILTER_Type U01
-#define GC_FEATURES2_ONE_PASS_2D_FILTER_NONE 0x0
-#define GC_FEATURES2_ONE_PASS_2D_FILTER_AVAILABLE 0x1
-
-#define GC_FEATURES2_THREAD_WALKER_IN_PS 18 : 18
-#define GC_FEATURES2_THREAD_WALKER_IN_PS_End 18
-#define GC_FEATURES2_THREAD_WALKER_IN_PS_Start 18
-#define GC_FEATURES2_THREAD_WALKER_IN_PS_Type U01
-#define GC_FEATURES2_THREAD_WALKER_IN_PS_NONE 0x0
-#define GC_FEATURES2_THREAD_WALKER_IN_PS_AVAILABLE 0x1
-
-#define GC_FEATURES2_TILE_FILLER 19 : 19
-#define GC_FEATURES2_TILE_FILLER_End 19
-#define GC_FEATURES2_TILE_FILLER_Start 19
-#define GC_FEATURES2_TILE_FILLER_Type U01
-#define GC_FEATURES2_TILE_FILLER_NONE 0x0
-#define GC_FEATURES2_TILE_FILLER_AVAILABLE 0x1
-
-#define GC_FEATURES2_YUV_STANDARD 20 : 20
-#define GC_FEATURES2_YUV_STANDARD_End 20
-#define GC_FEATURES2_YUV_STANDARD_Start 20
-#define GC_FEATURES2_YUV_STANDARD_Type U01
-#define GC_FEATURES2_YUV_STANDARD_NONE 0x0
-#define GC_FEATURES2_YUV_STANDARD_AVAILABLE 0x1
-
-#define GC_FEATURES2_MULTI_SOURCE_BLT 21 : 21
-#define GC_FEATURES2_MULTI_SOURCE_BLT_End 21
-#define GC_FEATURES2_MULTI_SOURCE_BLT_Start 21
-#define GC_FEATURES2_MULTI_SOURCE_BLT_Type U01
-#define GC_FEATURES2_MULTI_SOURCE_BLT_NONE 0x0
-#define GC_FEATURES2_MULTI_SOURCE_BLT_AVAILABLE 0x1
-
-#define GC_FEATURES2_YUV_CONVERSION 22 : 22
-#define GC_FEATURES2_YUV_CONVERSION_End 22
-#define GC_FEATURES2_YUV_CONVERSION_Start 22
-#define GC_FEATURES2_YUV_CONVERSION_Type U01
-#define GC_FEATURES2_YUV_CONVERSION_NONE 0x0
-#define GC_FEATURES2_YUV_CONVERSION_AVAILABLE 0x1
-
-#define GC_FEATURES2_FLUSH_FIXED_2D 23 : 23
-#define GC_FEATURES2_FLUSH_FIXED_2D_End 23
-#define GC_FEATURES2_FLUSH_FIXED_2D_Start 23
-#define GC_FEATURES2_FLUSH_FIXED_2D_Type U01
-#define GC_FEATURES2_FLUSH_FIXED_2D_NONE 0x0
-#define GC_FEATURES2_FLUSH_FIXED_2D_AVAILABLE 0x1
-
-#define GC_FEATURES2_INTERLEAVER 24 : 24
-#define GC_FEATURES2_INTERLEAVER_End 24
-#define GC_FEATURES2_INTERLEAVER_Start 24
-#define GC_FEATURES2_INTERLEAVER_Type U01
-#define GC_FEATURES2_INTERLEAVER_NONE 0x0
-#define GC_FEATURES2_INTERLEAVER_AVAILABLE 0x1
-
-#define GC_FEATURES2_MIXED_STREAMS 25 : 25
-#define GC_FEATURES2_MIXED_STREAMS_End 25
-#define GC_FEATURES2_MIXED_STREAMS_Start 25
-#define GC_FEATURES2_MIXED_STREAMS_Type U01
-#define GC_FEATURES2_MIXED_STREAMS_NONE 0x0
-#define GC_FEATURES2_MIXED_STREAMS_AVAILABLE 0x1
-
-#define GC_FEATURES2_L2_CACHE_FOR_2D_420 26 : 26
-#define GC_FEATURES2_L2_CACHE_FOR_2D_420_End 26
-#define GC_FEATURES2_L2_CACHE_FOR_2D_420_Start 26
-#define GC_FEATURES2_L2_CACHE_FOR_2D_420_Type U01
-#define GC_FEATURES2_L2_CACHE_FOR_2D_420_NONE 0x0
-#define GC_FEATURES2_L2_CACHE_FOR_2D_420_AVAILABLE 0x1
-
-#define GC_FEATURES2_BUG_FIXES7 27 : 27
-#define GC_FEATURES2_BUG_FIXES7_End 27
-#define GC_FEATURES2_BUG_FIXES7_Start 27
-#define GC_FEATURES2_BUG_FIXES7_Type U01
-#define GC_FEATURES2_BUG_FIXES7_NONE 0x0
-#define GC_FEATURES2_BUG_FIXES7_AVAILABLE 0x1
-
-#define GC_FEATURES2_NO_INDEX_PATTERN 28 : 28
-#define GC_FEATURES2_NO_INDEX_PATTERN_End 28
-#define GC_FEATURES2_NO_INDEX_PATTERN_Start 28
-#define GC_FEATURES2_NO_INDEX_PATTERN_Type U01
-#define GC_FEATURES2_NO_INDEX_PATTERN_NONE 0x0
-#define GC_FEATURES2_NO_INDEX_PATTERN_AVAILABLE 0x1
-
-#define GC_FEATURES2_TEXTURE_TILE_STATUS 29 : 29
-#define GC_FEATURES2_TEXTURE_TILE_STATUS_End 29
-#define GC_FEATURES2_TEXTURE_TILE_STATUS_Start 29
-#define GC_FEATURES2_TEXTURE_TILE_STATUS_Type U01
-#define GC_FEATURES2_TEXTURE_TILE_STATUS_NONE 0x0
-#define GC_FEATURES2_TEXTURE_TILE_STATUS_AVAILABLE 0x1
-
-#define GC_FEATURES2_DECOMPRESS_Z16 30 : 30
-#define GC_FEATURES2_DECOMPRESS_Z16_End 30
-#define GC_FEATURES2_DECOMPRESS_Z16_Start 30
-#define GC_FEATURES2_DECOMPRESS_Z16_Type U01
-#define GC_FEATURES2_DECOMPRESS_Z16_NONE 0x0
-#define GC_FEATURES2_DECOMPRESS_Z16_AVAILABLE 0x1
-
-#define GC_FEATURES2_BUG_FIXES8 31 : 31
-#define GC_FEATURES2_BUG_FIXES8_End 31
-#define GC_FEATURES2_BUG_FIXES8_Start 31
-#define GC_FEATURES2_BUG_FIXES8_Type U01
-#define GC_FEATURES2_BUG_FIXES8_NONE 0x0
-#define GC_FEATURES2_BUG_FIXES8_AVAILABLE 0x1
-
-union gcfeatures2 {
- struct {
- /* GC_FEATURES2_Address:LINE_LOOP */
- unsigned int lineloop:1;
-
- /* GC_FEATURES2_Address:LOGIC_OP */
- unsigned int logop:1;
-
- /* GC_FEATURES2_Address:SEAMLESS_CUBE_MAP */
- unsigned int cubemap:1;
-
- /* GC_FEATURES2_Address:SUPER_TILED_TEXTURE */
- unsigned int supertiledtx:1;
-
- /* GC_FEATURES2_Address:LINEAR_PE */
- unsigned int linearpe:1;
-
- /* GC_FEATURES2_Address:RECT_PRIMITIVE */
- unsigned int rectprim:1;
-
- /* GC_FEATURES2_Address:COMPOSITION */
- unsigned int composition:1;
-
- /* GC_FEATURES2_Address:CORRECT_AUTO_DISABLE_COUNT_WIDTH */
- unsigned int correctcountwidth:1;
-
- /* GC_FEATURES2_Address:PE_SWIZZLE */
- unsigned int peswizzle:1;
-
- /* GC_FEATURES2_Address:END_EVENT */
- unsigned int endevent:1;
-
- /* GC_FEATURES2_Address:S1S8 */
- unsigned int s1s8:1;
-
- /* GC_FEATURES2_Address:HALTI1 */
- unsigned int halti1:1;
-
- /* GC_FEATURES2_Address:RGB888 */
- unsigned int rgb888:1;
-
- /* GC_FEATURES2_Address:TX__YUV_ASSEMBLER */
- unsigned int txyuvasm:1;
-
- /* GC_FEATURES2_Address:DYNAMIC_FREQUENCY_SCALING */
- unsigned int dynscaling:1;
-
- /* GC_FEATURES2_Address:TX_FILTER */
- unsigned int txfilter:1;
-
- /* GC_FEATURES2_Address:FULL_DIRECT_FB */
- unsigned int dfb:1;
-
- /* GC_FEATURES2_Address:ONE_PASS_2D_FILTER */
- unsigned int onepassfilter:1;
-
- /* GC_FEATURES2_Address:THREAD_WALKER_IN_PS */
- unsigned int pstw:1;
-
- /* GC_FEATURES2_Address:TILE_FILLER */
- unsigned int tilefiller:1;
-
- /* GC_FEATURES2_Address:YUV_STANDARD */
- unsigned int yuvstd:1;
-
- /* GC_FEATURES2_Address:MULTI_SOURCE_BLT */
- unsigned int multisrc:1;
-
- /* GC_FEATURES2_Address:YUV_CONVERSION */
- unsigned int yuvconvert:1;
-
- /* GC_FEATURES2_Address:FLUSH_FIXED_2D */
- unsigned int flushfixed2d:1;
-
- /* GC_FEATURES2_Address:INTERLEAVER */
- unsigned int interleaver:1;
-
- /* GC_FEATURES2_Address:MIXED_STREAMS */
- unsigned int mixedstreams:1;
-
- /* GC_FEATURES2_Address:L2_CACHE_FOR_2D_420 */
- unsigned int l2cachefor420:1;
-
- /* GC_FEATURES2_Address:BUG_FIXES7 */
- unsigned int bugfixes7:1;
-
- /* GC_FEATURES2_Address:NO_INDEX_PATTERN */
- unsigned int noindexpatern:1;
-
- /* GC_FEATURES2_Address:TEXTURE_TILE_STATUS */
- unsigned int tilestatustx:1;
-
- /* GC_FEATURES2_Address:DECOMPRESS_Z16 */
- unsigned int decompressz16:1;
-
- /* GC_FEATURES2_Address:BUG_FIXES8 */
- unsigned int bugfixes8:1;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register GCMinorFeatures3
-*/
-
-/* Shows which features are enabled in this chip. This register has no set **
-** reset value, it varies with the implementation. */
-
-#define GC_FEATURES3_Address 0x00088
-#define GC_FEATURES3_MSB 15
-#define GC_FEATURES3_LSB 0
-#define GC_FEATURES3_BLK 0
-#define GC_FEATURES3_Count 1
-#define GC_FEATURES3_FieldMask 0x003FFFFF
-#define GC_FEATURES3_ReadMask 0x003FFFFF
-#define GC_FEATURES3_WriteMask 0x00000000
-#define GC_FEATURES3_ResetValue 0x00000000
-
-#define GC_FEATURES3_DE_ROTATION_STALL_FIX 0 : 0
-#define GC_FEATURES3_DE_ROTATION_STALL_FIX_End 0
-#define GC_FEATURES3_DE_ROTATION_STALL_FIX_Start 0
-#define GC_FEATURES3_DE_ROTATION_STALL_FIX_Type U01
-#define GC_FEATURES3_DE_ROTATION_STALL_FIX_NONE 0x0
-#define GC_FEATURES3_DE_ROTATION_STALL_FIX_AVAILABLE 0x1
-
-#define GC_FEATURES3_OCL_ONLY 1 : 1
-#define GC_FEATURES3_OCL_ONLY_End 1
-#define GC_FEATURES3_OCL_ONLY_Start 1
-#define GC_FEATURES3_OCL_ONLY_Type U01
-#define GC_FEATURES3_OCL_ONLY_NONE 0x0
-#define GC_FEATURES3_OCL_ONLY_AVAILABLE 0x1
-
-#define GC_FEATURES3_NEW_FEATURES0 2 : 2
-#define GC_FEATURES3_NEW_FEATURES0_End 2
-#define GC_FEATURES3_NEW_FEATURES0_Start 2
-#define GC_FEATURES3_NEW_FEATURES0_Type U01
-#define GC_FEATURES3_NEW_FEATURES0_NONE 0x0
-#define GC_FEATURES3_NEW_FEATURES0_AVAILABLE 0x1
-
-#define GC_FEATURES3_INSTRUCTION_CACHE 3 : 3
-#define GC_FEATURES3_INSTRUCTION_CACHE_End 3
-#define GC_FEATURES3_INSTRUCTION_CACHE_Start 3
-#define GC_FEATURES3_INSTRUCTION_CACHE_Type U01
-#define GC_FEATURES3_INSTRUCTION_CACHE_NONE 0x0
-#define GC_FEATURES3_INSTRUCTION_CACHE_AVAILABLE 0x1
-
-#define GC_FEATURES3_GEOMETRY_SHADER 4 : 4
-#define GC_FEATURES3_GEOMETRY_SHADER_End 4
-#define GC_FEATURES3_GEOMETRY_SHADER_Start 4
-#define GC_FEATURES3_GEOMETRY_SHADER_Type U01
-#define GC_FEATURES3_GEOMETRY_SHADER_NONE 0x0
-#define GC_FEATURES3_GEOMETRY_SHADER_AVAILABLE 0x1
-
-#define GC_FEATURES3_TEX_COMPRESSION_SUPERTILED 5 : 5
-#define GC_FEATURES3_TEX_COMPRESSION_SUPERTILED_End 5
-#define GC_FEATURES3_TEX_COMPRESSION_SUPERTILED_Start 5
-#define GC_FEATURES3_TEX_COMPRESSION_SUPERTILED_Type U01
-#define GC_FEATURES3_TEX_COMPRESSION_SUPERTILED_NONE 0x0
-#define GC_FEATURES3_TEX_COMPRESSION_SUPERTILED_AVAILABLE 0x1
-
-#define GC_FEATURES3_GENERICS 6 : 6
-#define GC_FEATURES3_GENERICS_End 6
-#define GC_FEATURES3_GENERICS_Start 6
-#define GC_FEATURES3_GENERICS_Type U01
-#define GC_FEATURES3_GENERICS_NONE 0x0
-#define GC_FEATURES3_GENERICS_AVAILABLE 0x1
-
-#define GC_FEATURES3_BUG_FIXES9 7 : 7
-#define GC_FEATURES3_BUG_FIXES9_End 7
-#define GC_FEATURES3_BUG_FIXES9_Start 7
-#define GC_FEATURES3_BUG_FIXES9_Type U01
-#define GC_FEATURES3_BUG_FIXES9_NONE 0x0
-#define GC_FEATURES3_BUG_FIXES9_AVAILABLE 0x1
-
-#define GC_FEATURES3_FAST_MSAA 8 : 8
-#define GC_FEATURES3_FAST_MSAA_End 8
-#define GC_FEATURES3_FAST_MSAA_Start 8
-#define GC_FEATURES3_FAST_MSAA_Type U01
-#define GC_FEATURES3_FAST_MSAA_NONE 0x0
-#define GC_FEATURES3_FAST_MSAA_AVAILABLE 0x1
-
-#define GC_FEATURES3_WCLIP 9 : 9
-#define GC_FEATURES3_WCLIP_End 9
-#define GC_FEATURES3_WCLIP_Start 9
-#define GC_FEATURES3_WCLIP_Type U01
-#define GC_FEATURES3_WCLIP_NONE 0x0
-#define GC_FEATURES3_WCLIP_AVAILABLE 0x1
-
-#define GC_FEATURES3_BUG_FIXES10 10 : 10
-#define GC_FEATURES3_BUG_FIXES10_End 10
-#define GC_FEATURES3_BUG_FIXES10_Start 10
-#define GC_FEATURES3_BUG_FIXES10_Type U01
-#define GC_FEATURES3_BUG_FIXES10_NONE 0x0
-#define GC_FEATURES3_BUG_FIXES10_AVAILABLE 0x1
-
-#define GC_FEATURES3_UNIFIED_SAMPLERS 11 : 11
-#define GC_FEATURES3_UNIFIED_SAMPLERS_End 11
-#define GC_FEATURES3_UNIFIED_SAMPLERS_Start 11
-#define GC_FEATURES3_UNIFIED_SAMPLERS_Type U01
-#define GC_FEATURES3_UNIFIED_SAMPLERS_NONE 0x0
-#define GC_FEATURES3_UNIFIED_SAMPLERS_AVAILABLE 0x1
-
-#define GC_FEATURES3_BUG_FIXES11 12 : 12
-#define GC_FEATURES3_BUG_FIXES11_End 12
-#define GC_FEATURES3_BUG_FIXES11_Start 12
-#define GC_FEATURES3_BUG_FIXES11_Type U01
-#define GC_FEATURES3_BUG_FIXES11_NONE 0x0
-#define GC_FEATURES3_BUG_FIXES11_AVAILABLE 0x1
-
-#define GC_FEATURES3_PERFORMANCE_COUNTERS 13 : 13
-#define GC_FEATURES3_PERFORMANCE_COUNTERS_End 13
-#define GC_FEATURES3_PERFORMANCE_COUNTERS_Start 13
-#define GC_FEATURES3_PERFORMANCE_COUNTERS_Type U01
-#define GC_FEATURES3_PERFORMANCE_COUNTERS_NONE 0x0
-#define GC_FEATURES3_PERFORMANCE_COUNTERS_AVAILABLE 0x1
-
-/* High precision transcendentals are available. */
-#define GC_FEATURES3_EXTRA_SHADER_INSTRUCTIONS2 14 : 14
-#define GC_FEATURES3_EXTRA_SHADER_INSTRUCTIONS2_End 14
-#define GC_FEATURES3_EXTRA_SHADER_INSTRUCTIONS2_Start 14
-#define GC_FEATURES3_EXTRA_SHADER_INSTRUCTIONS2_Type U01
-#define GC_FEATURES3_EXTRA_SHADER_INSTRUCTIONS2_NONE 0x0
-#define GC_FEATURES3_EXTRA_SHADER_INSTRUCTIONS2_AVAILABLE 0x1
-
-#define GC_FEATURES3_BUG_FIXES12 15 : 15
-#define GC_FEATURES3_BUG_FIXES12_End 15
-#define GC_FEATURES3_BUG_FIXES12_Start 15
-#define GC_FEATURES3_BUG_FIXES12_Type U01
-#define GC_FEATURES3_BUG_FIXES12_NONE 0x0
-#define GC_FEATURES3_BUG_FIXES12_AVAILABLE 0x1
-
-#define GC_FEATURES3_BUG_FIXES13 16 : 16
-#define GC_FEATURES3_BUG_FIXES13_End 16
-#define GC_FEATURES3_BUG_FIXES13_Start 16
-#define GC_FEATURES3_BUG_FIXES13_Type U01
-#define GC_FEATURES3_BUG_FIXES13_NONE 0x0
-#define GC_FEATURES3_BUG_FIXES13_AVAILABLE 0x1
-
-#define GC_FEATURES3_DE_ENHANCEMENTS1 17 : 17
-#define GC_FEATURES3_DE_ENHANCEMENTS1_End 17
-#define GC_FEATURES3_DE_ENHANCEMENTS1_Start 17
-#define GC_FEATURES3_DE_ENHANCEMENTS1_Type U01
-#define GC_FEATURES3_DE_ENHANCEMENTS1_NONE 0x0
-#define GC_FEATURES3_DE_ENHANCEMENTS1_AVAILABLE 0x1
-
-#define GC_FEATURES3_ACE 18 : 18
-#define GC_FEATURES3_ACE_End 18
-#define GC_FEATURES3_ACE_Start 18
-#define GC_FEATURES3_ACE_Type U01
-#define GC_FEATURES3_ACE_NONE 0x0
-#define GC_FEATURES3_ACE_AVAILABLE 0x1
-
-#define GC_FEATURES3_TX_ENHANCEMENTS1 19 : 19
-#define GC_FEATURES3_TX_ENHANCEMENTS1_End 19
-#define GC_FEATURES3_TX_ENHANCEMENTS1_Start 19
-#define GC_FEATURES3_TX_ENHANCEMENTS1_Type U01
-#define GC_FEATURES3_TX_ENHANCEMENTS1_NONE 0x0
-#define GC_FEATURES3_TX_ENHANCEMENTS1_AVAILABLE 0x1
-
-#define GC_FEATURES3_SH_ENHANCEMENTS1 20 : 20
-#define GC_FEATURES3_SH_ENHANCEMENTS1_End 20
-#define GC_FEATURES3_SH_ENHANCEMENTS1_Start 20
-#define GC_FEATURES3_SH_ENHANCEMENTS1_Type U01
-#define GC_FEATURES3_SH_ENHANCEMENTS1_NONE 0x0
-#define GC_FEATURES3_SH_ENHANCEMENTS1_AVAILABLE 0x1
-
-#define GC_FEATURES3_SH_ENHANCEMENTS2 21 : 21
-#define GC_FEATURES3_SH_ENHANCEMENTS2_End 21
-#define GC_FEATURES3_SH_ENHANCEMENTS2_Start 21
-#define GC_FEATURES3_SH_ENHANCEMENTS2_Type U01
-#define GC_FEATURES3_SH_ENHANCEMENTS2_NONE 0x0
-#define GC_FEATURES3_SH_ENHANCEMENTS2_AVAILABLE 0x1
-
-union gcfeatures3 {
- struct {
- /* GC_FEATURES3_Address:DE_ROTATION_STALL_FIX */
- unsigned int rotationfix:1;
-
- /* GC_FEATURES3_Address:OCL_ONLY */
- unsigned int ocl:1;
-
- /* GC_FEATURES3_Address:NEW_FEATURES0 */
- unsigned int newfeatures0:1;
-
- /* GC_FEATURES3_Address:INSTRUCTION_CACHE */
- unsigned int icache:1;
-
- /* GC_FEATURES3_Address:GEOMETRY_SHADER */
- unsigned int gs:1;
-
- /* GC_FEATURES3_Address:TEX_COMPRESSION_SUPERTILED */
- unsigned int supertiledtxcompression:1;
-
- /* GC_FEATURES3_Address:GENERICS */
- unsigned int generics:1;
-
- /* GC_FEATURES3_Address:BUG_FIXES9 */
- unsigned int bugfixes9:1;
-
- /* GC_FEATURES3_Address:FAST_MSAA */
- unsigned int fastmsaa:1;
-
- /* GC_FEATURES3_Address:WCLIP */
- unsigned int wclip:1;
-
- /* GC_FEATURES3_Address:BUG_FIXES10 */
- unsigned int bugfixes10:1;
-
- /* GC_FEATURES3_Address:UNIFIED_SAMPLERS */
- unsigned int unifiedsamplers:1;
-
- /* GC_FEATURES3_Address:BUG_FIXES11 */
- unsigned int bugfixes11:1;
-
- /* GC_FEATURES3_Address:PERFORMANCE_COUNTERS */
- unsigned int perfcounters:1;
-
- /* GC_FEATURES3_Address:EXTRA_SHADER_INSTRUCTIONS2 */
- unsigned int shaderinst2:1;
-
- /* GC_FEATURES3_Address:BUG_FIXES12 */
- unsigned int bugfixes12:1;
-
- /* GC_FEATURES3_Address:BUG_FIXES13 */
- unsigned int bugfixes13:1;
-
- /* GC_FEATURES3_Address:DE_ENHANCEMENTS1 */
- unsigned int deenhancements1:1;
-
- /* GC_FEATURES3_Address:ACE */
- unsigned int ace:1;
-
- /* GC_FEATURES3_Address:TX_ENHANCEMENTS1 */
- unsigned int txenhancements1:1;
-
- /* GC_FEATURES3_Address:SH_ENHANCEMENTS1 */
- unsigned int shenhancements1:1;
-
- /* GC_FEATURES3_Address:SH_ENHANCEMENTS2 */
- unsigned int shenhancements2:1;
-
- /* GC_FEATURES3_Address:reserved */
- unsigned int _reserved_22_31:10;
- } reg;
-
- unsigned int raw;
-};
-
-/*******************************************************************************
-** Register GCResetMemCounters
-*/
-
-/* Writing 1 will reset the counters and stop counting. Write 0 to start
-** counting again. This register is write only so it has no reset value.
-*/
-
-#define GC_RESET_MEM_COUNTERS_Address 0x0003C
-#define GC_RESET_MEM_COUNTERS_MSB 15
-#define GC_RESET_MEM_COUNTERS_LSB 0
-#define GC_RESET_MEM_COUNTERS_BLK 0
-#define GC_RESET_MEM_COUNTERS_Count 1
-#define GC_RESET_MEM_COUNTERS_FieldMask 0x00000001
-#define GC_RESET_MEM_COUNTERS_ReadMask 0x00000000
-#define GC_RESET_MEM_COUNTERS_WriteMask 0x00000001
-#define GC_RESET_MEM_COUNTERS_ResetValue 0x00000000
-
-#define GC_RESET_MEM_COUNTERS_RESET 0 : 0
-#define GC_RESET_MEM_COUNTERS_RESET_End 0
-#define GC_RESET_MEM_COUNTERS_RESET_Start 0
-#define GC_RESET_MEM_COUNTERS_RESET_Type U01
-
-/*******************************************************************************
-** Register gcTotalReads
-*/
-
-/* Total reads in terms of 64bits. */
-
-#define GC_TOTAL_READS_Address 0x00040
-#define GC_TOTAL_READS_MSB 15
-#define GC_TOTAL_READS_LSB 0
-#define GC_TOTAL_READS_BLK 0
-#define GC_TOTAL_READS_Count 1
-#define GC_TOTAL_READS_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_READS_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_READS_WriteMask 0x00000000
-#define GC_TOTAL_READS_ResetValue 0x00000000
-
-#define GC_TOTAL_READS_COUNT 31 : 0
-#define GC_TOTAL_READS_COUNT_End 31
-#define GC_TOTAL_READS_COUNT_Start 0
-#define GC_TOTAL_READS_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcTotalWrites
-*/
-
-/* Total writes in terms of 64bits. */
-
-#define GC_TOTAL_WRITES_Address 0x00044
-#define GC_TOTAL_WRITES_MSB 15
-#define GC_TOTAL_WRITES_LSB 0
-#define GC_TOTAL_WRITES_BLK 0
-#define GC_TOTAL_WRITES_Count 1
-#define GC_TOTAL_WRITES_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_WRITES_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_WRITES_WriteMask 0x00000000
-#define GC_TOTAL_WRITES_ResetValue 0x00000000
-
-#define GC_TOTAL_WRITES_COUNT 31 : 0
-#define GC_TOTAL_WRITES_COUNT_End 31
-#define GC_TOTAL_WRITES_COUNT_Start 0
-#define GC_TOTAL_WRITES_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcTotalWriteBursts
-*/
-
-/* Total write Data Count in terms of 64bits value. */
-
-#define GC_TOTAL_WRITE_BURSTS_Address 0x0004C
-#define GC_TOTAL_WRITE_BURSTS_MSB 15
-#define GC_TOTAL_WRITE_BURSTS_LSB 0
-#define GC_TOTAL_WRITE_BURSTS_BLK 0
-#define GC_TOTAL_WRITE_BURSTS_Count 1
-#define GC_TOTAL_WRITE_BURSTS_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_WRITE_BURSTS_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_WRITE_BURSTS_WriteMask 0x00000000
-#define GC_TOTAL_WRITE_BURSTS_ResetValue 0x00000000
-
-#define GC_TOTAL_WRITE_BURSTS_COUNT 31 : 0
-#define GC_TOTAL_WRITE_BURSTS_COUNT_End 31
-#define GC_TOTAL_WRITE_BURSTS_COUNT_Start 0
-#define GC_TOTAL_WRITE_BURSTS_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcTotalWriteReqs
-*/
-
-/* Total write Request Count. */
-
-#define GC_TOTAL_WRITE_REQS_Address 0x00050
-#define GC_TOTAL_WRITE_REQS_MSB 15
-#define GC_TOTAL_WRITE_REQS_LSB 0
-#define GC_TOTAL_WRITE_REQS_BLK 0
-#define GC_TOTAL_WRITE_REQS_Count 1
-#define GC_TOTAL_WRITE_REQS_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_WRITE_REQS_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_WRITE_REQS_WriteMask 0x00000000
-#define GC_TOTAL_WRITE_REQS_ResetValue 0x00000000
-
-#define GC_TOTAL_WRITE_REQS_COUNT 31 : 0
-#define GC_TOTAL_WRITE_REQS_COUNT_End 31
-#define GC_TOTAL_WRITE_REQS_COUNT_Start 0
-#define GC_TOTAL_WRITE_REQS_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcTotalReadBursts
-*/
-
-/* Total Read Data Count in terms of 64bits. */
-
-#define GC_TOTAL_READ_BURSTS_Address 0x00058
-#define GC_TOTAL_READ_BURSTS_MSB 15
-#define GC_TOTAL_READ_BURSTS_LSB 0
-#define GC_TOTAL_READ_BURSTS_BLK 0
-#define GC_TOTAL_READ_BURSTS_Count 1
-#define GC_TOTAL_READ_BURSTS_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_READ_BURSTS_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_READ_BURSTS_WriteMask 0x00000000
-#define GC_TOTAL_READ_BURSTS_ResetValue 0x00000000
-
-#define GC_TOTAL_READ_BURSTS_COUNT 31 : 0
-#define GC_TOTAL_READ_BURSTS_COUNT_End 31
-#define GC_TOTAL_READ_BURSTS_COUNT_Start 0
-#define GC_TOTAL_READ_BURSTS_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcTotalReadReqs
-*/
-
-/* Total Read Request Count. */
-
-#define GC_TOTAL_READ_REQS_Address 0x0005C
-#define GC_TOTAL_READ_REQS_MSB 15
-#define GC_TOTAL_READ_REQS_LSB 0
-#define GC_TOTAL_READ_REQS_BLK 0
-#define GC_TOTAL_READ_REQS_Count 1
-#define GC_TOTAL_READ_REQS_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_READ_REQS_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_READ_REQS_WriteMask 0x00000000
-#define GC_TOTAL_READ_REQS_ResetValue 0x00000000
-
-#define GC_TOTAL_READ_REQS_COUNT 31 : 0
-#define GC_TOTAL_READ_REQS_COUNT_End 31
-#define GC_TOTAL_READ_REQS_COUNT_Start 0
-#define GC_TOTAL_READ_REQS_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcTotalReadLasts
-*/
-
-/* Total RLAST Count. This is used to match with GCTotalReadReqs. */
-
-#define GC_TOTAL_READ_LASTS_Address 0x00060
-#define GC_TOTAL_READ_LASTS_MSB 15
-#define GC_TOTAL_READ_LASTS_LSB 0
-#define GC_TOTAL_READ_LASTS_BLK 0
-#define GC_TOTAL_READ_LASTS_Count 1
-#define GC_TOTAL_READ_LASTS_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_READ_LASTS_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_READ_LASTS_WriteMask 0x00000000
-#define GC_TOTAL_READ_LASTS_ResetValue 0x00000000
-
-#define GC_TOTAL_READ_LASTS_COUNT 31 : 0
-#define GC_TOTAL_READ_LASTS_COUNT_End 31
-#define GC_TOTAL_READ_LASTS_COUNT_Start 0
-#define GC_TOTAL_READ_LASTS_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcGpOut0
-*/
-
-/* General Purpose output register0. R/W but not connected to anywhere. */
-
-#define GC_GP_OUT0_Address 0x00064
-#define GC_GP_OUT0_MSB 15
-#define GC_GP_OUT0_LSB 0
-#define GC_GP_OUT0_BLK 0
-#define GC_GP_OUT0_Count 1
-#define GC_GP_OUT0_FieldMask 0xFFFFFFFF
-#define GC_GP_OUT0_ReadMask 0xFFFFFFFF
-#define GC_GP_OUT0_WriteMask 0xFFFFFFFF
-#define GC_GP_OUT0_ResetValue 0x00000000
-
-#define GC_GP_OUT0_COUNT 31 : 0
-#define GC_GP_OUT0_COUNT_End 31
-#define GC_GP_OUT0_COUNT_Start 0
-#define GC_GP_OUT0_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcGpOut1
-*/
-
-/* General Purpose output register1. R/W but not connected to anywhere. */
-
-#define GC_GP_OUT1_Address 0x00068
-#define GC_GP_OUT1_MSB 15
-#define GC_GP_OUT1_LSB 0
-#define GC_GP_OUT1_BLK 0
-#define GC_GP_OUT1_Count 1
-#define GC_GP_OUT1_FieldMask 0xFFFFFFFF
-#define GC_GP_OUT1_ReadMask 0xFFFFFFFF
-#define GC_GP_OUT1_WriteMask 0xFFFFFFFF
-#define GC_GP_OUT1_ResetValue 0x00000000
-
-#define GC_GP_OUT1_COUNT 31 : 0
-#define GC_GP_OUT1_COUNT_End 31
-#define GC_GP_OUT1_COUNT_Start 0
-#define GC_GP_OUT1_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcGpOut2
-*/
-
-/* General Purpose output register2. R/W but not connected to anywhere. */
-
-#define GC_GP_OUT2_Address 0x0006C
-#define GC_GP_OUT2_MSB 15
-#define GC_GP_OUT2_LSB 0
-#define GC_GP_OUT2_BLK 0
-#define GC_GP_OUT2_Count 1
-#define GC_GP_OUT2_FieldMask 0xFFFFFFFF
-#define GC_GP_OUT2_ReadMask 0xFFFFFFFF
-#define GC_GP_OUT2_WriteMask 0xFFFFFFFF
-#define GC_GP_OUT2_ResetValue 0x00000000
-
-#define GC_GP_OUT2_COUNT 31 : 0
-#define GC_GP_OUT2_COUNT_End 31
-#define GC_GP_OUT2_COUNT_Start 0
-#define GC_GP_OUT2_COUNT_Type U32
-
-/*******************************************************************************
-** Register gcAxiControl
-*/
-
-/* Special Handling on AXI Bus */
-
-#define GC_AXI_CONTROL_Address 0x00070
-#define GC_AXI_CONTROL_MSB 15
-#define GC_AXI_CONTROL_LSB 0
-#define GC_AXI_CONTROL_BLK 0
-#define GC_AXI_CONTROL_Count 1
-#define GC_AXI_CONTROL_FieldMask 0x00000001
-#define GC_AXI_CONTROL_ReadMask 0x00000001
-#define GC_AXI_CONTROL_WriteMask 0x00000001
-#define GC_AXI_CONTROL_ResetValue 0x00000000
-
-#define GC_AXI_CONTROL_WR_FULL_BURST_MODE 0 : 0
-#define GC_AXI_CONTROL_WR_FULL_BURST_MODE_End 0
-#define GC_AXI_CONTROL_WR_FULL_BURST_MODE_Start 0
-#define GC_AXI_CONTROL_WR_FULL_BURST_MODE_Type U01
-#define GC_AXI_CONTROL_WR_FULL_BURST_MODE_NO_BURST_RESET_VALUE 0x0
-#define GC_AXI_CONTROL_WR_FULL_BURST_MODE_BURST_RESET_VALUE 0x1
-
-/*******************************************************************************
-** Register gcTotalCycles
-*/
-
-/* Total cycles. This register is a free running counter. It can be reset by
-** writing 0 to it.
-*/
-
-#define GC_TOTAL_CYCLES_Address 0x00078
-#define GC_TOTAL_CYCLES_MSB 15
-#define GC_TOTAL_CYCLES_LSB 0
-#define GC_TOTAL_CYCLES_BLK 0
-#define GC_TOTAL_CYCLES_Count 1
-#define GC_TOTAL_CYCLES_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_CYCLES_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_CYCLES_WriteMask 0xFFFFFFFF
-#define GC_TOTAL_CYCLES_ResetValue 0x00000000
-
-#define GC_TOTAL_CYCLES_CYCLES 31 : 0
-#define GC_TOTAL_CYCLES_CYCLES_End 31
-#define GC_TOTAL_CYCLES_CYCLES_Start 0
-#define GC_TOTAL_CYCLES_CYCLES_Type U32
-
-/*******************************************************************************
-** Register gcTotalIdleCycles
-*/
-
-/* Total cycles where the GPU is idle. It is reset when gcTotalCycles register
-** is written to. It looks at all the blocks but FE when determining the IP is
-** idle.
-*/
-
-#define GC_TOTAL_IDLE_CYCLES_Address 0x0007C
-#define GC_TOTAL_IDLE_CYCLES_MSB 15
-#define GC_TOTAL_IDLE_CYCLES_LSB 0
-#define GC_TOTAL_IDLE_CYCLES_BLK 0
-#define GC_TOTAL_IDLE_CYCLES_Count 1
-#define GC_TOTAL_IDLE_CYCLES_FieldMask 0xFFFFFFFF
-#define GC_TOTAL_IDLE_CYCLES_ReadMask 0xFFFFFFFF
-#define GC_TOTAL_IDLE_CYCLES_WriteMask 0xFFFFFFFF
-#define GC_TOTAL_IDLE_CYCLES_ResetValue 0x00000000
-
-#define GC_TOTAL_IDLE_CYCLES_CYCLES 31 : 0
-#define GC_TOTAL_IDLE_CYCLES_CYCLES_End 31
-#define GC_TOTAL_IDLE_CYCLES_CYCLES_Start 0
-#define GC_TOTAL_IDLE_CYCLES_CYCLES_Type U32
-
-/*******************************************************************************
-** Command opcodes.
-*/
-
-#define GCREG_COMMAND_OPCODE_LOAD_STATE 0x01
-#define GCREG_COMMAND_OPCODE_END 0x02
-#define GCREG_COMMAND_OPCODE_NOP 0x03
-#define GCREG_COMMAND_OPCODE_STARTDE 0x04
-#define GCREG_COMMAND_OPCODE_WAIT 0x07
-#define GCREG_COMMAND_OPCODE_LINK 0x08
-#define GCREG_COMMAND_OPCODE_STALL 0x09
-#define GCREG_COMMAND_OPCODE_CALL 0x0A
-#define GCREG_COMMAND_OPCODE_RETURN 0x0B
-
-/*******************************************************************************
-** Command gcregCommandLoadState
-*/
-
-/* When enabled, convert 16.16 fixed point into 32-bit floating point. */
-#define GCREG_COMMAND_LOAD_STATE_FLOAT 26 : 26
-#define GCREG_COMMAND_LOAD_STATE_FLOAT_End 26
-#define GCREG_COMMAND_LOAD_STATE_FLOAT_Start 26
-#define GCREG_COMMAND_LOAD_STATE_FLOAT_Type U01
-#define GCREG_COMMAND_LOAD_STATE_FLOAT_NORMAL 0x0
-#define GCREG_COMMAND_LOAD_STATE_FLOAT_FIXED16_DOT16 0x1
-
-/* Number of states. 0 = 1024. */
-#define GCREG_COMMAND_LOAD_STATE_COUNT 25 : 16
-#define GCREG_COMMAND_LOAD_STATE_COUNT_End 25
-#define GCREG_COMMAND_LOAD_STATE_COUNT_Start 16
-#define GCREG_COMMAND_LOAD_STATE_COUNT_Type U10
-
-/* Starting state address. */
-#define GCREG_COMMAND_LOAD_STATE_ADDRESS 15 : 0
-#define GCREG_COMMAND_LOAD_STATE_ADDRESS_End 15
-#define GCREG_COMMAND_LOAD_STATE_ADDRESS_Start 0
-#define GCREG_COMMAND_LOAD_STATE_ADDRESS_Type U16
-
-#define GCREG_COMMAND_LOAD_STATE_OPCODE 31 : 27
-#define GCREG_COMMAND_LOAD_STATE_OPCODE_End 31
-#define GCREG_COMMAND_LOAD_STATE_OPCODE_Start 27
-#define GCREG_COMMAND_LOAD_STATE_OPCODE_Type U05
-
-struct gccmdldstate {
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_ADDRESS */
- unsigned int address:16;
-
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_COUNT */
- unsigned int count:10;
-
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_FLOAT */
- unsigned int fixed:1;
-
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_OPCODE */
- unsigned int opcode:5;
-};
-
-#define GCLDSTATE(Address, Count) \
-{ \
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_ADDRESS */ \
- Address, \
- \
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_COUNT */ \
- Count, \
- \
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_FLOAT */ \
- GCREG_COMMAND_LOAD_STATE_FLOAT_NORMAL, \
- \
- /* gcregCommandLoadState:GCREG_COMMAND_LOAD_STATE_OPCODE */ \
- GCREG_COMMAND_OPCODE_LOAD_STATE \
-}
-
-/*******************************************************************************
-** Command gcregCommandEnd
-*/
-
-/* Send event when END is completed. */
-#define GCREG_COMMAND_END_EVENT 8 : 8
-#define GCREG_COMMAND_END_EVENT_End 8
-#define GCREG_COMMAND_END_EVENT_Start 8
-#define GCREG_COMMAND_END_EVENT_Type U01
-#define GCREG_COMMAND_END_EVENT_DISABLE 0x0
-#define GCREG_COMMAND_END_EVENT_ENABLE 0x1
-
-/* Event ID to be send. */
-#define GCREG_COMMAND_END_EVENT_ID 4 : 0
-#define GCREG_COMMAND_END_EVENT_ID_End 4
-#define GCREG_COMMAND_END_EVENT_ID_Start 0
-#define GCREG_COMMAND_END_EVENT_ID_Type U05
-
-#define GCREG_COMMAND_END_OPCODE 31 : 27
-#define GCREG_COMMAND_END_OPCODE_End 31
-#define GCREG_COMMAND_END_OPCODE_Start 27
-#define GCREG_COMMAND_END_OPCODE_Type U05
-
-struct gcfldend {
- /* gcregCommandEnd:GCREG_COMMAND_END_EVENT_ID */
- unsigned int signalid:5;
-
- /* gcregCommandEnd:reserved */
- unsigned int _reserved_5_7:3;
-
- /* gcregCommandEnd:GCREG_COMMAND_END_EVENT_ENABLE */
- unsigned int signal:1;
-
- /* gcregCommandEnd:reserved */
- unsigned int _reserved_9_26:18;
-
- /* gcregCommandEnd:GCREG_COMMAND_END_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gccmdend {
- union {
- struct gcfldend fld;
- unsigned int raw;
- }
- cmd;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gccmdend gccmdend_const = {
- /* cmd */
- {
- /* fld */
- {
- /* gcregCommandEnd:GCREG_COMMAND_END_EVENT_ID */
- 0,
-
- /* gcregCommandEnd:reserved */
- 0,
-
- /* gcregCommandEnd:GCREG_COMMAND_END_EVENT */
- GCREG_COMMAND_END_EVENT_DISABLE,
-
- /* gcregCommandEnd:reserved */
- 0,
-
- /* gcregCommandEnd:GCREG_COMMAND_END_OPCODE */
- GCREG_COMMAND_OPCODE_END
- }
- },
-
- /* Alignment filler. */
- 0
-};
-
-/*******************************************************************************
-** Command gcregCommandNop
-*/
-
-#define GCREG_COMMAND_NOP_OPCODE 31 : 27
-#define GCREG_COMMAND_NOP_OPCODE_End 31
-#define GCREG_COMMAND_NOP_OPCODE_Start 27
-#define GCREG_COMMAND_NOP_OPCODE_Type U05
-
-struct gcfldnop {
- /* gcregCommandNop:reserved */
- unsigned int _reserved_0_26:27;
-
- /* gcregCommandNop:GCREG_COMMAND_NOP_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gccmdnop {
- union {
- struct gcfldnop fld;
- unsigned int raw;
- }
- cmd;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gccmdnop gccmdnop_const = {
- /* cmd */
- {
- /* fld */
- {
- /* gcregCommandNop:reserved */
- 0,
-
- /* gcregCommandNop:GCREG_COMMAND_NOP_OPCODE */
- GCREG_COMMAND_OPCODE_NOP
- }
- },
-
- /* Alignment filler. */
- 0
-};
-
-/*******************************************************************************
-** Command gcregCommandStartDE
-*/
-
-/* Offset Command
-** ~~~~~~~~~~~~~~ */
-
-/* Number of 32-bit data words to send.
-** The data follows the rectangles, aligned at 64-bit.
-*/
-#define GCREG_COMMAND_STARTDE_DATA_COUNT 26 : 16
-#define GCREG_COMMAND_STARTDE_DATA_COUNT_End 26
-#define GCREG_COMMAND_STARTDE_DATA_COUNT_Start 16
-#define GCREG_COMMAND_STARTDE_DATA_COUNT_Type U11
-
-/* Number of rectangles to send.
-** The rectangles follow the command, aligned at 64-bit.
-*/
-#define GCREG_COMMAND_STARTDE_COUNT 15 : 8
-#define GCREG_COMMAND_STARTDE_COUNT_End 15
-#define GCREG_COMMAND_STARTDE_COUNT_Start 8
-#define GCREG_COMMAND_STARTDE_COUNT_Type U08
-
-#define GCREG_COMMAND_STARTDE_OPCODE 31 : 27
-#define GCREG_COMMAND_STARTDE_OPCODE_End 31
-#define GCREG_COMMAND_STARTDE_OPCODE_Start 27
-#define GCREG_COMMAND_STARTDE_OPCODE_Type U05
-
-struct gcfldstartde {
- /* gcregCommandStartDE:reserved */
- unsigned int _reserved_0_7:8;
-
- /* gcregCommandStartDE:GCREG_COMMAND_STARTDE_COUNT */
- unsigned int rectcount:8;
-
- /* gcregCommandStartDE:GCREG_COMMAND_STARTDE_DATA_COUNT */
- unsigned int datacount:11;
-
- /* gcregCommandStartDE:GCREG_COMMAND_STARTDE_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gccmdstartde {
- union {
- struct gcfldstartde fld;
- unsigned int raw;
- } cmd;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gcfldstartde gcfldstartde = {
- /* gcregCommandStartDE:reserved */
- 0,
-
- /* gcregCommandStartDE:GCREG_COMMAND_STARTDE_COUNT */
- 1,
-
- /* gcregCommandStartDE:GCREG_COMMAND_STARTDE_DATA_COUNT */
- 0,
-
- /* gcregCommandStartDE:GCREG_COMMAND_STARTDE_OPCODE */
- GCREG_COMMAND_OPCODE_STARTDE
-};
-
-/* Offset TopLeft
-** ~~~~~~~~~~~~~~ */
-
-#define GCREG_COMMAND_TOP_LEFT_Y 31 : 16
-#define GCREG_COMMAND_TOP_LEFT_Y_End 31
-#define GCREG_COMMAND_TOP_LEFT_Y_Start 16
-#define GCREG_COMMAND_TOP_LEFT_Y_Type U16
-
-#define GCREG_COMMAND_TOP_LEFT_X 15 : 0
-#define GCREG_COMMAND_TOP_LEFT_X_End 15
-#define GCREG_COMMAND_TOP_LEFT_X_Start 0
-#define GCREG_COMMAND_TOP_LEFT_X_Type U16
-
-/* Offset BottomRight
-** ~~~~~~~~~~~~~~~~~~ */
-
-#define GCREG_COMMAND_BOTTOM_RIGHT_Y 31 : 16
-#define GCREG_COMMAND_BOTTOM_RIGHT_Y_End 31
-#define GCREG_COMMAND_BOTTOM_RIGHT_Y_Start 16
-#define GCREG_COMMAND_BOTTOM_RIGHT_Y_Type U16
-
-#define GCREG_COMMAND_BOTTOM_RIGHT_X 15 : 0
-#define GCREG_COMMAND_BOTTOM_RIGHT_X_End 15
-#define GCREG_COMMAND_BOTTOM_RIGHT_X_Start 0
-#define GCREG_COMMAND_BOTTOM_RIGHT_X_Type U16
-
-struct gccmdstartderect {
- /* GCREG_COMMAND_TOP_LEFT_X */
- unsigned int left:16;
-
- /* GCREG_COMMAND_TOP_LEFT_Y */
- unsigned int top:16;
-
- /* GCREG_COMMAND_BOTTOM_RIGHT_X */
- unsigned int right:16;
-
- /* GCREG_COMMAND_BOTTOM_RIGHT_Y */
- unsigned int bottom:16;
-};
-
-/*******************************************************************************
-** Command gcregCommandWait
-*/
-
-/* Number of cycles to wait until the next command gets fetched. */
-#define GCREG_COMMAND_WAIT_DELAY 15 : 0
-#define GCREG_COMMAND_WAIT_DELAY_End 15
-#define GCREG_COMMAND_WAIT_DELAY_Start 0
-#define GCREG_COMMAND_WAIT_DELAY_Type U16
-
-#define GCREG_COMMAND_WAIT_OPCODE 31 : 27
-#define GCREG_COMMAND_WAIT_OPCODE_End 31
-#define GCREG_COMMAND_WAIT_OPCODE_Start 27
-#define GCREG_COMMAND_WAIT_OPCODE_Type U05
-
-struct gcfldwait {
- /* gcregCommandWait:GCREG_COMMAND_WAIT_DELAY */
- unsigned int delay:16;
-
- /* gcregCommandWait:reserved */
- unsigned int _reserved_16_26:11;
-
- /* gcregCommandWait:GCREG_COMMAND_WAIT_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gccmdwait {
- union {
- struct gcfldwait fld;
- unsigned int raw;
- } cmd;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gcfldwait gcfldwait200 = {
- /* gcregCommandWait:GCREG_COMMAND_WAIT_DELAY */
- 200,
-
- /* gcregCommandWait:reserved */
- 0,
-
- /* gcregCommandWait:GCREG_COMMAND_WAIT_OPCODE */
- GCREG_COMMAND_OPCODE_WAIT
-};
-
-/*******************************************************************************
-** Command gcregCommandLink
-*/
-
-/* Number of 64-bit words to fetch. Make sure this number is not too low,
-** nothing else will be fetched. So, make sure that the last command in the
-** new command buffer is either an END, a LINK, a CALL, or a RETURN.
-*/
-#define GCREG_COMMAND_LINK_PREFETCH 15 : 0
-#define GCREG_COMMAND_LINK_PREFETCH_End 15
-#define GCREG_COMMAND_LINK_PREFETCH_Start 0
-#define GCREG_COMMAND_LINK_PREFETCH_Type U16
-
-#define GCREG_COMMAND_LINK_OPCODE 31 : 27
-#define GCREG_COMMAND_LINK_OPCODE_End 31
-#define GCREG_COMMAND_LINK_OPCODE_Start 27
-#define GCREG_COMMAND_LINK_OPCODE_Type U05
-
-/* Offset Address
-** ~~~~~~~~~~~~~~ */
-#define GCREG_COMMAND_LINK_ADDRESS_Index 1
-#define GCREG_COMMAND_LINK_ADDRESS_CmdAddrs 0x0F0D
-
-#define GCREG_COMMAND_LINK_ADDRESS_ADDRESS 31 : 0
-#define GCREG_COMMAND_LINK_ADDRESS_ADDRESS_End 30
-#define GCREG_COMMAND_LINK_ADDRESS_ADDRESS_Start 0
-#define GCREG_COMMAND_LINK_ADDRESS_ADDRESS_Type U31
-
-struct gcfldlink {
- /* gcregCommandLink:GCREG_COMMAND_LINK_PREFETCH */
- unsigned int count:16;
-
- /* gcregCommandLink:reserved */
- unsigned int _reserved_16_26:11;
-
- /* gcregCommandLink:GCREG_COMMAND_LINK_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gccmdlink {
- union {
- struct gcfldlink fld;
- unsigned int raw;
- } cmd;
-
- /* gcregCommandLink:GCREG_COMMAND_LINK_ADDRESS_ADDRESS */
- unsigned int address;
-};
-
-static const struct gcfldlink gcfldlink2 = {
- /* gcregCommandLink:GCREG_COMMAND_LINK_PREFETCH */
- 2,
-
- /* gcregCommandLink:reserved */
- 0,
-
- /* gcregCommandLink:GCREG_COMMAND_LINK_OPCODE */
- GCREG_COMMAND_OPCODE_LINK
-};
-
-static const struct gcfldlink gcfldlink4 = {
- /* gcregCommandLink:GCREG_COMMAND_LINK_PREFETCH */
- 4,
-
- /* gcregCommandLink:reserved */
- 0,
-
- /* gcregCommandLink:GCREG_COMMAND_LINK_OPCODE */
- GCREG_COMMAND_OPCODE_LINK
-};
-
-/*******************************************************************************
-** Command gcregCommandStall
-*/
-
-/* Offset Command
-** ~~~~~~~~~~~~~~ */
-#define GCREG_COMMAND_STALL_OPCODE 31 : 27
-#define GCREG_COMMAND_STALL_OPCODE_End 31
-#define GCREG_COMMAND_STALL_OPCODE_Start 27
-#define GCREG_COMMAND_STALL_OPCODE_Type U05
-
-/* Offset Stall
-** ~~~~~~~~~~~~ */
-#define GCREG_COMMAND_STALL_STALL_SOURCE 4 : 0
-#define GCREG_COMMAND_STALL_STALL_SOURCE_End 4
-#define GCREG_COMMAND_STALL_STALL_SOURCE_Start 0
-#define GCREG_COMMAND_STALL_STALL_SOURCE_Type U05
-#define GCREG_COMMAND_STALL_STALL_SOURCE_FRONT_END 0x01
-#define GCREG_COMMAND_STALL_STALL_SOURCE_PIXEL_ENGINE 0x07
-#define GCREG_COMMAND_STALL_STALL_SOURCE_DRAWING_ENGINE 0x0B
-
-#define GCREG_COMMAND_STALL_STALL_DESTINATION 12 : 8
-#define GCREG_COMMAND_STALL_STALL_DESTINATION_End 12
-#define GCREG_COMMAND_STALL_STALL_DESTINATION_Start 8
-#define GCREG_COMMAND_STALL_STALL_DESTINATION_Type U05
-#define GCREG_COMMAND_STALL_STALL_DESTINATION_FRONT_END 0x01
-#define GCREG_COMMAND_STALL_STALL_DESTINATION_PIXEL_ENGINE 0x07
-#define GCREG_COMMAND_STALL_STALL_DESTINATION_DRAWING_ENGINE 0x0B
-
-struct gcfldstall {
- /* gcregCommandStall:reserved */
- unsigned int _reserved_0_26:27;
-
- /* gcregCommandStall:GCREG_COMMAND_STALL_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gcfldstallarg {
- /* gcregCommandStall:GCREG_COMMAND_STALL_STALL_SOURCE */
- unsigned int src:5;
-
- /* gcregCommandStall:reserved */
- unsigned int _reserved_5_7:3;
-
- /* gcregCommandStall:GCREG_COMMAND_STALL_STALL_DESTINATION */
- unsigned int dst:5;
-
- /* gcregCommandStall:reserved */
- unsigned int _reserved_13_31:19;
-};
-
-struct gccmdstall {
- union {
- struct gcfldstall fld;
- unsigned int raw;
- } cmd;
-
- union {
- struct gcfldstallarg fld;
- unsigned int raw;
- } arg;
-};
-
-static const struct gcfldstall gcfldstall = {
- /* gcregCommandStall:reserved */
- 0,
-
- /* gcregCommandStall:GCREG_COMMAND_STALL_OPCODE */
- GCREG_COMMAND_OPCODE_STALL
-};
-
-static const struct gcfldstallarg gcfldstall_fe_pe = {
- /* gcregCommandStall:GCREG_COMMAND_STALL_STALL_SOURCE */
- GCREG_COMMAND_STALL_STALL_SOURCE_FRONT_END,
-
- /* gcregCommandStall:reserved */
- 0,
-
- /* gcregCommandStall:GCREG_COMMAND_STALL_STALL_DESTINATION */
- GCREG_COMMAND_STALL_STALL_DESTINATION_PIXEL_ENGINE,
-
- /* gcregCommandStall:reserved */
- 0
-};
-
-/*******************************************************************************
-** Command gcregCommandCall
-*/
-
-/* Offset Command
-** ~~~~~~~~~~~~~~ */
-
-/* Number of 64-bit words to fetch. Make sure this number is not too low,
-** nothing else will be fetched. So, make sure that the last command in the
-** new command buffer is either an END, a LINK, a CALL, or a RETURN.
-*/
-#define GCREG_COMMAND_CALL_PREFETCH 15 : 0
-#define GCREG_COMMAND_CALL_PREFETCH_End 15
-#define GCREG_COMMAND_CALL_PREFETCH_Start 0
-#define GCREG_COMMAND_CALL_PREFETCH_Type U16
-
-#define GCREG_COMMAND_CALL_OPCODE 31 : 27
-#define GCREG_COMMAND_CALL_OPCODE_End 31
-#define GCREG_COMMAND_CALL_OPCODE_Start 27
-#define GCREG_COMMAND_CALL_OPCODE_Type U05
-
-/* Offset Address
-** ~~~~~~~~~~~~~~ */
-
-#define GCREG_COMMAND_CALL_ADDRESS_ADDRESS 31 : 0
-#define GCREG_COMMAND_CALL_ADDRESS_ADDRESS_End 30
-#define GCREG_COMMAND_CALL_ADDRESS_ADDRESS_Start 0
-#define GCREG_COMMAND_CALL_ADDRESS_ADDRESS_Type U31
-
-/* Offset ReturnPrefetch
-** ~~~~~~~~~~~~~~~~~~~~~ */
-
-/* Number of 64-bit words to fetch after a Return has been issued. Make sure **
-** this number if not too low nothing else will be fetched. So, make sure **
-** the last command in this prefetch block is either an END, a LINK, a CALL, **
-** or a RETURN. */
-#define GCREG_COMMAND_CALL_RETURN_PREFETCH_PREFETCH 15 : 0
-#define GCREG_COMMAND_CALL_RETURN_PREFETCH_PREFETCH_End 15
-#define GCREG_COMMAND_CALL_RETURN_PREFETCH_PREFETCH_Start 0
-#define GCREG_COMMAND_CALL_RETURN_PREFETCH_PREFETCH_Type U16
-
-/* Offset ReturnAddress
-** ~~~~~~~~~~~~~~~~~~~~ */
-
-#define GCREG_COMMAND_CALL_RETURN_ADDRESS_ADDRESS 31 : 0
-#define GCREG_COMMAND_CALL_RETURN_ADDRESS_ADDRESS_End 30
-#define GCREG_COMMAND_CALL_RETURN_ADDRESS_ADDRESS_Start 0
-#define GCREG_COMMAND_CALL_RETURN_ADDRESS_ADDRESS_Type U31
-
-struct gccmdcall {
- /* gcregCommandCall:GCREG_COMMAND_CALL_PREFETCH */
- unsigned int count:16;
-
- /* gcregCommandCall:reserved */
- unsigned int _reserved_16_26:11;
-
- /* gcregCommandCall:GCREG_COMMAND_CALL_OPCODE */
- unsigned int opcode:5;
-
- /* gcregCommandCall:GCREG_COMMAND_CALL_ADDRESS_ADDRESS */
- unsigned int address;
-
- /* gcregCommandCall:GCREG_COMMAND_CALL_RETURN_PREFETCH_PREFETCH */
- unsigned int retcount;
-
- /* gcregCommandCall:GCREG_COMMAND_CALL_RETURN_ADDRESS_ADDRESS */
- unsigned int retaddress;
-};
-
-/*******************************************************************************
-** Command gccmdCommandReturn
-*/
-
-#define GCREG_COMMAND_RETURN_OPCODE 31 : 27
-#define GCREG_COMMAND_RETURN_OPCODE_End 31
-#define GCREG_COMMAND_RETURN_OPCODE_Start 27
-#define GCREG_COMMAND_RETURN_OPCODE_Type U05
-
-struct gcfldret {
- /* gccmdCommandReturn:reserved */
- unsigned int _reserved_0_26:27;
-
- /* gccmdCommandReturn:GCREG_COMMAND_RETURN_OPCODE */
- unsigned int opcode:5;
-};
-
-struct gccmdret {
- union {
- struct gcfldret fld;
- unsigned int raw;
- }
- cmd;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gcfldret gcfldret = {
- /* gccmdCommandReturn:reserved */
- 0,
-
- /* gccmdCommandReturn:GCREG_COMMAND_RETURN_OPCODE */
- GCREG_COMMAND_OPCODE_RETURN
-};
-
-/*******************************************************************************
-** State gcregStall
-*/
-
-#define gcregStallRegAddrs 0x0F00
-#define GCREG_STALL_Count 1
-#define GCREG_STALL_ResetValue 0x00000000
-
-#define GCREG_STALL_FLIP0 30 : 30
-#define GCREG_STALL_FLIP0_End 30
-#define GCREG_STALL_FLIP0_Start 30
-#define GCREG_STALL_FLIP0_Type U01
-
-#define GCREG_STALL_FLIP1 31 : 31
-#define GCREG_STALL_FLIP1_End 31
-#define GCREG_STALL_FLIP1_Start 31
-#define GCREG_STALL_FLIP1_Type U01
-
-#define GCREG_STALL_SOURCE 4 : 0
-#define GCREG_STALL_SOURCE_End 4
-#define GCREG_STALL_SOURCE_Start 0
-#define GCREG_STALL_SOURCE_Type U05
-#define GCREG_STALL_SOURCE_FRONT_END 0x01
-#define GCREG_STALL_SOURCE_PIXEL_ENGINE 0x07
-#define GCREG_STALL_SOURCE_DRAWING_ENGINE 0x0B
-
-#define GCREG_STALL_DESTINATION 12 : 8
-#define GCREG_STALL_DESTINATION_End 12
-#define GCREG_STALL_DESTINATION_Start 8
-#define GCREG_STALL_DESTINATION_Type U05
-#define GCREG_STALL_DESTINATION_FRONT_END 0x01
-#define GCREG_STALL_DESTINATION_PIXEL_ENGINE 0x07
-#define GCREG_STALL_DESTINATION_DRAWING_ENGINE 0x0B
-
-/*******************************************************************************
-** State gcregPipeSelect
-*/
-
-/* Select the current graphics pipe. */
-
-#define gcregPipeSelectRegAddrs 0x0E00
-#define GCREG_PIPE_SELECT_MSB 15
-#define GCREG_PIPE_SELECT_LSB 0
-#define GCREG_PIPE_SELECT_BLK 0
-#define GCREG_PIPE_SELECT_Count 1
-#define GCREG_PIPE_SELECT_FieldMask 0x00000001
-#define GCREG_PIPE_SELECT_ReadMask 0x00000001
-#define GCREG_PIPE_SELECT_WriteMask 0x00000001
-#define GCREG_PIPE_SELECT_ResetValue 0x00000000
-
-/* Selects the pipe to send states and data to. Make sure the PE is idle **
-** before you switch pipes. */
-#define GCREG_PIPE_SELECT_PIPE 0 : 0
-#define GCREG_PIPE_SELECT_PIPE_End 0
-#define GCREG_PIPE_SELECT_PIPE_Start 0
-#define GCREG_PIPE_SELECT_PIPE_Type U01
-#define GCREG_PIPE_SELECT_PIPE_PIPE3D 0x0
-#define GCREG_PIPE_SELECT_PIPE_PIPE2D 0x1
-
-struct gcregpipeselect {
- /* gcregPipeSelectRegAddrs:GCREG_PIPE_SELECT_PIPE */
- unsigned int pipe:1;
-
- /* gcregPipeSelectRegAddrs:reserved */
- unsigned int _reserved_1_31:31;
-};
-
-static const struct gcregpipeselect gcregpipeselect_2D = {
- /* gcregPipeSelectRegAddrs:GCREG_PIPE_SELECT_PIPE */
- GCREG_PIPE_SELECT_PIPE_PIPE2D,
-
- /* gcregPipeSelectRegAddrs:reserved */
- 0
-};
-
-static const struct gcregpipeselect gcregpipeselect_3D = {
- /* gcregPipeSelectRegAddrs:GCREG_PIPE_SELECT_PIPE */
- GCREG_PIPE_SELECT_PIPE_PIPE3D,
-
- /* gcregPipeSelectRegAddrs:reserved */
- 0
-};
-
-/*******************************************************************************
-** State gcregEvent
-*/
-
-/* Send an event. */
-
-#define gcregEventRegAddrs 0x0E01
-#define GCREG_EVENT_MSB 15
-#define GCREG_EVENT_LSB 0
-#define GCREG_EVENT_BLK 0
-#define GCREG_EVENT_Count 1
-#define GCREG_EVENT_FieldMask 0x0000007F
-#define GCREG_EVENT_ReadMask 0x0000007F
-#define GCREG_EVENT_WriteMask 0x0000007F
-#define GCREG_EVENT_ResetValue 0x00000000
-
-/* 5-bit event ID to send. */
-#define GCREG_EVENT_EVENT_ID 4 : 0
-#define GCREG_EVENT_EVENT_ID_End 4
-#define GCREG_EVENT_EVENT_ID_Start 0
-#define GCREG_EVENT_EVENT_ID_Type U05
-
-/* The event is sent by the FE. */
-#define GCREG_EVENT_FE_SRC 5 : 5
-#define GCREG_EVENT_FE_SRC_End 5
-#define GCREG_EVENT_FE_SRC_Start 5
-#define GCREG_EVENT_FE_SRC_Type U01
-#define GCREG_EVENT_FE_SRC_DISABLE 0x0
-#define GCREG_EVENT_FE_SRC_ENABLE 0x1
-
-/* The event is sent by the PE. */
-#define GCREG_EVENT_PE_SRC 6 : 6
-#define GCREG_EVENT_PE_SRC_End 6
-#define GCREG_EVENT_PE_SRC_Start 6
-#define GCREG_EVENT_PE_SRC_Type U01
-#define GCREG_EVENT_PE_SRC_DISABLE 0x0
-#define GCREG_EVENT_PE_SRC_ENABLE 0x1
-
-struct gcregevent {
- /* gcregEventRegAddrs:GCREG_EVENT_EVENT_ID */
- unsigned int id:5;
-
- /* gcregEventRegAddrs:GCREG_EVENT_FE_SRC */
- unsigned int fe:1;
-
- /* gcregEventRegAddrs:GCREG_EVENT_PE_SRC */
- unsigned int pe:1;
-
- /* gcregEventRegAddrs:reserved */
- unsigned int _reserved_7_31:25;
-};
-
-/*******************************************************************************
-** State gcregSemaphore
-*/
-
-/* A sempahore state arms the semaphore in the destination. */
-
-#define gcregSemaphoreRegAddrs 0x0E02
-#define GCREG_SEMAPHORE_MSB 15
-#define GCREG_SEMAPHORE_LSB 0
-#define GCREG_SEMAPHORE_BLK 0
-#define GCREG_SEMAPHORE_Count 1
-#define GCREG_SEMAPHORE_FieldMask 0x00001F1F
-#define GCREG_SEMAPHORE_ReadMask 0x00001F1F
-#define GCREG_SEMAPHORE_WriteMask 0x00001F1F
-#define GCREG_SEMAPHORE_ResetValue 0x00000000
-
-#define GCREG_SEMAPHORE_SOURCE 4 : 0
-#define GCREG_SEMAPHORE_SOURCE_End 4
-#define GCREG_SEMAPHORE_SOURCE_Start 0
-#define GCREG_SEMAPHORE_SOURCE_Type U05
-#define GCREG_SEMAPHORE_SOURCE_FRONT_END 0x01
-#define GCREG_SEMAPHORE_SOURCE_PIXEL_ENGINE 0x07
-#define GCREG_SEMAPHORE_SOURCE_DRAWING_ENGINE 0x0B
-
-#define GCREG_SEMAPHORE_DESTINATION 12 : 8
-#define GCREG_SEMAPHORE_DESTINATION_End 12
-#define GCREG_SEMAPHORE_DESTINATION_Start 8
-#define GCREG_SEMAPHORE_DESTINATION_Type U05
-#define GCREG_SEMAPHORE_DESTINATION_FRONT_END 0x01
-#define GCREG_SEMAPHORE_DESTINATION_PIXEL_ENGINE 0x07
-#define GCREG_SEMAPHORE_DESTINATION_DRAWING_ENGINE 0x0B
-
-struct gcregsemaphore {
- /* gcregSemaphoreRegAddrs:GCREG_SEMAPHORE_SOURCE */
- unsigned int src:5;
-
- /* gcregSemaphoreRegAddrs:reserved */
- unsigned int _reserved_5_7:3;
-
- /* gcregSemaphoreRegAddrs:GCREG_SEMAPHORE_DESTINATION */
- unsigned int dst:5;
-
- /* gcregSemaphoreRegAddrs:reserved */
- unsigned int _reserved_13_31:19;
-};
-
-static const struct gcregsemaphore gcregsema_fe_pe = {
- /* gcregSemaphoreRegAddrs:GCREG_SEMAPHORE_SOURCE */
- GCREG_SEMAPHORE_SOURCE_FRONT_END,
-
- /* gcregSemaphoreRegAddrs:reserved */
- 0,
-
- /* gcregSemaphoreRegAddrs:GCREG_SEMAPHORE_DESTINATION */
- GCREG_SEMAPHORE_DESTINATION_PIXEL_ENGINE,
-
- /* gcregSemaphoreRegAddrs:reserved */
- 0
-};
-
-
-/*******************************************************************************
-** State gcregFlush
-*/
-
-/* Flush the current pipe. */
-
-#define gcregFlushRegAddrs 0x0E03
-#define GCREG_FLUSH_MSB 15
-#define GCREG_FLUSH_LSB 0
-#define GCREG_FLUSH_BLK 0
-#define GCREG_FLUSH_Count 1
-#define GCREG_FLUSH_FieldMask 0x00000008
-#define GCREG_FLUSH_ReadMask 0x00000008
-#define GCREG_FLUSH_WriteMask 0x00000008
-#define GCREG_FLUSH_ResetValue 0x00000000
-
-/* Flush the 2D pixel cache. */
-#define GCREG_FLUSH_PE2D_CACHE 3 : 3
-#define GCREG_FLUSH_PE2D_CACHE_End 3
-#define GCREG_FLUSH_PE2D_CACHE_Start 3
-#define GCREG_FLUSH_PE2D_CACHE_Type U01
-#define GCREG_FLUSH_PE2D_CACHE_DISABLE 0x0
-#define GCREG_FLUSH_PE2D_CACHE_ENABLE 0x1
-
-struct gcregflush {
- /* gcregFlushRegAddrs:reserved */
- unsigned int _reserved_0_2:3;
-
- /* gcregFlushRegAddrs:GCREG_FLUSH_PE2D_CACHE */
- unsigned int enable:1;
-
- /* gcregFlushRegAddrs:reserved */
- unsigned int _reserved_4_31:28;
-};
-
-static const struct gcregflush gcregflush_pe2D = {
- /* gcregFlushRegAddrs:reserved */
- 0,
-
- /* gcregFlushRegAddrs:GCREG_FLUSH_PE2D_CACHE */
- GCREG_FLUSH_PE2D_CACHE_ENABLE,
-
- /* gcregFlushRegAddrs:reserved */
- 0
-};
-
-/*******************************************************************************
-** State gcregMMUFlush
-*/
-
-/* Flush the virtual addrses lookup cache inside the MC. */
-
-#define gcregMMUFlushRegAddrs 0x0E04
-#define gcregMMU_FLUSH_MSB 15
-#define gcregMMU_FLUSH_LSB 0
-#define gcregMMU_FLUSH_BLK 0
-#define gcregMMU_FLUSH_Count 1
-#define gcregMMU_FLUSH_FieldMask 0x00000009
-#define gcregMMU_FLUSH_ReadMask 0x00000009
-#define gcregMMU_FLUSH_WriteMask 0x00000009
-#define gcregMMU_FLUSH_ResetValue 0x00000000
-
-/* Flush the FE address translation caches. */
-#define gcregMMU_FLUSH_FEMMU 0 : 0
-#define gcregMMU_FLUSH_FEMMU_End 0
-#define gcregMMU_FLUSH_FEMMU_Start 0
-#define gcregMMU_FLUSH_FEMMU_Type U01
-#define gcregMMU_FLUSH_FEMMU_DISABLE 0x0
-#define gcregMMU_FLUSH_FEMMU_ENABLE 0x1
-
-/* Flush the PE render target address translation caches. */
-#define gcregMMU_FLUSH_PEMMU 3 : 3
-#define gcregMMU_FLUSH_PEMMU_End 3
-#define gcregMMU_FLUSH_PEMMU_Start 3
-#define gcregMMU_FLUSH_PEMMU_Type U01
-#define gcregMMU_FLUSH_PEMMU_DISABLE 0x0
-#define gcregMMU_FLUSH_PEMMU_ENABLE 0x1
-
-/*******************************************************************************
-** Register gcregCmdBufferAddr
-*/
-
-/* Base address for the command buffer. The address must be 64-bit aligned
-** and it is always physical. This register cannot be read. To check the value
-** of the current fetch address use gcregFEDebugCurCmdAdr. Since this is a write
-** only register is has no reset value.
-*/
-
-#define GCREG_CMD_BUFFER_ADDR_Address 0x00654
-#define GCREG_CMD_BUFFER_ADDR_MSB 15
-#define GCREG_CMD_BUFFER_ADDR_LSB 0
-#define GCREG_CMD_BUFFER_ADDR_BLK 0
-#define GCREG_CMD_BUFFER_ADDR_Count 1
-#define GCREG_CMD_BUFFER_ADDR_FieldMask 0xFFFFFFFF
-#define GCREG_CMD_BUFFER_ADDR_ReadMask 0x00000000
-#define GCREG_CMD_BUFFER_ADDR_WriteMask 0xFFFFFFFC
-#define GCREG_CMD_BUFFER_ADDR_ResetValue 0x00000000
-
-#define GCREG_CMD_BUFFER_ADDR_ADDRESS 31 : 0
-#define GCREG_CMD_BUFFER_ADDR_ADDRESS_End 30
-#define GCREG_CMD_BUFFER_ADDR_ADDRESS_Start 0
-#define GCREG_CMD_BUFFER_ADDR_ADDRESS_Type U31
-
-/*******************************************************************************
-** Register gcregCmdBufferCtrl
-*/
-
-/* Since this is a write only register is has no reset value. */
-
-#define GCREG_CMD_BUFFER_CTRL_Address 0x00658
-#define GCREG_CMD_BUFFER_CTRL_MSB 15
-#define GCREG_CMD_BUFFER_CTRL_LSB 0
-#define GCREG_CMD_BUFFER_CTRL_BLK 0
-#define GCREG_CMD_BUFFER_CTRL_Count 1
-#define GCREG_CMD_BUFFER_CTRL_FieldMask 0x0001FFFF
-#define GCREG_CMD_BUFFER_CTRL_ReadMask 0x00010000
-#define GCREG_CMD_BUFFER_CTRL_WriteMask 0x0001FFFF
-#define GCREG_CMD_BUFFER_CTRL_ResetValue 0x00000000
-
-/* Number of 64-bit words to fetch from the command buffer. */
-#define GCREG_CMD_BUFFER_CTRL_PREFETCH 15 : 0
-#define GCREG_CMD_BUFFER_CTRL_PREFETCH_End 15
-#define GCREG_CMD_BUFFER_CTRL_PREFETCH_Start 0
-#define GCREG_CMD_BUFFER_CTRL_PREFETCH_Type U16
-
-/* Enable the command parser. */
-#define GCREG_CMD_BUFFER_CTRL_ENABLE 16 : 16
-#define GCREG_CMD_BUFFER_CTRL_ENABLE_End 16
-#define GCREG_CMD_BUFFER_CTRL_ENABLE_Start 16
-#define GCREG_CMD_BUFFER_CTRL_ENABLE_Type U01
-#define GCREG_CMD_BUFFER_CTRL_ENABLE_DISABLE 0x0
-#define GCREG_CMD_BUFFER_CTRL_ENABLE_ENABLE 0x1
-
-/*******************************************************************************
-** Register gcregFEDebugState
-*/
-
-#define GCREG_FE_DEBUG_STATE_Address 0x00660
-#define GCREG_FE_DEBUG_STATE_MSB 15
-#define GCREG_FE_DEBUG_STATE_LSB 0
-#define GCREG_FE_DEBUG_STATE_BLK 0
-#define GCREG_FE_DEBUG_STATE_Count 1
-#define GCREG_FE_DEBUG_STATE_FieldMask 0x0003FF1F
-#define GCREG_FE_DEBUG_STATE_ReadMask 0x0003FF1F
-#define GCREG_FE_DEBUG_STATE_WriteMask 0x00000000
-#define GCREG_FE_DEBUG_STATE_ResetValue 0x00000000
-
-#define GCREG_FE_DEBUG_STATE_CMD_STATE 4 : 0
-#define GCREG_FE_DEBUG_STATE_CMD_STATE_End 4
-#define GCREG_FE_DEBUG_STATE_CMD_STATE_Start 0
-#define GCREG_FE_DEBUG_STATE_CMD_STATE_Type U05
-
-#define GCREG_FE_DEBUG_STATE_CMD_DMA_STATE 9 : 8
-#define GCREG_FE_DEBUG_STATE_CMD_DMA_STATE_End 9
-#define GCREG_FE_DEBUG_STATE_CMD_DMA_STATE_Start 8
-#define GCREG_FE_DEBUG_STATE_CMD_DMA_STATE_Type U02
-
-#define GCREG_FE_DEBUG_STATE_CMD_FETCH_STATE 11 : 10
-#define GCREG_FE_DEBUG_STATE_CMD_FETCH_STATE_End 11
-#define GCREG_FE_DEBUG_STATE_CMD_FETCH_STATE_Start 10
-#define GCREG_FE_DEBUG_STATE_CMD_FETCH_STATE_Type U02
-
-#define GCREG_FE_DEBUG_STATE_REQ_DMA_STATE 13 : 12
-#define GCREG_FE_DEBUG_STATE_REQ_DMA_STATE_End 13
-#define GCREG_FE_DEBUG_STATE_REQ_DMA_STATE_Start 12
-#define GCREG_FE_DEBUG_STATE_REQ_DMA_STATE_Type U02
-
-#define GCREG_FE_DEBUG_STATE_CAL_STATE 15 : 14
-#define GCREG_FE_DEBUG_STATE_CAL_STATE_End 15
-#define GCREG_FE_DEBUG_STATE_CAL_STATE_Start 14
-#define GCREG_FE_DEBUG_STATE_CAL_STATE_Type U02
-
-#define GCREG_FE_DEBUG_STATE_VE_REQ_STATE 17 : 16
-#define GCREG_FE_DEBUG_STATE_VE_REQ_STATE_End 17
-#define GCREG_FE_DEBUG_STATE_VE_REQ_STATE_Start 16
-#define GCREG_FE_DEBUG_STATE_VE_REQ_STATE_Type U02
-
-/*******************************************************************************
-** Register gcregFEDebugCurCmdAdr
-*/
-
-/* This is the command decoder address. The address is always physical so
-** the MSB should always be 0. It has no reset value.
-*/
-
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_Address 0x00664
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_MSB 15
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_LSB 0
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_BLK 0
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_Count 1
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_FieldMask 0xFFFFFFF8
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_ReadMask 0xFFFFFFF8
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_WriteMask 0x00000000
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_ResetValue 0x00000000
-
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_CUR_CMD_ADR 31 : 3
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_CUR_CMD_ADR_End 31
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_CUR_CMD_ADR_Start 3
-#define GCREG_FE_DEBUG_CUR_CMD_ADR_CUR_CMD_ADR_Type U29
-
-/*******************************************************************************
-** Register gcregFEDebugCmdLowReg
-*/
-
-#define GCREG_FE_DEBUG_CMD_LOW_REG_Address 0x00668
-#define GCREG_FE_DEBUG_CMD_LOW_REG_MSB 15
-#define GCREG_FE_DEBUG_CMD_LOW_REG_LSB 0
-#define GCREG_FE_DEBUG_CMD_LOW_REG_BLK 0
-#define GCREG_FE_DEBUG_CMD_LOW_REG_Count 1
-#define GCREG_FE_DEBUG_CMD_LOW_REG_FieldMask 0xFFFFFFFF
-#define GCREG_FE_DEBUG_CMD_LOW_REG_ReadMask 0xFFFFFFFF
-#define GCREG_FE_DEBUG_CMD_LOW_REG_WriteMask 0x00000000
-#define GCREG_FE_DEBUG_CMD_LOW_REG_ResetValue 0x00000000
-
-/* Command register used by CmdState. */
-#define GCREG_FE_DEBUG_CMD_LOW_REG_CMD_LOW_REG 31 : 0
-#define GCREG_FE_DEBUG_CMD_LOW_REG_CMD_LOW_REG_End 31
-#define GCREG_FE_DEBUG_CMD_LOW_REG_CMD_LOW_REG_Start 0
-#define GCREG_FE_DEBUG_CMD_LOW_REG_CMD_LOW_REG_Type U32
-
-/*******************************************************************************
-** Register gcregFEDebugCmdHiReg
-*/
-
-#define GCREG_FE_DEBUG_CMD_HI_REG_Address 0x0066C
-#define GCREG_FE_DEBUG_CMD_HI_REG_MSB 15
-#define GCREG_FE_DEBUG_CMD_HI_REG_LSB 0
-#define GCREG_FE_DEBUG_CMD_HI_REG_BLK 0
-#define GCREG_FE_DEBUG_CMD_HI_REG_Count 1
-#define GCREG_FE_DEBUG_CMD_HI_REG_FieldMask 0xFFFFFFFF
-#define GCREG_FE_DEBUG_CMD_HI_REG_ReadMask 0xFFFFFFFF
-#define GCREG_FE_DEBUG_CMD_HI_REG_WriteMask 0x00000000
-#define GCREG_FE_DEBUG_CMD_HI_REG_ResetValue 0x00000000
-
-/* Command register used by CmdState. */
-#define GCREG_FE_DEBUG_CMD_HI_REG_CMD_HI_REG 31 : 0
-#define GCREG_FE_DEBUG_CMD_HI_REG_CMD_HI_REG_End 31
-#define GCREG_FE_DEBUG_CMD_HI_REG_CMD_HI_REG_Start 0
-#define GCREG_FE_DEBUG_CMD_HI_REG_CMD_HI_REG_Type U32
-
-/*******************************************************************************
-** State gcregMMUSafeAddress
-*/
-
-/* A 64-byte address that will acts as a 'safe' zone. Any address that would
-** cause an exception is routed to this safe zone. Reads will happend and
-** writes will go to this address, but with a write-enable of 0. This
-** register can only be programmed once after a reset - any attempt to write
-** to this register after the initial write-after-reset will be ignored.
-*/
-
-#define gcregMMUSafeAddressRegAddrs 0x0060
-#define GCREG_MMU_SAFE_ADDRESS_MSB 15
-#define GCREG_MMU_SAFE_ADDRESS_LSB 0
-#define GCREG_MMU_SAFE_ADDRESS_BLK 0
-#define GCREG_MMU_SAFE_ADDRESS_Count 1
-#define GCREG_MMU_SAFE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_MMU_SAFE_ADDRESS_ReadMask 0xFFFFFFC0
-#define GCREG_MMU_SAFE_ADDRESS_WriteMask 0xFFFFFFC0
-#define GCREG_MMU_SAFE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_MMU_SAFE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_MMU_SAFE_ADDRESS_ADDRESS_End 31
-#define GCREG_MMU_SAFE_ADDRESS_ADDRESS_Start 0
-#define GCREG_MMU_SAFE_ADDRESS_ADDRESS_Type U32
-
-/*******************************************************************************
-** State gcregMMUConfiguration
-*/
-
-/* This register controls the master TLB of the MMU. */
-
-#define gcregMMUConfigurationRegAddrs 0x0061
-#define GCREG_MMU_CONFIGURATION_MSB 15
-#define GCREG_MMU_CONFIGURATION_LSB 0
-#define GCREG_MMU_CONFIGURATION_BLK 0
-#define GCREG_MMU_CONFIGURATION_Count 1
-#define GCREG_MMU_CONFIGURATION_FieldMask 0xFFFFFD99
-#define GCREG_MMU_CONFIGURATION_ReadMask 0xFFFFFD99
-#define GCREG_MMU_CONFIGURATION_WriteMask 0xFFFFFD99
-#define GCREG_MMU_CONFIGURATION_ResetValue 0x00000000
-
-/* Upper bits of the page aligned (depending on the mode) master TLB. */
-#define GCREG_MMU_CONFIGURATION_ADDRESS 31 : 10
-#define GCREG_MMU_CONFIGURATION_ADDRESS_End 31
-#define GCREG_MMU_CONFIGURATION_ADDRESS_Start 10
-#define GCREG_MMU_CONFIGURATION_ADDRESS_Type U22
-
-/* Mask for Address field. */
-#define GCREG_MMU_CONFIGURATION_MASK_ADDRESS 8 : 8
-#define GCREG_MMU_CONFIGURATION_MASK_ADDRESS_End 8
-#define GCREG_MMU_CONFIGURATION_MASK_ADDRESS_Start 8
-#define GCREG_MMU_CONFIGURATION_MASK_ADDRESS_Type U01
-#define GCREG_MMU_CONFIGURATION_MASK_ADDRESS_ENABLED 0x0
-#define GCREG_MMU_CONFIGURATION_MASK_ADDRESS_MASKED 0x1
-
-/* Mask Flush field. */
-#define GCREG_MMU_CONFIGURATION_MASK_FLUSH 7 : 7
-#define GCREG_MMU_CONFIGURATION_MASK_FLUSH_End 7
-#define GCREG_MMU_CONFIGURATION_MASK_FLUSH_Start 7
-#define GCREG_MMU_CONFIGURATION_MASK_FLUSH_Type U01
-#define GCREG_MMU_CONFIGURATION_MASK_FLUSH_ENABLED 0x0
-#define GCREG_MMU_CONFIGURATION_MASK_FLUSH_MASKED 0x1
-
-/* Flush the MMU caches. */
-#define GCREG_MMU_CONFIGURATION_FLUSH 4 : 4
-#define GCREG_MMU_CONFIGURATION_FLUSH_End 4
-#define GCREG_MMU_CONFIGURATION_FLUSH_Start 4
-#define GCREG_MMU_CONFIGURATION_FLUSH_Type U01
-#define GCREG_MMU_CONFIGURATION_FLUSH_FLUSH 0x1
-
-/* Mask Mode field. */
-#define GCREG_MMU_CONFIGURATION_MASK_MODE 3 : 3
-#define GCREG_MMU_CONFIGURATION_MASK_MODE_End 3
-#define GCREG_MMU_CONFIGURATION_MASK_MODE_Start 3
-#define GCREG_MMU_CONFIGURATION_MASK_MODE_Type U01
-#define GCREG_MMU_CONFIGURATION_MASK_MODE_ENABLED 0x0
-#define GCREG_MMU_CONFIGURATION_MASK_MODE_MASKED 0x1
-
-/* Set the mode for the Master TLB. */
-#define GCREG_MMU_CONFIGURATION_MODE 0 : 0
-#define GCREG_MMU_CONFIGURATION_MODE_End 0
-#define GCREG_MMU_CONFIGURATION_MODE_Start 0
-#define GCREG_MMU_CONFIGURATION_MODE_Type U01
-/* The Master TLB is 4kB in size and contains 1024 entries. Each page can be **
-** 4kB or 64kB in size. */
-#define GCREG_MMU_CONFIGURATION_MODE_MODE4_K 0x0
-/* The Master TLB is 1kB in size and contains 256 entries. Each page can be **
-** 4kB, 64kB, 1MB or 16MB in size. */
-#define GCREG_MMU_CONFIGURATION_MODE_MODE1_K 0x1
-
-struct gcregmmuconfiguration {
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MODE */
- unsigned int master:1;
-
- /* gcregMMUConfiguration:reserved */
- unsigned int _reserved_1_2:2;
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MASK_MODE */
- unsigned int master_mask:1;
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_FLUSH */
- unsigned int flush:1;
-
- /* gcregMMUConfiguration:reserved */
- unsigned int _reserved_5_6:2;
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MASK_FLUSH */
- unsigned int flush_mask:1;
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MASK_ADDRESS */
- unsigned int address_mask:1;
-
- /* gcregMMUConfiguration:reserved */
- unsigned int _reserved_9:1;
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_ADDRESS */
- unsigned int address:22;
-};
-
-static const struct gcregmmuconfiguration gcregmmu_flush = {
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MODE */
- 0,
-
- /* gcregMMUConfiguration:reserved */
- 0,
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MASK_MODE */
- GCREG_MMU_CONFIGURATION_MASK_MODE_MASKED,
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_FLUSH */
- GCREG_MMU_CONFIGURATION_FLUSH_FLUSH,
-
- /* gcregMMUConfiguration:reserved */
- 0,
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MASK_FLUSH */
- GCREG_MMU_CONFIGURATION_MASK_FLUSH_ENABLED,
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_MASK_ADDRESS */
- GCREG_MMU_CONFIGURATION_MASK_ADDRESS_MASKED,
-
- /* gcregMMUConfiguration:reserved */
- 0,
-
- /* gcregMMUConfiguration:GCREG_MMU_CONFIGURATION_ADDRESS */
- 0
-};
-
-/*******************************************************************************
-** Register gcregMMUStatus
-*/
-
-/* Status register that holds which MMU generated an exception. */
-
-#define GCREG_MMU_STATUS_Address 0x00188
-#define GCREG_MMU_STATUS_MSB 15
-#define GCREG_MMU_STATUS_LSB 0
-#define GCREG_MMU_STATUS_BLK 0
-#define GCREG_MMU_STATUS_Count 1
-#define GCREG_MMU_STATUS_FieldMask 0x00003333
-#define GCREG_MMU_STATUS_ReadMask 0x00003333
-#define GCREG_MMU_STATUS_WriteMask 0x00000000
-#define GCREG_MMU_STATUS_ResetValue 0x00000000
-
-/* MMU 3 caused an exception and the fourth gcregMMUException register holds **
-** the offending address. */
-#define GCREG_MMU_STATUS_EXCEPTION3 13 : 12
-#define GCREG_MMU_STATUS_EXCEPTION3_End 13
-#define GCREG_MMU_STATUS_EXCEPTION3_Start 12
-#define GCREG_MMU_STATUS_EXCEPTION3_Type U02
-#define GCREG_MMU_STATUS_EXCEPTION3_SLAVE_NOT_PRESENT 0x1
-#define GCREG_MMU_STATUS_EXCEPTION3_PAGE_NOT_PRESENT 0x2
-#define GCREG_MMU_STATUS_EXCEPTION3_WRITE_VIOLATION 0x3
-
-/* MMU 2 caused an exception and the third gcregMMUException register holds **
-** the offending address. */
-#define GCREG_MMU_STATUS_EXCEPTION2 9 : 8
-#define GCREG_MMU_STATUS_EXCEPTION2_End 9
-#define GCREG_MMU_STATUS_EXCEPTION2_Start 8
-#define GCREG_MMU_STATUS_EXCEPTION2_Type U02
-#define GCREG_MMU_STATUS_EXCEPTION2_SLAVE_NOT_PRESENT 0x1
-#define GCREG_MMU_STATUS_EXCEPTION2_PAGE_NOT_PRESENT 0x2
-#define GCREG_MMU_STATUS_EXCEPTION2_WRITE_VIOLATION 0x3
-
-/* MMU 1 caused an exception and the second gcregMMUException register holds **
-** the offending address. */
-#define GCREG_MMU_STATUS_EXCEPTION1 5 : 4
-#define GCREG_MMU_STATUS_EXCEPTION1_End 5
-#define GCREG_MMU_STATUS_EXCEPTION1_Start 4
-#define GCREG_MMU_STATUS_EXCEPTION1_Type U02
-#define GCREG_MMU_STATUS_EXCEPTION1_SLAVE_NOT_PRESENT 0x1
-#define GCREG_MMU_STATUS_EXCEPTION1_PAGE_NOT_PRESENT 0x2
-#define GCREG_MMU_STATUS_EXCEPTION1_WRITE_VIOLATION 0x3
-
-/* MMU 0 caused an exception and the first gcregMMUException register holds **
-** the offending address. */
-#define GCREG_MMU_STATUS_EXCEPTION0 1 : 0
-#define GCREG_MMU_STATUS_EXCEPTION0_End 1
-#define GCREG_MMU_STATUS_EXCEPTION0_Start 0
-#define GCREG_MMU_STATUS_EXCEPTION0_Type U02
-#define GCREG_MMU_STATUS_EXCEPTION0_SLAVE_NOT_PRESENT 0x1
-#define GCREG_MMU_STATUS_EXCEPTION0_PAGE_NOT_PRESENT 0x2
-#define GCREG_MMU_STATUS_EXCEPTION0_WRITE_VIOLATION 0x3
-
-/*******************************************************************************
-** Register gcregMMUControl
-*/
-
-/* Control register that enables the MMU (only time shot). */
-
-#define GCREG_MMU_CONTROL_Address 0x0018C
-#define GCREG_MMU_CONTROL_MSB 15
-#define GCREG_MMU_CONTROL_LSB 0
-#define GCREG_MMU_CONTROL_BLK 0
-#define GCREG_MMU_CONTROL_Count 1
-#define GCREG_MMU_CONTROL_FieldMask 0x00000001
-#define GCREG_MMU_CONTROL_ReadMask 0x00000000
-#define GCREG_MMU_CONTROL_WriteMask 0x00000001
-#define GCREG_MMU_CONTROL_ResetValue 0x00000000
-
-/* Enable the MMU. For security reasons, once the MMU is enabled it cannot **
-** be disabled anymore. */
-#define GCREG_MMU_CONTROL_ENABLE 0 : 0
-#define GCREG_MMU_CONTROL_ENABLE_End 0
-#define GCREG_MMU_CONTROL_ENABLE_Start 0
-#define GCREG_MMU_CONTROL_ENABLE_Type U01
-#define GCREG_MMU_CONTROL_ENABLE_ENABLE 0x1
-
-/*******************************************************************************
-** State/Register gcregMMUException (4 in total)
-*/
-
-/* Up to 4 registers that will hold the original address that generated an
-** exception. Use load state form for exception resolution.
-*/
-
-#define gcregMMUExceptionRegAddrs 0x0064
-#define GCREG_MMU_EXCEPTION_Address 0x00190
-#define GCREG_MMU_EXCEPTION_MSB 15
-#define GCREG_MMU_EXCEPTION_LSB 2
-#define GCREG_MMU_EXCEPTION_BLK 2
-#define GCREG_MMU_EXCEPTION_Count 4
-#define GCREG_MMU_EXCEPTION_FieldMask 0xFFFFFFFF
-#define GCREG_MMU_EXCEPTION_ReadMask 0xFFFFFFFF
-#define GCREG_MMU_EXCEPTION_WriteMask 0xFFFFFFFF
-#define GCREG_MMU_EXCEPTION_ResetValue 0x00000000
-
-#define GCREG_MMU_EXCEPTION_ADDRESS 31 : 0
-#define GCREG_MMU_EXCEPTION_ADDRESS_End 31
-#define GCREG_MMU_EXCEPTION_ADDRESS_Start 0
-#define GCREG_MMU_EXCEPTION_ADDRESS_Type U32
-
-/*******************************************************************************
-** Register gcModulePowerControls
-*/
-
-/* Control register for module level power controls. */
-
-#define GC_MODULE_POWER_CONTROLS_Address 0x00100
-#define GC_MODULE_POWER_CONTROLS_MSB 15
-#define GC_MODULE_POWER_CONTROLS_LSB 0
-#define GC_MODULE_POWER_CONTROLS_BLK 0
-#define GC_MODULE_POWER_CONTROLS_Count 1
-#define GC_MODULE_POWER_CONTROLS_FieldMask 0xFFFF00F7
-#define GC_MODULE_POWER_CONTROLS_ReadMask 0xFFFF00F7
-#define GC_MODULE_POWER_CONTROLS_WriteMask 0xFFFF00F7
-#define GC_MODULE_POWER_CONTROLS_ResetValue 0x00140020
-
-/* Enables module level clock gating. */
-#define GC_MODULE_POWER_CONTROLS_ENABLE_MODULE_CLOCK_GATING 0 : 0
-#define GC_MODULE_POWER_CONTROLS_ENABLE_MODULE_CLOCK_GATING_End 0
-#define GC_MODULE_POWER_CONTROLS_ENABLE_MODULE_CLOCK_GATING_Start 0
-#define GC_MODULE_POWER_CONTROLS_ENABLE_MODULE_CLOCK_GATING_Type U01
-
-/* Disables module level clock gating for stall condition. */
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STALL_MODULE_CLOCK_GATING 1 : 1
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STALL_MODULE_CLOCK_GATING_End 1
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STALL_MODULE_CLOCK_GATING_Start 1
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STALL_MODULE_CLOCK_GATING_Type U01
-
-/* Disables module level clock gating for starve/idle condition. */
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STARVE_MODULE_CLOCK_GATING 2 : 2
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STARVE_MODULE_CLOCK_GATING_End 2
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STARVE_MODULE_CLOCK_GATING_Start 2
-#define GC_MODULE_POWER_CONTROLS_DISABLE_STARVE_MODULE_CLOCK_GATING_Type U01
-
-/* Number of clock cycles to wait after turning on the clock. */
-#define GC_MODULE_POWER_CONTROLS_TURN_ON_COUNTER 7 : 4
-#define GC_MODULE_POWER_CONTROLS_TURN_ON_COUNTER_End 7
-#define GC_MODULE_POWER_CONTROLS_TURN_ON_COUNTER_Start 4
-#define GC_MODULE_POWER_CONTROLS_TURN_ON_COUNTER_Type U04
-
-/* Counter value for clock gating the module if the module is idle for this **
-** amount of clock cycles. */
-#define GC_MODULE_POWER_CONTROLS_TURN_OFF_COUNTER 31 : 16
-#define GC_MODULE_POWER_CONTROLS_TURN_OFF_COUNTER_End 31
-#define GC_MODULE_POWER_CONTROLS_TURN_OFF_COUNTER_Start 16
-#define GC_MODULE_POWER_CONTROLS_TURN_OFF_COUNTER_Type U16
-
-/*******************************************************************************
-** Register gcModulePowerModuleControl
-*/
-
-/* Module level control registers. */
-
-#define GC_MODULE_POWER_MODULE_CONTROL_Address 0x00104
-#define GC_MODULE_POWER_MODULE_CONTROL_MSB 15
-#define GC_MODULE_POWER_MODULE_CONTROL_LSB 0
-#define GC_MODULE_POWER_MODULE_CONTROL_BLK 0
-#define GC_MODULE_POWER_MODULE_CONTROL_Count 1
-#define GC_MODULE_POWER_MODULE_CONTROL_FieldMask 0x00000007
-#define GC_MODULE_POWER_MODULE_CONTROL_ReadMask 0x00000007
-#define GC_MODULE_POWER_MODULE_CONTROL_WriteMask 0x00000007
-#define GC_MODULE_POWER_MODULE_CONTROL_ResetValue 0x00000000
-
-/* Disables module level clock gating for FE. */
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_FE 0 : 0
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_FE_End 0
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_FE_Start 0
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_FE_Type U01
-
-/* Disables module level clock gating for DE. */
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_DE 1 : 1
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_DE_End 1
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_DE_Start 1
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_DE_Type U01
-
-/* Disables module level clock gating for PE. */
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_PE 2 : 2
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_PE_End 2
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_PE_Start 2
-#define GC_MODULE_POWER_MODULE_CONTROL_DISABLE_MODULE_CLOCK_GATING_PE_Type U01
-
-/*******************************************************************************
-** Register gcModulePowerModuleStatus
-*/
-
-/* Module level control status. */
-
-#define GC_MODULE_POWER_MODULE_STATUS_Address 0x00108
-#define GC_MODULE_POWER_MODULE_STATUS_MSB 15
-#define GC_MODULE_POWER_MODULE_STATUS_LSB 0
-#define GC_MODULE_POWER_MODULE_STATUS_BLK 0
-#define GC_MODULE_POWER_MODULE_STATUS_Count 1
-#define GC_MODULE_POWER_MODULE_STATUS_FieldMask 0x00000007
-#define GC_MODULE_POWER_MODULE_STATUS_ReadMask 0x00000007
-#define GC_MODULE_POWER_MODULE_STATUS_WriteMask 0x00000000
-#define GC_MODULE_POWER_MODULE_STATUS_ResetValue 0x00000000
-
-/* Module level clock gating is ON for FE. */
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_FE 0 : 0
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_FE_End 0
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_FE_Start 0
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_FE_Type U01
-
-/* Module level clock gating is ON for DE. */
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_DE 1 : 1
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_DE_End 1
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_DE_Start 1
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_DE_Type U01
-
-/* Module level clock gating is ON for PE. */
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_PE 2 : 2
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_PE_End 2
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_PE_Start 2
-#define GC_MODULE_POWER_MODULE_STATUS_MODULE_CLOCK_GATED_PE_Type U01
-
-/*******************************************************************************
-** State gcregSrcAddress
-*/
-
-/* 32-bit aligned base address of the source surface. */
-
-#define gcregSrcAddressRegAddrs 0x0480
-#define GCREG_SRC_ADDRESS_MSB 15
-#define GCREG_SRC_ADDRESS_LSB 0
-#define GCREG_SRC_ADDRESS_BLK 0
-#define GCREG_SRC_ADDRESS_Count 1
-#define GCREG_SRC_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_SRC_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_SRC_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_SRC_ADDRESS_ADDRESS 31 : 0
-#define GCREG_SRC_ADDRESS_ADDRESS_End 30
-#define GCREG_SRC_ADDRESS_ADDRESS_Start 0
-#define GCREG_SRC_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregSrcStride
-*/
-
-/* Stride of the source surface in bytes. To calculate the stride multiply
-** the surface width in pixels (8-pixel aligned) by the number of bytes per
-** pixel.
-*/
-
-#define gcregSrcStrideRegAddrs 0x0481
-#define GCREG_SRC_STRIDE_MSB 15
-#define GCREG_SRC_STRIDE_LSB 0
-#define GCREG_SRC_STRIDE_BLK 0
-#define GCREG_SRC_STRIDE_Count 1
-#define GCREG_SRC_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_SRC_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_SRC_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_SRC_STRIDE_ResetValue 0x00000000
-
-#define GCREG_SRC_STRIDE_STRIDE 17 : 0
-#define GCREG_SRC_STRIDE_STRIDE_End 17
-#define GCREG_SRC_STRIDE_STRIDE_Start 0
-#define GCREG_SRC_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregSrcRotationConfig
-*/
-
-/* 90 degree rotation configuration for the source surface. Width field
-** specifies the width of the surface in pixels.
-*/
-
-#define gcregSrcRotationConfigRegAddrs 0x0482
-#define GCREG_SRC_ROTATION_CONFIG_MSB 15
-#define GCREG_SRC_ROTATION_CONFIG_LSB 0
-#define GCREG_SRC_ROTATION_CONFIG_BLK 0
-#define GCREG_SRC_ROTATION_CONFIG_Count 1
-#define GCREG_SRC_ROTATION_CONFIG_FieldMask 0x0001FFFF
-#define GCREG_SRC_ROTATION_CONFIG_ReadMask 0x0001FFFF
-#define GCREG_SRC_ROTATION_CONFIG_WriteMask 0x0001FFFF
-#define GCREG_SRC_ROTATION_CONFIG_ResetValue 0x00000000
-
-#define GCREG_SRC_ROTATION_CONFIG_WIDTH 15 : 0
-#define GCREG_SRC_ROTATION_CONFIG_WIDTH_End 15
-#define GCREG_SRC_ROTATION_CONFIG_WIDTH_Start 0
-#define GCREG_SRC_ROTATION_CONFIG_WIDTH_Type U16
-
-#define GCREG_SRC_ROTATION_CONFIG_ROTATION 16 : 16
-#define GCREG_SRC_ROTATION_CONFIG_ROTATION_End 16
-#define GCREG_SRC_ROTATION_CONFIG_ROTATION_Start 16
-#define GCREG_SRC_ROTATION_CONFIG_ROTATION_Type U01
-#define GCREG_SRC_ROTATION_CONFIG_ROTATION_DISABLE 0x0
-#define GCREG_SRC_ROTATION_CONFIG_ROTATION_ENABLE 0x1
-
-struct gcregsrcrotationconfig {
- /* gcregSrcRotationConfigRegAddrs:GCREG_SRC_ROTATION_CONFIG_WIDTH */
- unsigned int surf_width:16;
-
- /* gcregSrcRotationConfigRegAddrs:GCREG_SRC_ROTATION_CONFIG_ROTATION */
- unsigned int enable:1;
-
- /* gcregSrcRotationConfigRegAddrs:reserved */
- unsigned int _reserved_17_31:15;
-};
-
-/*******************************************************************************
-** State gcregSrcConfig
-*/
-
-/* Source surface configuration register. */
-
-#define gcregSrcConfigRegAddrs 0x0483
-#define GCREG_SRC_CONFIG_MSB 15
-#define GCREG_SRC_CONFIG_LSB 0
-#define GCREG_SRC_CONFIG_BLK 0
-#define GCREG_SRC_CONFIG_Count 1
-#define GCREG_SRC_CONFIG_FieldMask 0xFF31B1FF
-#define GCREG_SRC_CONFIG_ReadMask 0xFF31B1FF
-#define GCREG_SRC_CONFIG_WriteMask 0xFF31B1FF
-#define GCREG_SRC_CONFIG_ResetValue 0x00000000
-
-/* Control source endianess. */
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL 31 : 30
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL_End 31
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL_Start 30
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL_Type U02
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL_NO_SWAP 0x0
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL_SWAP_WORD 0x1
-#define GCREG_SRC_CONFIG_ENDIAN_CONTROL_SWAP_DWORD 0x2
-
-/* Disable 420 L2 cache NOTE: the field is valid for chips with 420 L2 cache **
-** defined. */
-#define GCREG_SRC_CONFIG_DISABLE420_L2_CACHE 29 : 29
-#define GCREG_SRC_CONFIG_DISABLE420_L2_CACHE_End 29
-#define GCREG_SRC_CONFIG_DISABLE420_L2_CACHE_Start 29
-#define GCREG_SRC_CONFIG_DISABLE420_L2_CACHE_Type U01
-#define GCREG_SRC_CONFIG_DISABLE420_L2_CACHE_ENABLED 0x0
-#define GCREG_SRC_CONFIG_DISABLE420_L2_CACHE_DISABLED 0x1
-
-/* Defines the pixel format of the source surface. */
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT 28 : 24
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_End 28
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_Start 24
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_Type U05
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_X4R4G4B4 0x00
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_A4R4G4B4 0x01
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_X1R5G5B5 0x02
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_A1R5G5B5 0x03
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_R5G6B5 0x04
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_X8R8G8B8 0x05
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_A8R8G8B8 0x06
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_YUY2 0x07
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_UYVY 0x08
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_INDEX8 0x09
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_MONOCHROME 0x0A
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_YV12 0x0F
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_A8 0x10
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_NV12 0x11
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_NV16 0x12
-#define GCREG_SRC_CONFIG_SOURCE_FORMAT_RG16 0x13
-
-/* Color channel swizzles. */
-#define GCREG_SRC_CONFIG_SWIZZLE 21 : 20
-#define GCREG_SRC_CONFIG_SWIZZLE_End 21
-#define GCREG_SRC_CONFIG_SWIZZLE_Start 20
-#define GCREG_SRC_CONFIG_SWIZZLE_Type U02
-#define GCREG_SRC_CONFIG_SWIZZLE_ARGB 0x0
-#define GCREG_SRC_CONFIG_SWIZZLE_RGBA 0x1
-#define GCREG_SRC_CONFIG_SWIZZLE_ABGR 0x2
-#define GCREG_SRC_CONFIG_SWIZZLE_BGRA 0x3
-
-/* Mono expansion: if 0, transparency color will be 0, otherwise transparency **
-** color will be 1. */
-#define GCREG_SRC_CONFIG_MONO_TRANSPARENCY 15 : 15
-#define GCREG_SRC_CONFIG_MONO_TRANSPARENCY_End 15
-#define GCREG_SRC_CONFIG_MONO_TRANSPARENCY_Start 15
-#define GCREG_SRC_CONFIG_MONO_TRANSPARENCY_Type U01
-#define GCREG_SRC_CONFIG_MONO_TRANSPARENCY_BACKGROUND 0x0
-#define GCREG_SRC_CONFIG_MONO_TRANSPARENCY_FOREGROUND 0x1
-
-/* Mono expansion or masked blit: stream packing in pixels. Determines how **
-** many horizontal pixels are there per each 32-bit chunk. For example, if **
-** set to Packed8, each 32-bit chunk is 8-pixel wide, which also means that **
-** it defines 4 vertical lines of pixels. */
-#define GCREG_SRC_CONFIG_PACK 13 : 12
-#define GCREG_SRC_CONFIG_PACK_End 13
-#define GCREG_SRC_CONFIG_PACK_Start 12
-#define GCREG_SRC_CONFIG_PACK_Type U02
-#define GCREG_SRC_CONFIG_PACK_PACKED8 0x0
-#define GCREG_SRC_CONFIG_PACK_PACKED16 0x1
-#define GCREG_SRC_CONFIG_PACK_PACKED32 0x2
-#define GCREG_SRC_CONFIG_PACK_UNPACKED 0x3
-
-/* Source data location: set to STREAM for mono expansion blits or masked **
-** blits. For mono expansion blits the complete bitmap comes from the command **
-** stream. For masked blits the source data comes from the memory and the **
-** mask from the command stream. */
-#define GCREG_SRC_CONFIG_LOCATION 8 : 8
-#define GCREG_SRC_CONFIG_LOCATION_End 8
-#define GCREG_SRC_CONFIG_LOCATION_Start 8
-#define GCREG_SRC_CONFIG_LOCATION_Type U01
-#define GCREG_SRC_CONFIG_LOCATION_MEMORY 0x0
-#define GCREG_SRC_CONFIG_LOCATION_STREAM 0x1
-
-/* Source linear/tiled address computation control. */
-#define GCREG_SRC_CONFIG_TILED 7 : 7
-#define GCREG_SRC_CONFIG_TILED_End 7
-#define GCREG_SRC_CONFIG_TILED_Start 7
-#define GCREG_SRC_CONFIG_TILED_Type U01
-#define GCREG_SRC_CONFIG_TILED_DISABLED 0x0
-#define GCREG_SRC_CONFIG_TILED_ENABLED 0x1
-
-/* If set to ABSOLUTE, the source coordinates are treated as absolute **
-** coordinates inside the source surface. If set to RELATIVE, the source **
-** coordinates are treated as the offsets from the destination coordinates **
-** with the source size equal to the size of the destination. */
-#define GCREG_SRC_CONFIG_SRC_RELATIVE 6 : 6
-#define GCREG_SRC_CONFIG_SRC_RELATIVE_End 6
-#define GCREG_SRC_CONFIG_SRC_RELATIVE_Start 6
-#define GCREG_SRC_CONFIG_SRC_RELATIVE_Type U01
-#define GCREG_SRC_CONFIG_SRC_RELATIVE_ABSOLUTE 0x0
-#define GCREG_SRC_CONFIG_SRC_RELATIVE_RELATIVE 0x1
-
-struct gcregsrcconfig {
- /* gcregSrcConfigRegAddrs:reserved */
- unsigned int _reserved_0_5:6;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_SRC_RELATIVE */
- unsigned int relative:1;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_TILED */
- unsigned int tiled:1;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_LOCATION */
- unsigned int stream:1;
-
- /* gcregSrcConfigRegAddrs:reserved */
- unsigned int _reserved_9_11:3;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_PACK */
- unsigned int monopack:2;
-
- /* gcregSrcConfigRegAddrs:reserved */
- unsigned int _reserved_14:1;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_MONO_TRANSPARENCY */
- unsigned int monotransp:1;
-
- /* gcregSrcConfigRegAddrs:reserved */
- unsigned int _reserved_16_19:4;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_SWIZZLE */
- unsigned int swizzle:2;
-
- /* gcregSrcConfigRegAddrs:reserved */
- unsigned int _reserved_22_23:2;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_SOURCE_FORMAT */
- unsigned int format:5;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_DISABLE420_L2_CACHE */
- unsigned int disable420L2cache:1;
-
- /* gcregSrcConfigRegAddrs:GCREG_SRC_CONFIG_ENDIAN_CONTROL */
- unsigned int endian:2;
-};
-
-/*******************************************************************************
-** State gcregSrcOrigin
-*/
-
-/* Absolute or relative (see SRC_RELATIVE field of gcregSrcConfig register) X
-** and Y coordinates in pixels of the top left corner of the source rectangle
-** within the source surface.
-*/
-
-#define gcregSrcOriginRegAddrs 0x0484
-#define GCREG_SRC_ORIGIN_MSB 15
-#define GCREG_SRC_ORIGIN_LSB 0
-#define GCREG_SRC_ORIGIN_BLK 0
-#define GCREG_SRC_ORIGIN_Count 1
-#define GCREG_SRC_ORIGIN_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_ORIGIN_ReadMask 0xFFFFFFFF
-#define GCREG_SRC_ORIGIN_WriteMask 0xFFFFFFFF
-#define GCREG_SRC_ORIGIN_ResetValue 0x00000000
-
-#define GCREG_SRC_ORIGIN_Y 31 : 16
-#define GCREG_SRC_ORIGIN_Y_End 31
-#define GCREG_SRC_ORIGIN_Y_Start 16
-#define GCREG_SRC_ORIGIN_Y_Type U16
-
-#define GCREG_SRC_ORIGIN_X 15 : 0
-#define GCREG_SRC_ORIGIN_X_End 15
-#define GCREG_SRC_ORIGIN_X_Start 0
-#define GCREG_SRC_ORIGIN_X_Type U16
-
-struct gcregsrcorigin {
- /* gcregSrcOriginRegAddrs:GCREG_SRC_ORIGIN_X */
- unsigned int x:16;
-
- /* gcregSrcOriginRegAddrs:GCREG_SRC_ORIGIN_Y */
- unsigned int y:16;
-};
-
-static const struct gcregsrcorigin gcregsrcorigin_min = {
- /* gcregSrcOriginRegAddrs:GCREG_SRC_ORIGIN_X */
- 0,
-
- /* gcregSrcOriginRegAddrs:GCREG_SRC_ORIGIN_Y */
- 0
-};
-
-/*******************************************************************************
-** State gcregSrcSize
-*/
-
-/* Width and height of the source rectangle in pixels. If the source is
-** relative (see SRC_RELATIVE field of gcregSrcConfig register) or a regular
-** bitblt is being performed without stretching, this register is ignored and
-** the source size is assumed to be the same as the destination.
-*/
-
-#define gcregSrcSizeRegAddrs 0x0485
-#define GCREG_SRC_SIZE_MSB 15
-#define GCREG_SRC_SIZE_LSB 0
-#define GCREG_SRC_SIZE_BLK 0
-#define GCREG_SRC_SIZE_Count 1
-#define GCREG_SRC_SIZE_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_SIZE_ReadMask 0xFFFFFFFF
-#define GCREG_SRC_SIZE_WriteMask 0xFFFFFFFF
-#define GCREG_SRC_SIZE_ResetValue 0x00000000
-
-#define GCREG_SRC_SIZE_Y 31 : 16
-#define GCREG_SRC_SIZE_Y_End 31
-#define GCREG_SRC_SIZE_Y_Start 16
-#define GCREG_SRC_SIZE_Y_Type U16
-
-#define GCREG_SRC_SIZE_X 15 : 0
-#define GCREG_SRC_SIZE_X_End 15
-#define GCREG_SRC_SIZE_X_Start 0
-#define GCREG_SRC_SIZE_X_Type U16
-
-struct gcregsrcsize {
- /* gcregSrcOriginRegAddrs:GCREG_SRC_SIZE_X */
- unsigned int width:16;
-
- /* gcregSrcOriginRegAddrs:GCREG_SRC_SIZE_Y */
- unsigned int height:16;
-};
-
-static const struct gcregsrcsize gcregsrcsize_max = {
- /* gcregSrcOriginRegAddrs:GCREG_SRC_SIZE_X */
- 32767,
-
- /* gcregSrcOriginRegAddrs:GCREG_SRC_SIZE_Y */
- 32767
-};
-
-/*******************************************************************************
-** State gcregSrcColorBg
-*/
-
-/* In mono expansion defines the source color if the mono pixel is 0. The color
-** must be set in A8R8G8B8 format. In color blits defines the source
-** transparency color and must be of the same format as the source surface.
-*/
-
-#define gcregSrcColorBgRegAddrs 0x0486
-#define GCREG_SRC_COLOR_BG_MSB 15
-#define GCREG_SRC_COLOR_BG_LSB 0
-#define GCREG_SRC_COLOR_BG_BLK 0
-#define GCREG_SRC_COLOR_BG_Count 1
-#define GCREG_SRC_COLOR_BG_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_BG_ReadMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_BG_WriteMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_BG_ResetValue 0x00000000
-
-#define GCREG_SRC_COLOR_BG_ALPHA 31 : 24
-#define GCREG_SRC_COLOR_BG_ALPHA_End 31
-#define GCREG_SRC_COLOR_BG_ALPHA_Start 24
-#define GCREG_SRC_COLOR_BG_ALPHA_Type U08
-
-#define GCREG_SRC_COLOR_BG_RED 23 : 16
-#define GCREG_SRC_COLOR_BG_RED_End 23
-#define GCREG_SRC_COLOR_BG_RED_Start 16
-#define GCREG_SRC_COLOR_BG_RED_Type U08
-
-#define GCREG_SRC_COLOR_BG_GREEN 15 : 8
-#define GCREG_SRC_COLOR_BG_GREEN_End 15
-#define GCREG_SRC_COLOR_BG_GREEN_Start 8
-#define GCREG_SRC_COLOR_BG_GREEN_Type U08
-
-#define GCREG_SRC_COLOR_BG_BLUE 7 : 0
-#define GCREG_SRC_COLOR_BG_BLUE_End 7
-#define GCREG_SRC_COLOR_BG_BLUE_Start 0
-#define GCREG_SRC_COLOR_BG_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregSrcColorFg
-*/
-
-/* In mono expansion defines the source color if the mono pixel is 1. The color
-** must be set in A8R8G8B8.
-*/
-
-#define gcregSrcColorFgRegAddrs 0x0487
-#define GCREG_SRC_COLOR_FG_MSB 15
-#define GCREG_SRC_COLOR_FG_LSB 0
-#define GCREG_SRC_COLOR_FG_BLK 0
-#define GCREG_SRC_COLOR_FG_Count 1
-#define GCREG_SRC_COLOR_FG_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_FG_ReadMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_FG_WriteMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_FG_ResetValue 0x00000000
-
-#define GCREG_SRC_COLOR_FG_ALPHA 31 : 24
-#define GCREG_SRC_COLOR_FG_ALPHA_End 31
-#define GCREG_SRC_COLOR_FG_ALPHA_Start 24
-#define GCREG_SRC_COLOR_FG_ALPHA_Type U08
-
-#define GCREG_SRC_COLOR_FG_RED 23 : 16
-#define GCREG_SRC_COLOR_FG_RED_End 23
-#define GCREG_SRC_COLOR_FG_RED_Start 16
-#define GCREG_SRC_COLOR_FG_RED_Type U08
-
-#define GCREG_SRC_COLOR_FG_GREEN 15 : 8
-#define GCREG_SRC_COLOR_FG_GREEN_End 15
-#define GCREG_SRC_COLOR_FG_GREEN_Start 8
-#define GCREG_SRC_COLOR_FG_GREEN_Type U08
-
-#define GCREG_SRC_COLOR_FG_BLUE 7 : 0
-#define GCREG_SRC_COLOR_FG_BLUE_End 7
-#define GCREG_SRC_COLOR_FG_BLUE_Start 0
-#define GCREG_SRC_COLOR_FG_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregStretchFactorLow
-*/
-
-#define gcregStretchFactorLowRegAddrs 0x0488
-#define GCREG_STRETCH_FACTOR_LOW_MSB 15
-#define GCREG_STRETCH_FACTOR_LOW_LSB 0
-#define GCREG_STRETCH_FACTOR_LOW_BLK 0
-#define GCREG_STRETCH_FACTOR_LOW_Count 1
-#define GCREG_STRETCH_FACTOR_LOW_FieldMask 0x7FFFFFFF
-#define GCREG_STRETCH_FACTOR_LOW_ReadMask 0x7FFFFFFF
-#define GCREG_STRETCH_FACTOR_LOW_WriteMask 0x7FFFFFFF
-#define GCREG_STRETCH_FACTOR_LOW_ResetValue 0x00000000
-
-/* Horizontal stretch factor in 15.16 fixed point format. The value is **
-** calculated using the following formula: factor = ((srcWidth - 1) << 16) / **
-** (dstWidth - 1). Stretch blit uses only the integer part of the value, **
-** while Filter blit uses all 31 bits. */
-#define GCREG_STRETCH_FACTOR_LOW_X 30 : 0
-#define GCREG_STRETCH_FACTOR_LOW_X_End 30
-#define GCREG_STRETCH_FACTOR_LOW_X_Start 0
-#define GCREG_STRETCH_FACTOR_LOW_X_Type U31
-
-/*******************************************************************************
-** State gcregStretchFactorHigh
-*/
-
-#define gcregStretchFactorHighRegAddrs 0x0489
-#define GCREG_STRETCH_FACTOR_HIGH_MSB 15
-#define GCREG_STRETCH_FACTOR_HIGH_LSB 0
-#define GCREG_STRETCH_FACTOR_LOW_HIGH_BLK 0
-#define GCREG_STRETCH_FACTOR_HIGH_Count 1
-#define GCREG_STRETCH_FACTOR_HIGH_FieldMask 0x7FFFFFFF
-#define GCREG_STRETCH_FACTOR_HIGH_ReadMask 0x7FFFFFFF
-#define GCREG_STRETCH_FACTOR_HIGH_WriteMask 0x7FFFFFFF
-#define GCREG_STRETCH_FACTOR_HIGH_ResetValue 0x00000000
-
-/* Vertical stretch factor in 15.16 fixed point format. The value is **
-** calculated using the following formula: factor = ((srcHeight - 1) << 16) / **
-** (dstHeight - 1). Stretch blit uses only the integer part of the value, **
-** while Filter blit uses all 31 bits. */
-#define GCREG_STRETCH_FACTOR_HIGH_Y 30 : 0
-#define GCREG_STRETCH_FACTOR_HIGH_Y_End 30
-#define GCREG_STRETCH_FACTOR_HIGH_Y_Start 0
-#define GCREG_STRETCH_FACTOR_HIGH_Y_Type U31
-
-/*******************************************************************************
-** State gcregDestAddress
-*/
-
-/* 32-bit aligned base address of the destination surface. */
-
-#define gcregDestAddressRegAddrs 0x048A
-#define GCREG_DEST_ADDRESS_MSB 15
-#define GCREG_DEST_ADDRESS_LSB 0
-#define GCREG_DEST_ADDRESS_BLK 0
-#define GCREG_DEST_ADDRESS_Count 1
-#define GCREG_DEST_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_DEST_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_DEST_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_DEST_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_DEST_ADDRESS_ADDRESS 31 : 0
-#define GCREG_DEST_ADDRESS_ADDRESS_End 30
-#define GCREG_DEST_ADDRESS_ADDRESS_Start 0
-#define GCREG_DEST_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregDestStride
-*/
-
-/* Stride of the destination surface in bytes. To calculate the stride
-** multiply the surface width in pixels (8-pixel aligned) by the number of
-** bytes per pixel.
-*/
-
-#define gcregDestStrideRegAddrs 0x048B
-#define GCREG_DEST_STRIDE_MSB 15
-#define GCREG_DEST_STRIDE_LSB 0
-#define GCREG_DEST_STRIDE_BLK 0
-#define GCREG_DEST_STRIDE_Count 1
-#define GCREG_DEST_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_DEST_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_DEST_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_DEST_STRIDE_ResetValue 0x00000000
-
-#define GCREG_DEST_STRIDE_STRIDE 17 : 0
-#define GCREG_DEST_STRIDE_STRIDE_End 17
-#define GCREG_DEST_STRIDE_STRIDE_Start 0
-#define GCREG_DEST_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregDestRotationConfig
-*/
-
-/* 90 degree rotation configuration for the destination surface. Width field
-** specifies the width of the surface in pixels.
-*/
-
-#define gcregDestRotationConfigRegAddrs 0x048C
-#define GCREG_DEST_ROTATION_CONFIG_MSB 15
-#define GCREG_DEST_ROTATION_CONFIG_LSB 0
-#define GCREG_DEST_ROTATION_CONFIG_BLK 0
-#define GCREG_DEST_ROTATION_CONFIG_Count 1
-#define GCREG_DEST_ROTATION_CONFIG_FieldMask 0x0001FFFF
-#define GCREG_DEST_ROTATION_CONFIG_ReadMask 0x0001FFFF
-#define GCREG_DEST_ROTATION_CONFIG_WriteMask 0x0001FFFF
-#define GCREG_DEST_ROTATION_CONFIG_ResetValue 0x00000000
-
-#define GCREG_DEST_ROTATION_CONFIG_WIDTH 15 : 0
-#define GCREG_DEST_ROTATION_CONFIG_WIDTH_End 15
-#define GCREG_DEST_ROTATION_CONFIG_WIDTH_Start 0
-#define GCREG_DEST_ROTATION_CONFIG_WIDTH_Type U16
-
-#define GCREG_DEST_ROTATION_CONFIG_ROTATION 16 : 16
-#define GCREG_DEST_ROTATION_CONFIG_ROTATION_End 16
-#define GCREG_DEST_ROTATION_CONFIG_ROTATION_Start 16
-#define GCREG_DEST_ROTATION_CONFIG_ROTATION_Type U01
-#define GCREG_DEST_ROTATION_CONFIG_ROTATION_DISABLE 0x0
-#define GCREG_DEST_ROTATION_CONFIG_ROTATION_ENABLE 0x1
-
-struct gcregdstrotationconfig {
- /* gcregDestRotationConfigRegAddrs:GCREG_DEST_ROTATION_CONFIG_WIDTH */
- unsigned int surf_width:16;
-
- /* gcregDestRotationConfigRegAddrs:GCREG_DEST_ROTATION_CONFIG_ROTATION*/
- unsigned int enable:1;
-
- /* gcregDestRotationConfigRegAddrs:reserved */
- unsigned int _reserved_17_31:15;
-};
-
-/*******************************************************************************
-** State gcregDestConfig
-*/
-
-/* Destination surface configuration register. */
-
-#define gcregDestConfigRegAddrs 0x048D
-#define GCREG_DEST_CONFIG_MSB 15
-#define GCREG_DEST_CONFIG_LSB 0
-#define GCREG_DEST_CONFIG_BLK 0
-#define GCREG_DEST_CONFIG_Count 1
-#define GCREG_DEST_CONFIG_FieldMask 0x0733F11F
-#define GCREG_DEST_CONFIG_ReadMask 0x0733F11F
-#define GCREG_DEST_CONFIG_WriteMask 0x0733F11F
-#define GCREG_DEST_CONFIG_ResetValue 0x00000000
-
-/* MinorTile. */
-#define GCREG_DEST_CONFIG_MINOR_TILED 26 : 26
-#define GCREG_DEST_CONFIG_MINOR_TILED_End 26
-#define GCREG_DEST_CONFIG_MINOR_TILED_Start 26
-#define GCREG_DEST_CONFIG_MINOR_TILED_Type U01
-#define GCREG_DEST_CONFIG_MINOR_TILED_DISABLED 0x0
-#define GCREG_DEST_CONFIG_MINOR_TILED_ENABLED 0x1
-
-/* Performance fix for de. */
-#define GCREG_DEST_CONFIG_INTER_TILE_PER_FIX 25 : 25
-#define GCREG_DEST_CONFIG_INTER_TILE_PER_FIX_End 25
-#define GCREG_DEST_CONFIG_INTER_TILE_PER_FIX_Start 25
-#define GCREG_DEST_CONFIG_INTER_TILE_PER_FIX_Type U01
-#define GCREG_DEST_CONFIG_INTER_TILE_PER_FIX_DISABLED 0x1
-#define GCREG_DEST_CONFIG_INTER_TILE_PER_FIX_ENABLED 0x0
-
-/* Control GDI Strecth Blit. */
-#define GCREG_DEST_CONFIG_GDI_STRE 24 : 24
-#define GCREG_DEST_CONFIG_GDI_STRE_End 24
-#define GCREG_DEST_CONFIG_GDI_STRE_Start 24
-#define GCREG_DEST_CONFIG_GDI_STRE_Type U01
-#define GCREG_DEST_CONFIG_GDI_STRE_DISABLED 0x0
-#define GCREG_DEST_CONFIG_GDI_STRE_ENABLED 0x1
-
-/* Control destination endianess. */
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL 21 : 20
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL_End 21
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL_Start 20
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL_Type U02
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL_NO_SWAP 0x0
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL_SWAP_WORD 0x1
-#define GCREG_DEST_CONFIG_ENDIAN_CONTROL_SWAP_DWORD 0x2
-
-/* Color channel swizzles. */
-#define GCREG_DEST_CONFIG_SWIZZLE 17 : 16
-#define GCREG_DEST_CONFIG_SWIZZLE_End 17
-#define GCREG_DEST_CONFIG_SWIZZLE_Start 16
-#define GCREG_DEST_CONFIG_SWIZZLE_Type U02
-#define GCREG_DEST_CONFIG_SWIZZLE_ARGB 0x0
-#define GCREG_DEST_CONFIG_SWIZZLE_RGBA 0x1
-#define GCREG_DEST_CONFIG_SWIZZLE_ABGR 0x2
-#define GCREG_DEST_CONFIG_SWIZZLE_BGRA 0x3
-
-/* Determines the type of primitive to be rendered. BIT_BLT_REVERSED and **
-** INVALID_COMMAND values are defined for internal use and should not be **
-** used. */
-#define GCREG_DEST_CONFIG_COMMAND 15 : 12
-#define GCREG_DEST_CONFIG_COMMAND_End 15
-#define GCREG_DEST_CONFIG_COMMAND_Start 12
-#define GCREG_DEST_CONFIG_COMMAND_Type U04
-#define GCREG_DEST_CONFIG_COMMAND_CLEAR 0x0
-#define GCREG_DEST_CONFIG_COMMAND_LINE 0x1
-#define GCREG_DEST_CONFIG_COMMAND_BIT_BLT 0x2
-#define GCREG_DEST_CONFIG_COMMAND_BIT_BLT_REVERSED 0x3
-#define GCREG_DEST_CONFIG_COMMAND_STRETCH_BLT 0x4
-#define GCREG_DEST_CONFIG_COMMAND_HOR_FILTER_BLT 0x5
-#define GCREG_DEST_CONFIG_COMMAND_VER_FILTER_BLT 0x6
-#define GCREG_DEST_CONFIG_COMMAND_ONE_PASS_FILTER_BLT 0x7
-#define GCREG_DEST_CONFIG_COMMAND_MULTI_SOURCE_BLT 0x8
-
-/* Destination linear/tiled address computation control. Reserved field for **
-** future expansion. */
-#define GCREG_DEST_CONFIG_TILED 8 : 8
-#define GCREG_DEST_CONFIG_TILED_End 8
-#define GCREG_DEST_CONFIG_TILED_Start 8
-#define GCREG_DEST_CONFIG_TILED_Type U01
-#define GCREG_DEST_CONFIG_TILED_DISABLED 0x0
-#define GCREG_DEST_CONFIG_TILED_ENABLED 0x1
-
-/* Defines the pixel format of the destination surface. */
-#define GCREG_DEST_CONFIG_FORMAT 4 : 0
-#define GCREG_DEST_CONFIG_FORMAT_End 4
-#define GCREG_DEST_CONFIG_FORMAT_Start 0
-#define GCREG_DEST_CONFIG_FORMAT_Type U05
-#define GCREG_DEST_CONFIG_FORMAT_X4R4G4B4 0x00
-#define GCREG_DEST_CONFIG_FORMAT_A4R4G4B4 0x01
-#define GCREG_DEST_CONFIG_FORMAT_X1R5G5B5 0x02
-#define GCREG_DEST_CONFIG_FORMAT_A1R5G5B5 0x03
-#define GCREG_DEST_CONFIG_FORMAT_R5G6B5 0x04
-#define GCREG_DEST_CONFIG_FORMAT_X8R8G8B8 0x05
-#define GCREG_DEST_CONFIG_FORMAT_A8R8G8B8 0x06
-#define GCREG_DEST_CONFIG_FORMAT_YUY2 0x07
-#define GCREG_DEST_CONFIG_FORMAT_UYVY 0x08
-#define GCREG_DEST_CONFIG_FORMAT_INDEX8 0x09
-#define GCREG_DEST_CONFIG_FORMAT_MONOCHROME 0x0A
-#define GCREG_DEST_CONFIG_FORMAT_YV12 0x0F
-#define GCREG_DEST_CONFIG_FORMAT_A8 0x10
-#define GCREG_DEST_CONFIG_FORMAT_NV12 0x11
-#define GCREG_DEST_CONFIG_FORMAT_NV16 0x12
-#define GCREG_DEST_CONFIG_FORMAT_RG16 0x13
-
-struct gcregdstconfig {
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_FORMAT */
- unsigned int format:5;
-
- /* gcregDestConfigRegAddrs:reserved */
- unsigned int _reserved_5_7:3;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_TILED */
- unsigned int tiled:1;
-
- /* gcregDestConfigRegAddrs:reserved */
- unsigned int _reserved_9_11:3;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_COMMAND */
- unsigned int command:4;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_SWIZZLE */
- unsigned int swizzle:2;
-
- /* gcregDestConfigRegAddrs:reserved */
- unsigned int _reserved_18_19:2;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_ENDIAN_CONTROL */
- unsigned int endian:2;
-
- /* gcregDestConfigRegAddrs:reserved */
- unsigned int _reserved_22_23:2;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_GDI_STRE */
- unsigned int gdi:1;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_INTER_TILE_PER_FIX */
- unsigned int inner_tile_fix:1;
-
- /* gcregDestConfigRegAddrs:GCREG_DEST_CONFIG_MINOR_TILED */
- unsigned int minor_tile:1;
-
- /* gcregDestConfigRegAddrs:reserved */
- unsigned int _reserved_27_31:5;
-};
-
-/*******************************************************************************
-** State gcregFilterKernel
-*/
-
-/* Filter blit coefficient table. The algorithm uses 5 bits of pixel
-** coordinate's fraction to index the kernel array, which makes it a 32-entry
-** array. Each entry consists of 9 kernel values. In practice we store only a
-** half of the table, because the other half is a mirror of the first,
-** therefore:
-** rows_to_store = 32 / 2 + 1 = 17
-** values_to_store = rows_to_store * 9 = 153
-** even_value_count = (values_to_store + 1) & ~1 = 154
-** dword_count = even_value_count / 2 = 77
-*/
-
-#define gcregFilterKernelRegAddrs 0x0600
-#define GCREG_FILTER_KERNEL_MSB 15
-#define GCREG_FILTER_KERNEL_LSB 7
-#define GCREG_FILTER_KERNEL_BLK 7
-#define GCREG_FILTER_KERNEL_Count 128
-#define GCREG_FILTER_KERNEL_FieldMask 0xFFFFFFFF
-#define GCREG_FILTER_KERNEL_ReadMask 0xFFFFFFFF
-#define GCREG_FILTER_KERNEL_WriteMask 0xFFFFFFFF
-#define GCREG_FILTER_KERNEL_ResetValue 0x00000000
-
-#define GCREG_FILTER_KERNEL_COEFFICIENT0 15 : 0
-#define GCREG_FILTER_KERNEL_COEFFICIENT0_End 15
-#define GCREG_FILTER_KERNEL_COEFFICIENT0_Start 0
-#define GCREG_FILTER_KERNEL_COEFFICIENT0_Type U16
-
-#define GCREG_FILTER_KERNEL_COEFFICIENT1 31 : 16
-#define GCREG_FILTER_KERNEL_COEFFICIENT1_End 31
-#define GCREG_FILTER_KERNEL_COEFFICIENT1_Start 16
-#define GCREG_FILTER_KERNEL_COEFFICIENT1_Type U16
-
-struct gcregfilterkernelpair {
- /* gcregFilterKernelRegAddrs:COEFFICIENT0 */
- unsigned int coeff0:16;
-
- /* gcregFilterKernelRegAddrs:COEFFICIENT1 */
- unsigned int coeff1:16;
-};
-
-struct gcregfilterkernel {
- struct gcregfilterkernelpair filter[77];
-};
-
-/*******************************************************************************
-** State gcregHoriFilterKernel
-*/
-
-/* One Pass filter Filter blit hori coefficient table. */
-
-#define gcregHoriFilterKernelRegAddrs 0x0A00
-#define GCREG_HORI_FILTER_KERNEL_MSB 15
-#define GCREG_HORI_FILTER_KERNEL_LSB 7
-#define GCREG_HORI_FILTER_KERNEL_BLK 7
-#define GCREG_HORI_FILTER_KERNEL_Count 128
-#define GCREG_HORI_FILTER_KERNEL_FieldMask 0xFFFFFFFF
-#define GCREG_HORI_FILTER_KERNEL_ReadMask 0xFFFFFFFF
-#define GCREG_HORI_FILTER_KERNEL_WriteMask 0xFFFFFFFF
-#define GCREG_HORI_FILTER_KERNEL_ResetValue 0x00000000
-
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT0 15 : 0
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT0_End 15
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT0_Start 0
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT0_Type U16
-
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT1 31 : 16
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT1_End 31
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT1_Start 16
-#define GCREG_HORI_FILTER_KERNEL_COEFFICIENT1_Type U16
-
-/*******************************************************************************
-** State gcregVertiFilterKernel
-*/
-
-/* One Pass Filter blit vertical coefficient table. */
-
-#define gcregVertiFilterKernelRegAddrs 0x0A80
-#define GCREG_VERTI_FILTER_KERNEL_MSB 15
-#define GCREG_VERTI_FILTER_KERNEL_LSB 7
-#define GCREG_VERTI_FILTER_KERNEL_BLK 7
-#define GCREG_VERTI_FILTER_KERNEL_Count 128
-#define GCREG_VERTI_FILTER_KERNEL_FieldMask 0xFFFFFFFF
-#define GCREG_VERTI_FILTER_KERNEL_ReadMask 0xFFFFFFFF
-#define GCREG_VERTI_FILTER_KERNEL_WriteMask 0xFFFFFFFF
-#define GCREG_VERTI_FILTER_KERNEL_ResetValue 0x00000000
-
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT0 15 : 0
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT0_End 15
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT0_Start 0
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT0_Type U16
-
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT1 31 : 16
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT1_End 31
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT1_Start 16
-#define GCREG_VERTI_FILTER_KERNEL_COEFFICIENT1_Type U16
-
-/*******************************************************************************
-** State gcregVRConfig
-*/
-
-/* Video Rasterizer kick-off register. */
-
-#define gcregVRConfigRegAddrs 0x04A5
-#define GCREG_VR_CONFIG_MSB 15
-#define GCREG_VR_CONFIG_LSB 0
-#define GCREG_VR_CONFIG_BLK 0
-#define GCREG_VR_CONFIG_Count 1
-#define GCREG_VR_CONFIG_FieldMask 0x0000000B
-#define GCREG_VR_CONFIG_ReadMask 0x0000000B
-#define GCREG_VR_CONFIG_WriteMask 0x0000000B
-#define GCREG_VR_CONFIG_ResetValue 0x00000000
-
-/* Kick-off command. */
-#define GCREG_VR_CONFIG_START 1 : 0
-#define GCREG_VR_CONFIG_START_End 1
-#define GCREG_VR_CONFIG_START_Start 0
-#define GCREG_VR_CONFIG_START_Type U02
-#define GCREG_VR_CONFIG_START_HORIZONTAL_BLIT 0x0
-#define GCREG_VR_CONFIG_START_VERTICAL_BLIT 0x1
-#define GCREG_VR_CONFIG_START_ONE_PASS_BLIT 0x2
-
-#define GCREG_VR_CONFIG_MASK_START 3 : 3
-#define GCREG_VR_CONFIG_MASK_START_End 3
-#define GCREG_VR_CONFIG_MASK_START_Start 3
-#define GCREG_VR_CONFIG_MASK_START_Type U01
-#define GCREG_VR_CONFIG_MASK_START_ENABLED 0x0
-#define GCREG_VR_CONFIG_MASK_START_MASKED 0x1
-
-struct gcregvrconfig {
- /* gcregVRConfigRegAddrs:START */
- unsigned int start:2;
-
- /* gcregVRConfigRegAddrs:reserved */
- unsigned int _reserved_2:1;
-
- /* gcregVRConfigRegAddrs:MASK_START */
- unsigned int start_mask:1;
-
- /* gcregVRConfigRegAddrs:reserved */
- unsigned int _reserved_4_31:28;
-};
-
-static const struct gcregvrconfig gcregvrconfig_horizontal = {
- /* gcregVRConfigRegAddrs:START */
- GCREG_VR_CONFIG_START_HORIZONTAL_BLIT,
-
- /* gcregVRConfigRegAddrs:reserved */
- 0,
-
- /* gcregVRConfigRegAddrs:MASK_START */
- GCREG_VR_CONFIG_MASK_START_ENABLED,
-
- /* gcregVRConfigRegAddrs:reserved */
- 0
-};
-
-static const struct gcregvrconfig gcregvrconfig_vertical = {
- /* gcregVRConfigRegAddrs:START */
- GCREG_VR_CONFIG_START_VERTICAL_BLIT,
-
- /* gcregVRConfigRegAddrs:reserved */
- 0,
-
- /* gcregVRConfigRegAddrs:MASK_START */
- GCREG_VR_CONFIG_MASK_START_ENABLED,
-
- /* gcregVRConfigRegAddrs:reserved */
- 0
-};
-
-static const struct gcregvrconfig gcregvrconfig_onepass = {
- /* gcregVRConfigRegAddrs:START */
- GCREG_VR_CONFIG_START_ONE_PASS_BLIT,
-
- /* gcregVRConfigRegAddrs:reserved */
- 0,
-
- /* gcregVRConfigRegAddrs:MASK_START */
- GCREG_VR_CONFIG_MASK_START_ENABLED,
-
- /* gcregVRConfigRegAddrs:reserved */
- 0
-};
-
-/*******************************************************************************
-** State gcregVRSourceImageLow
-*/
-
-/* Bounding box of the source image. */
-
-#define gcregVRSourceImageLowRegAddrs 0x04A6
-#define GCREG_VR_SOURCE_IMAGE_LOW_Address 0x01298
-#define GCREG_VR_SOURCE_IMAGE_LOW_MSB 15
-#define GCREG_VR_SOURCE_IMAGE_LOW_LSB 0
-#define GCREG_VR_SOURCE_IMAGE_LOW_BLK 0
-#define GCREG_VR_SOURCE_IMAGE_LOW_Count 1
-#define GCREG_VR_SOURCE_IMAGE_LOW_FieldMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_IMAGE_LOW_ReadMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_IMAGE_LOW_WriteMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_IMAGE_LOW_ResetValue 0x00000000
-
-#define GCREG_VR_SOURCE_IMAGE_LOW_LEFT 15 : 0
-#define GCREG_VR_SOURCE_IMAGE_LOW_LEFT_End 15
-#define GCREG_VR_SOURCE_IMAGE_LOW_LEFT_Start 0
-#define GCREG_VR_SOURCE_IMAGE_LOW_LEFT_Type U16
-
-#define GCREG_VR_SOURCE_IMAGE_LOW_TOP 31 : 16
-#define GCREG_VR_SOURCE_IMAGE_LOW_TOP_End 31
-#define GCREG_VR_SOURCE_IMAGE_LOW_TOP_Start 16
-#define GCREG_VR_SOURCE_IMAGE_LOW_TOP_Type U16
-
-struct gcregvrsourceimagelow {
- /* gcregVRSourceImageLowRegAddrs:LEFT */
- unsigned int left:16;
-
- /* gcregVRSourceImageLowRegAddrs:TOP */
- unsigned int top:16;
-};
-
-/*******************************************************************************
-** State gcregVRSourceImageHigh
-*/
-
-#define gcregVRSourceImageHighRegAddrs 0x04A7
-#define GCREG_VR_SOURCE_IMAGE_HIGH_MSB 15
-#define GCREG_VR_SOURCE_IMAGE_HIGH_LSB 0
-#define GCREG_VR_SOURCE_IMAGE_LOW_HIGH_BLK 0
-#define GCREG_VR_SOURCE_IMAGE_HIGH_Count 1
-#define GCREG_VR_SOURCE_IMAGE_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_IMAGE_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_IMAGE_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_IMAGE_HIGH_ResetValue 0x00000000
-
-#define GCREG_VR_SOURCE_IMAGE_HIGH_RIGHT 15 : 0
-#define GCREG_VR_SOURCE_IMAGE_HIGH_RIGHT_End 15
-#define GCREG_VR_SOURCE_IMAGE_HIGH_RIGHT_Start 0
-#define GCREG_VR_SOURCE_IMAGE_HIGH_RIGHT_Type U16
-
-#define GCREG_VR_SOURCE_IMAGE_HIGH_BOTTOM 31 : 16
-#define GCREG_VR_SOURCE_IMAGE_HIGH_BOTTOM_End 31
-#define GCREG_VR_SOURCE_IMAGE_HIGH_BOTTOM_Start 16
-#define GCREG_VR_SOURCE_IMAGE_HIGH_BOTTOM_Type U16
-
-struct gcregvrsourceimagehigh {
- /* gcregVRSourceImageHighRegAddrs:RIGHT */
- unsigned int right:16;
-
- /* gcregVRSourceImageHighRegAddrs:BOTTOM */
- unsigned int bottom:16;
-};
-
-/*******************************************************************************
-** State gcregVRSourceOriginLow
-*/
-
-/* Fractional origin of the source window to be rendered within the source
-** image.
-*/
-
-#define gcregVRSourceOriginLowRegAddrs 0x04A8
-#define GCREG_VR_SOURCE_ORIGIN_LOW_MSB 15
-#define GCREG_VR_SOURCE_ORIGIN_LOW_LSB 0
-#define GCREG_VR_SOURCE_ORIGIN_LOW_BLK 0
-#define GCREG_VR_SOURCE_ORIGIN_LOW_Count 1
-#define GCREG_VR_SOURCE_ORIGIN_LOW_FieldMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_ORIGIN_LOW_ReadMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_ORIGIN_LOW_WriteMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_ORIGIN_LOW_ResetValue 0x00000000
-
-#define GCREG_VR_SOURCE_ORIGIN_LOW_X 31 : 0
-#define GCREG_VR_SOURCE_ORIGIN_LOW_X_End 31
-#define GCREG_VR_SOURCE_ORIGIN_LOW_X_Start 0
-#define GCREG_VR_SOURCE_ORIGIN_LOW_X_Type U32
-
-/*******************************************************************************
-** State gcregVRSourceOriginHigh
-*/
-
-#define gcregVRSourceOriginHighRegAddrs 0x04A9
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_MSB 15
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_LSB 0
-#define GCREG_VR_SOURCE_ORIGIN_LOW_HIGH_BLK 0
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_Count 1
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_ResetValue 0x00000000
-
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_Y 31 : 0
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_Y_End 31
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_Y_Start 0
-#define GCREG_VR_SOURCE_ORIGIN_HIGH_Y_Type U32
-
-/*******************************************************************************
-** State gcregVRTargetWindowLow
-*/
-
-/* Bounding box of the destination window to be rendered within the
-** destination image.
-*/
-
-#define gcregVRTargetWindowLowRegAddrs 0x04AA
-#define GCREG_VR_TARGET_WINDOW_LOW_Address 0x012A8
-#define GCREG_VR_TARGET_WINDOW_LOW_MSB 15
-#define GCREG_VR_TARGET_WINDOW_LOW_LSB 0
-#define GCREG_VR_TARGET_WINDOW_LOW_BLK 0
-#define GCREG_VR_TARGET_WINDOW_LOW_Count 1
-#define GCREG_VR_TARGET_WINDOW_LOW_FieldMask 0xFFFFFFFF
-#define GCREG_VR_TARGET_WINDOW_LOW_ReadMask 0xFFFFFFFF
-#define GCREG_VR_TARGET_WINDOW_LOW_WriteMask 0xFFFFFFFF
-#define GCREG_VR_TARGET_WINDOW_LOW_ResetValue 0x00000000
-
-#define GCREG_VR_TARGET_WINDOW_LOW_LEFT 15 : 0
-#define GCREG_VR_TARGET_WINDOW_LOW_LEFT_End 15
-#define GCREG_VR_TARGET_WINDOW_LOW_LEFT_Start 0
-#define GCREG_VR_TARGET_WINDOW_LOW_LEFT_Type U16
-
-#define GCREG_VR_TARGET_WINDOW_LOW_TOP 31 : 16
-#define GCREG_VR_TARGET_WINDOW_LOW_TOP_End 31
-#define GCREG_VR_TARGET_WINDOW_LOW_TOP_Start 16
-#define GCREG_VR_TARGET_WINDOW_LOW_TOP_Type U16
-
-struct gcregvrtargetwindowlow {
- /* gcregVRTargetWindowLowRegAddrs:LEFT */
- unsigned int left:16;
-
- /* gcregVRTargetWindowLowRegAddrs:TOP */
- unsigned int top:16;
-};
-
-/*******************************************************************************
-** State gcregVRTargetWindowHigh
-*/
-
-#define gcregVRTargetWindowHighRegAddrs 0x04AB
-#define GCREG_VR_TARGET_WINDOW_HIGH_MSB 15
-#define GCREG_VR_TARGET_WINDOW_HIGH_LSB 0
-#define GCREG_VR_TARGET_WINDOW_LOW_HIGH_BLK 0
-#define GCREG_VR_TARGET_WINDOW_HIGH_Count 1
-#define GCREG_VR_TARGET_WINDOW_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_VR_TARGET_WINDOW_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_VR_TARGET_WINDOW_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_VR_TARGET_WINDOW_HIGH_ResetValue 0x00000000
-
-#define GCREG_VR_TARGET_WINDOW_HIGH_RIGHT 15 : 0
-#define GCREG_VR_TARGET_WINDOW_HIGH_RIGHT_End 15
-#define GCREG_VR_TARGET_WINDOW_HIGH_RIGHT_Start 0
-#define GCREG_VR_TARGET_WINDOW_HIGH_RIGHT_Type U16
-
-#define GCREG_VR_TARGET_WINDOW_HIGH_BOTTOM 31 : 16
-#define GCREG_VR_TARGET_WINDOW_HIGH_BOTTOM_End 31
-#define GCREG_VR_TARGET_WINDOW_HIGH_BOTTOM_Start 16
-#define GCREG_VR_TARGET_WINDOW_HIGH_BOTTOM_Type U16
-
-struct gcregvrtargetwindowhigh {
- /* gcregVRTargetWindowHighRegAddrs:LEFT */
- unsigned int right:16;
-
- /* gcregVRTargetWindowHighRegAddrs:TOP */
- unsigned int bottom:16;
-};
-
-/*******************************************************************************
-** State gcregVRConfigEx
-*/
-
-/* Video Rasterizer configuration register. */
-
-#define gcregVRConfigExRegAddrs 0x04B9
-#define GCREG_VR_CONFIG_EX_Address 0x012E4
-#define GCREG_VR_CONFIG_EX_MSB 15
-#define GCREG_VR_CONFIG_EX_LSB 0
-#define GCREG_VR_CONFIG_EX_BLK 0
-#define GCREG_VR_CONFIG_EX_Count 1
-#define GCREG_VR_CONFIG_EX_FieldMask 0x000001FB
-#define GCREG_VR_CONFIG_EX_ReadMask 0x000001FB
-#define GCREG_VR_CONFIG_EX_WriteMask 0x000001FB
-#define GCREG_VR_CONFIG_EX_ResetValue 0x00000000
-
-/* Line width in pixels for vertical pass. */
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH 1 : 0
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH_End 1
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH_Start 0
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH_Type U02
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH_AUTO 0x0
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH_PIXELS16 0x1
-#define GCREG_VR_CONFIG_EX_VERTICAL_LINE_WIDTH_PIXELS32 0x2
-
-#define GCREG_VR_CONFIG_EX_MASK_VERTICAL_LINE_WIDTH 3 : 3
-#define GCREG_VR_CONFIG_EX_MASK_VERTICAL_LINE_WIDTH_End 3
-#define GCREG_VR_CONFIG_EX_MASK_VERTICAL_LINE_WIDTH_Start 3
-#define GCREG_VR_CONFIG_EX_MASK_VERTICAL_LINE_WIDTH_Type U01
-#define GCREG_VR_CONFIG_EX_MASK_VERTICAL_LINE_WIDTH_ENABLED 0x0
-#define GCREG_VR_CONFIG_EX_MASK_VERTICAL_LINE_WIDTH_MASKED 0x1
-
-/* one pass filter tap. */
-#define GCREG_VR_CONFIG_EX_FILTER_TAP 7 : 4
-#define GCREG_VR_CONFIG_EX_FILTER_TAP_End 7
-#define GCREG_VR_CONFIG_EX_FILTER_TAP_Start 4
-#define GCREG_VR_CONFIG_EX_FILTER_TAP_Type U04
-
-#define GCREG_VR_CONFIG_EX_MASK_FILTER_TAP 8 : 8
-#define GCREG_VR_CONFIG_EX_MASK_FILTER_TAP_End 8
-#define GCREG_VR_CONFIG_EX_MASK_FILTER_TAP_Start 8
-#define GCREG_VR_CONFIG_EX_MASK_FILTER_TAP_Type U01
-#define GCREG_VR_CONFIG_EX_MASK_FILTER_TAP_ENABLED 0x0
-#define GCREG_VR_CONFIG_EX_MASK_FILTER_TAP_MASKED 0x1
-
-struct gcregvrconfigex {
- /* gcregVRConfigExRegAddrs:VERTICAL_LINE_WIDTH */
- unsigned int stripe:2;
-
- /* gcregVRConfigExRegAddrs:reserved */
- unsigned int _reserved_2:1;
-
- /* gcregVRConfigExRegAddrs:MASK_VERTICAL_LINE_WIDTH */
- unsigned int mask_stripe:1;
-
- /* gcregVRConfigExRegAddrs:FILTER_TAP */
- unsigned int kernelsize:4;
-
- /* gcregVRConfigExRegAddrs:MASK_FILTER_TAP */
- unsigned int mask_kernelsize:1;
-
- /* gcregVRConfigExRegAddrs:reserved */
- unsigned int _reserved_9_31:23;
-};
-
-/*******************************************************************************
-** State gcregBWConfig
-*/
-
-#define gcregBWConfigRegAddrs 0x04BC
-#define GCREG_BW_CONFIG_MSB 15
-#define GCREG_BW_CONFIG_LSB 0
-#define GCREG_BW_CONFIG_BLK 0
-#define GCREG_BW_CONFIG_Count 1
-#define GCREG_BW_CONFIG_FieldMask 0x00009999
-#define GCREG_BW_CONFIG_ReadMask 0x00009999
-#define GCREG_BW_CONFIG_WriteMask 0x00009999
-#define GCREG_BW_CONFIG_ResetValue 0x00000000
-
-/* One Pass Filter Block Config. */
-#define GCREG_BW_CONFIG_BLOCK_CONFIG 0 : 0
-#define GCREG_BW_CONFIG_BLOCK_CONFIG_End 0
-#define GCREG_BW_CONFIG_BLOCK_CONFIG_Start 0
-#define GCREG_BW_CONFIG_BLOCK_CONFIG_Type U01
-#define GCREG_BW_CONFIG_BLOCK_CONFIG_AUTO 0x0
-#define GCREG_BW_CONFIG_BLOCK_CONFIG_CUSTOMIZE 0x1
-
-#define GCREG_BW_CONFIG_MASK_BLOCK_CONFIG 3 : 3
-#define GCREG_BW_CONFIG_MASK_BLOCK_CONFIG_End 3
-#define GCREG_BW_CONFIG_MASK_BLOCK_CONFIG_Start 3
-#define GCREG_BW_CONFIG_MASK_BLOCK_CONFIG_Type U01
-#define GCREG_BW_CONFIG_MASK_BLOCK_CONFIG_ENABLED 0x0
-#define GCREG_BW_CONFIG_MASK_BLOCK_CONFIG_MASKED 0x1
-
-/* block walk direction in one pass filter blit. */
-#define GCREG_BW_CONFIG_BLOCK_WALK_DIRECTION 4 : 4
-#define GCREG_BW_CONFIG_BLOCK_WALK_DIRECTION_End 4
-#define GCREG_BW_CONFIG_BLOCK_WALK_DIRECTION_Start 4
-#define GCREG_BW_CONFIG_BLOCK_WALK_DIRECTION_Type U01
-#define GCREG_BW_CONFIG_BLOCK_WALK_DIRECTION_RIGHT_BOTTOM 0x0
-#define GCREG_BW_CONFIG_BLOCK_WALK_DIRECTION_BOTTOM_RIGHT 0x1
-
-#define GCREG_BW_CONFIG_MASK_BLOCK_WALK_DIRECTION 7 : 7
-#define GCREG_BW_CONFIG_MASK_BLOCK_WALK_DIRECTION_End 7
-#define GCREG_BW_CONFIG_MASK_BLOCK_WALK_DIRECTION_Start 7
-#define GCREG_BW_CONFIG_MASK_BLOCK_WALK_DIRECTION_Type U01
-#define GCREG_BW_CONFIG_MASK_BLOCK_WALK_DIRECTION_ENABLED 0x0
-#define GCREG_BW_CONFIG_MASK_BLOCK_WALK_DIRECTION_MASKED 0x1
-
-/* block walk direction in one pass filter blit. */
-#define GCREG_BW_CONFIG_TILE_WALK_DIRECTION 8 : 8
-#define GCREG_BW_CONFIG_TILE_WALK_DIRECTION_End 8
-#define GCREG_BW_CONFIG_TILE_WALK_DIRECTION_Start 8
-#define GCREG_BW_CONFIG_TILE_WALK_DIRECTION_Type U01
-#define GCREG_BW_CONFIG_TILE_WALK_DIRECTION_RIGHT_BOTTOM 0x0
-#define GCREG_BW_CONFIG_TILE_WALK_DIRECTION_BOTTOM_RIGHT 0x1
-
-#define GCREG_BW_CONFIG_MASK_TILE_WALK_DIRECTION 11 : 11
-#define GCREG_BW_CONFIG_MASK_TILE_WALK_DIRECTION_End 11
-#define GCREG_BW_CONFIG_MASK_TILE_WALK_DIRECTION_Start 11
-#define GCREG_BW_CONFIG_MASK_TILE_WALK_DIRECTION_Type U01
-#define GCREG_BW_CONFIG_MASK_TILE_WALK_DIRECTION_ENABLED 0x0
-#define GCREG_BW_CONFIG_MASK_TILE_WALK_DIRECTION_MASKED 0x1
-
-/* block walk direction in one pass filter blit. */
-#define GCREG_BW_CONFIG_PIXEL_WALK_DIRECTION 12 : 12
-#define GCREG_BW_CONFIG_PIXEL_WALK_DIRECTION_End 12
-#define GCREG_BW_CONFIG_PIXEL_WALK_DIRECTION_Start 12
-#define GCREG_BW_CONFIG_PIXEL_WALK_DIRECTION_Type U01
-#define GCREG_BW_CONFIG_PIXEL_WALK_DIRECTION_RIGHT_BOTTOM 0x0
-#define GCREG_BW_CONFIG_PIXEL_WALK_DIRECTION_BOTTOM_RIGHT 0x1
-
-#define GCREG_BW_CONFIG_MASK_PIXEL_WALK_DIRECTION 15 : 15
-#define GCREG_BW_CONFIG_MASK_PIXEL_WALK_DIRECTION_End 15
-#define GCREG_BW_CONFIG_MASK_PIXEL_WALK_DIRECTION_Start 15
-#define GCREG_BW_CONFIG_MASK_PIXEL_WALK_DIRECTION_Type U01
-#define GCREG_BW_CONFIG_MASK_PIXEL_WALK_DIRECTION_ENABLED 0x0
-#define GCREG_BW_CONFIG_MASK_PIXEL_WALK_DIRECTION_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBWBlockSize
-*/
-
-/* Walker Block size. */
-
-#define gcregBWBlockSizeRegAddrs 0x04BD
-#define GCREG_BW_BLOCK_SIZE_MSB 15
-#define GCREG_BW_BLOCK_SIZE_LSB 0
-#define GCREG_BW_BLOCK_SIZE_BLK 0
-#define GCREG_BW_BLOCK_SIZE_Count 1
-#define GCREG_BW_BLOCK_SIZE_FieldMask 0xFFFFFFFF
-#define GCREG_BW_BLOCK_SIZE_ReadMask 0xFFFFFFFF
-#define GCREG_BW_BLOCK_SIZE_WriteMask 0xFFFFFFFF
-#define GCREG_BW_BLOCK_SIZE_ResetValue 0x00000000
-
-#define GCREG_BW_BLOCK_SIZE_WIDTH 15 : 0
-#define GCREG_BW_BLOCK_SIZE_WIDTH_End 15
-#define GCREG_BW_BLOCK_SIZE_WIDTH_Start 0
-#define GCREG_BW_BLOCK_SIZE_WIDTH_Type U16
-
-#define GCREG_BW_BLOCK_SIZE_HEIGHT 31 : 16
-#define GCREG_BW_BLOCK_SIZE_HEIGHT_End 31
-#define GCREG_BW_BLOCK_SIZE_HEIGHT_Start 16
-#define GCREG_BW_BLOCK_SIZE_HEIGHT_Type U16
-
-/*******************************************************************************
-** State gcregBWTileSize
-*/
-
-/* Walker tile size. */
-
-#define gcregBWTileSizeRegAddrs 0x04BE
-#define GCREG_BW_TILE_SIZE_MSB 15
-#define GCREG_BW_TILE_SIZE_LSB 0
-#define GCREG_BW_TILE_SIZE_BLK 0
-#define GCREG_BW_TILE_SIZE_Count 1
-#define GCREG_BW_TILE_SIZE_FieldMask 0xFFFFFFFF
-#define GCREG_BW_TILE_SIZE_ReadMask 0xFFFFFFFF
-#define GCREG_BW_TILE_SIZE_WriteMask 0xFFFFFFFF
-#define GCREG_BW_TILE_SIZE_ResetValue 0x00000000
-
-#define GCREG_BW_TILE_SIZE_WIDTH 15 : 0
-#define GCREG_BW_TILE_SIZE_WIDTH_End 15
-#define GCREG_BW_TILE_SIZE_WIDTH_Start 0
-#define GCREG_BW_TILE_SIZE_WIDTH_Type U16
-
-#define GCREG_BW_TILE_SIZE_HEIGHT 31 : 16
-#define GCREG_BW_TILE_SIZE_HEIGHT_End 31
-#define GCREG_BW_TILE_SIZE_HEIGHT_Start 16
-#define GCREG_BW_TILE_SIZE_HEIGHT_Type U16
-
-/*******************************************************************************
-** State gcregBWBlockMask
-*/
-
-/* Walker Block Mask. */
-
-#define gcregBWBlockMaskRegAddrs 0x04BF
-#define GCREG_BW_BLOCK_MASK_MSB 15
-#define GCREG_BW_BLOCK_MASK_LSB 0
-#define GCREG_BW_BLOCK_MASK_BLK 0
-#define GCREG_BW_BLOCK_MASK_Count 1
-#define GCREG_BW_BLOCK_MASK_FieldMask 0xFFFFFFFF
-#define GCREG_BW_BLOCK_MASK_ReadMask 0xFFFFFFFF
-#define GCREG_BW_BLOCK_MASK_WriteMask 0xFFFFFFFF
-#define GCREG_BW_BLOCK_MASK_ResetValue 0x00000000
-
-#define GCREG_BW_BLOCK_MASK_HORIZONTAL 15 : 0
-#define GCREG_BW_BLOCK_MASK_HORIZONTAL_End 15
-#define GCREG_BW_BLOCK_MASK_HORIZONTAL_Start 0
-#define GCREG_BW_BLOCK_MASK_HORIZONTAL_Type U16
-
-#define GCREG_BW_BLOCK_MASK_VERTICAL 31 : 16
-#define GCREG_BW_BLOCK_MASK_VERTICAL_End 31
-#define GCREG_BW_BLOCK_MASK_VERTICAL_Start 16
-#define GCREG_BW_BLOCK_MASK_VERTICAL_Type U16
-
-/*******************************************************************************
-** State gcregIndexColorTable
-*/
-
-/* 256 color entries for the indexed color mode. Colors are assumed to be in
-** the destination format and no color conversion is done on the values.
-*/
-
-#define gcregIndexColorTableRegAddrs 0x0700
-#define GCREG_INDEX_COLOR_TABLE_MSB 15
-#define GCREG_INDEX_COLOR_TABLE_LSB 8
-#define GCREG_INDEX_COLOR_TABLE_BLK 8
-#define GCREG_INDEX_COLOR_TABLE_Count 256
-#define GCREG_INDEX_COLOR_TABLE_FieldMask 0xFFFFFFFF
-#define GCREG_INDEX_COLOR_TABLE_ReadMask 0xFFFFFFFF
-#define GCREG_INDEX_COLOR_TABLE_WriteMask 0xFFFFFFFF
-#define GCREG_INDEX_COLOR_TABLE_ResetValue 0x00000000
-
-#define GCREG_INDEX_COLOR_TABLE_ALPHA 31 : 24
-#define GCREG_INDEX_COLOR_TABLE_ALPHA_End 31
-#define GCREG_INDEX_COLOR_TABLE_ALPHA_Start 24
-#define GCREG_INDEX_COLOR_TABLE_ALPHA_Type U08
-
-#define GCREG_INDEX_COLOR_TABLE_RED 23 : 16
-#define GCREG_INDEX_COLOR_TABLE_RED_End 23
-#define GCREG_INDEX_COLOR_TABLE_RED_Start 16
-#define GCREG_INDEX_COLOR_TABLE_RED_Type U08
-
-#define GCREG_INDEX_COLOR_TABLE_GREEN 15 : 8
-#define GCREG_INDEX_COLOR_TABLE_GREEN_End 15
-#define GCREG_INDEX_COLOR_TABLE_GREEN_Start 8
-#define GCREG_INDEX_COLOR_TABLE_GREEN_Type U08
-
-#define GCREG_INDEX_COLOR_TABLE_BLUE 7 : 0
-#define GCREG_INDEX_COLOR_TABLE_BLUE_End 7
-#define GCREG_INDEX_COLOR_TABLE_BLUE_Start 0
-#define GCREG_INDEX_COLOR_TABLE_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregIndexColorTable32
-*/
-
-/* 256 color entries for the indexed color mode. Colors are assumed to be in
-** the A8R8G8B8 format and no color conversion is done on the values. This
-** register is used only with chips with PE20 feature available.
-*/
-
-#define gcregIndexColorTable32RegAddrs 0x0D00
-#define GCREG_INDEX_COLOR_TABLE32_MSB 15
-#define GCREG_INDEX_COLOR_TABLE32_LSB 8
-#define GCREG_INDEX_COLOR_TABLE32_BLK 8
-#define GCREG_INDEX_COLOR_TABLE32_Count 256
-#define GCREG_INDEX_COLOR_TABLE32_FieldMask 0xFFFFFFFF
-#define GCREG_INDEX_COLOR_TABLE32_ReadMask 0xFFFFFFFF
-#define GCREG_INDEX_COLOR_TABLE32_WriteMask 0xFFFFFFFF
-#define GCREG_INDEX_COLOR_TABLE32_ResetValue 0x00000000
-
-#define GCREG_INDEX_COLOR_TABLE32_ALPHA 31 : 24
-#define GCREG_INDEX_COLOR_TABLE32_ALPHA_End 31
-#define GCREG_INDEX_COLOR_TABLE32_ALPHA_Start 24
-#define GCREG_INDEX_COLOR_TABLE32_ALPHA_Type U08
-
-#define GCREG_INDEX_COLOR_TABLE32_RED 23 : 16
-#define GCREG_INDEX_COLOR_TABLE32_RED_End 23
-#define GCREG_INDEX_COLOR_TABLE32_RED_Start 16
-#define GCREG_INDEX_COLOR_TABLE32_RED_Type U08
-
-#define GCREG_INDEX_COLOR_TABLE32_GREEN 15 : 8
-#define GCREG_INDEX_COLOR_TABLE32_GREEN_End 15
-#define GCREG_INDEX_COLOR_TABLE32_GREEN_Start 8
-#define GCREG_INDEX_COLOR_TABLE32_GREEN_Type U08
-
-#define GCREG_INDEX_COLOR_TABLE32_BLUE 7 : 0
-#define GCREG_INDEX_COLOR_TABLE32_BLUE_End 7
-#define GCREG_INDEX_COLOR_TABLE32_BLUE_Start 0
-#define GCREG_INDEX_COLOR_TABLE32_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregRop
-*/
-
-/* Raster operation foreground and background codes. Even though ROP is not
-** used in CLEAR, HOR_FILTER_BLT, VER_FILTER_BLT and alpha-eanbled BIT_BLTs,
-** ROP code still has to be programmed, because the engine makes the decision
-** whether source, destination and pattern are involved in the current
-** operation and the correct decision is essential for the engine to complete
-** the operation as expected.
-*/
-
-#define gcregRopRegAddrs 0x0497
-#define GCREG_ROP_MSB 15
-#define GCREG_ROP_LSB 0
-#define GCREG_ROP_BLK 0
-#define GCREG_ROP_Count 1
-#define GCREG_ROP_FieldMask 0x0030FFFF
-#define GCREG_ROP_ReadMask 0x0030FFFF
-#define GCREG_ROP_WriteMask 0x0030FFFF
-#define GCREG_ROP_ResetValue 0x00000000
-
-/* ROP type: ROP2, ROP3 or ROP4 */
-#define GCREG_ROP_TYPE 21 : 20
-#define GCREG_ROP_TYPE_End 21
-#define GCREG_ROP_TYPE_Start 20
-#define GCREG_ROP_TYPE_Type U02
-#define GCREG_ROP_TYPE_ROP2_PATTERN 0x0
-#define GCREG_ROP_TYPE_ROP2_SOURCE 0x1
-#define GCREG_ROP_TYPE_ROP3 0x2
-#define GCREG_ROP_TYPE_ROP4 0x3
-
-/* Background ROP code is used for transparent pixels. */
-#define GCREG_ROP_ROP_BG 15 : 8
-#define GCREG_ROP_ROP_BG_End 15
-#define GCREG_ROP_ROP_BG_Start 8
-#define GCREG_ROP_ROP_BG_Type U08
-
-/* Background ROP code is used for opaque pixels. */
-#define GCREG_ROP_ROP_FG 7 : 0
-#define GCREG_ROP_ROP_FG_End 7
-#define GCREG_ROP_ROP_FG_Start 0
-#define GCREG_ROP_ROP_FG_Type U08
-
-struct gcregrop {
- /* gcregRopRegAddrs:ROP_FG */
- unsigned int fg:8;
-
- /* gcregRopRegAddrs:ROP_BG */
- unsigned int bg:8;
-
- /* gcregRopRegAddrs:reserved */
- unsigned int _reserved_16_19:4;
-
- /* gcregRopRegAddrs:ROP_TYPE */
- unsigned int type:2;
-
- /* gcregRopRegAddrs:reserved */
- unsigned int _reserved_22_31:10;
-};
-
-/*******************************************************************************
-** State gcregClipTopLeft
-*/
-
-/* Top left corner of the clipping rectangle defined in pixels. Clipping is
-** always on and everything beyond the clipping rectangle will be clipped
-** out. Clipping is not used with filter blits.
-*/
-
-#define gcregClipTopLeftRegAddrs 0x0498
-#define GCREG_CLIP_TOP_LEFT_MSB 15
-#define GCREG_CLIP_TOP_LEFT_LSB 0
-#define GCREG_CLIP_TOP_LEFT_BLK 0
-#define GCREG_CLIP_TOP_LEFT_Count 1
-#define GCREG_CLIP_TOP_LEFT_FieldMask 0x7FFF7FFF
-#define GCREG_CLIP_TOP_LEFT_ReadMask 0x7FFF7FFF
-#define GCREG_CLIP_TOP_LEFT_WriteMask 0x7FFF7FFF
-#define GCREG_CLIP_TOP_LEFT_ResetValue 0x00000000
-
-#define GCREG_CLIP_TOP_LEFT_Y 30 : 16
-#define GCREG_CLIP_TOP_LEFT_Y_End 30
-#define GCREG_CLIP_TOP_LEFT_Y_Start 16
-#define GCREG_CLIP_TOP_LEFT_Y_Type U15
-
-#define GCREG_CLIP_TOP_LEFT_X 14 : 0
-#define GCREG_CLIP_TOP_LEFT_X_End 14
-#define GCREG_CLIP_TOP_LEFT_X_Start 0
-#define GCREG_CLIP_TOP_LEFT_X_Type U15
-
-struct gcregcliplt {
- /* gcregClipTopLeftRegAddrs:X */
- unsigned int left:15;
-
- /* gcregClipTopLeftRegAddrs:reserved */
- unsigned int _reserved_15:1;
-
- /* gcregClipTopLeftRegAddrs:Y */
- unsigned int top:15;
-
- /* gcregClipTopLeftRegAddrs:reserved */
- unsigned int _reserved_31:1;
-};
-
-/*******************************************************************************
-** State gcregClipBottomRight
-*/
-
-/* Bottom right corner of the clipping rectangle defined in pixels. Clipping
-** is always on and everything beyond the clipping rectangle will be clipped
-** out. Clipping is not used with filter blits.
-*/
-
-#define gcregClipBottomRightRegAddrs 0x0499
-#define GCREG_CLIP_BOTTOM_RIGHT_MSB 15
-#define GCREG_CLIP_BOTTOM_RIGHT_LSB 0
-#define GCREG_CLIP_BOTTOM_RIGHT_BLK 0
-#define GCREG_CLIP_BOTTOM_RIGHT_Count 1
-#define GCREG_CLIP_BOTTOM_RIGHT_FieldMask 0x7FFF7FFF
-#define GCREG_CLIP_BOTTOM_RIGHT_ReadMask 0x7FFF7FFF
-#define GCREG_CLIP_BOTTOM_RIGHT_WriteMask 0x7FFF7FFF
-#define GCREG_CLIP_BOTTOM_RIGHT_ResetValue 0x00000000
-
-#define GCREG_CLIP_BOTTOM_RIGHT_Y 30 : 16
-#define GCREG_CLIP_BOTTOM_RIGHT_Y_End 30
-#define GCREG_CLIP_BOTTOM_RIGHT_Y_Start 16
-#define GCREG_CLIP_BOTTOM_RIGHT_Y_Type U15
-
-#define GCREG_CLIP_BOTTOM_RIGHT_X 14 : 0
-#define GCREG_CLIP_BOTTOM_RIGHT_X_End 14
-#define GCREG_CLIP_BOTTOM_RIGHT_X_Start 0
-#define GCREG_CLIP_BOTTOM_RIGHT_X_Type U15
-
-struct gcregcliprb {
- /* gcregClipBottomRightRegAddrs:X */
- unsigned int right:15;
-
- /* gcregClipBottomRightRegAddrs:reserved */
- unsigned int _reserved_15:1;
-
- /* gcregClipBottomRightRegAddrs:Y */
- unsigned int bottom:15;
-
- /* gcregClipBottomRightRegAddrs:reserved */
- unsigned int _reserved_31:1;
-};
-
-/*******************************************************************************
-** State gcregConfig
-*/
-
-#define gcregConfigRegAddrs 0x049B
-#define GCREG_CONFIG_MSB 15
-#define GCREG_CONFIG_LSB 0
-#define GCREG_CONFIG_BLK 0
-#define GCREG_CONFIG_Count 1
-#define GCREG_CONFIG_FieldMask 0x00370031
-#define GCREG_CONFIG_ReadMask 0x00370031
-#define GCREG_CONFIG_WriteMask 0x00370031
-#define GCREG_CONFIG_ResetValue 0x00000000
-
-#define GCREG_CONFIG_MIRROR_BLT_MODE 5 : 4
-#define GCREG_CONFIG_MIRROR_BLT_MODE_End 5
-#define GCREG_CONFIG_MIRROR_BLT_MODE_Start 4
-#define GCREG_CONFIG_MIRROR_BLT_MODE_Type U02
-#define GCREG_CONFIG_MIRROR_BLT_MODE_NORMAL 0x0
-#define GCREG_CONFIG_MIRROR_BLT_MODE_HMIRROR 0x1
-#define GCREG_CONFIG_MIRROR_BLT_MODE_VMIRROR 0x2
-#define GCREG_CONFIG_MIRROR_BLT_MODE_FULL_MIRROR 0x3
-
-#define GCREG_CONFIG_MIRROR_BLT_ENABLE 0 : 0
-#define GCREG_CONFIG_MIRROR_BLT_ENABLE_End 0
-#define GCREG_CONFIG_MIRROR_BLT_ENABLE_Start 0
-#define GCREG_CONFIG_MIRROR_BLT_ENABLE_Type U01
-#define GCREG_CONFIG_MIRROR_BLT_ENABLE_OFF 0x0
-#define GCREG_CONFIG_MIRROR_BLT_ENABLE_ON 0x1
-
-/* Source select for the old walkers. */
-#define GCREG_CONFIG_SOURCE_SELECT 18 : 16
-#define GCREG_CONFIG_SOURCE_SELECT_End 18
-#define GCREG_CONFIG_SOURCE_SELECT_Start 16
-#define GCREG_CONFIG_SOURCE_SELECT_Type U03
-
-/* Destination select for the old walkers. */
-#define GCREG_CONFIG_DESTINATION_SELECT 21 : 20
-#define GCREG_CONFIG_DESTINATION_SELECT_End 21
-#define GCREG_CONFIG_DESTINATION_SELECT_Start 20
-#define GCREG_CONFIG_DESTINATION_SELECT_Type U02
-
-/*******************************************************************************
-** State gcregSrcOriginFraction
-*/
-
-/* Fraction for the source origin. Together with values in gcregSrcOrigin
-** these values form signed 16.16 fixed point origin for the source
-** rectangle. Fractions are only used in filter blit in split frame mode.
-*/
-
-#define gcregSrcOriginFractionRegAddrs 0x049E
-#define GCREG_SRC_ORIGIN_FRACTION_MSB 15
-#define GCREG_SRC_ORIGIN_FRACTION_LSB 0
-#define GCREG_SRC_ORIGIN_FRACTION_BLK 0
-#define GCREG_SRC_ORIGIN_FRACTION_Count 1
-#define GCREG_SRC_ORIGIN_FRACTION_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_ORIGIN_FRACTION_ReadMask 0xFFFFFFFF
-#define GCREG_SRC_ORIGIN_FRACTION_WriteMask 0xFFFFFFFF
-#define GCREG_SRC_ORIGIN_FRACTION_ResetValue 0x00000000
-
-#define GCREG_SRC_ORIGIN_FRACTION_Y 31 : 16
-#define GCREG_SRC_ORIGIN_FRACTION_Y_End 31
-#define GCREG_SRC_ORIGIN_FRACTION_Y_Start 16
-#define GCREG_SRC_ORIGIN_FRACTION_Y_Type U16
-
-#define GCREG_SRC_ORIGIN_FRACTION_X 15 : 0
-#define GCREG_SRC_ORIGIN_FRACTION_X_End 15
-#define GCREG_SRC_ORIGIN_FRACTION_X_Start 0
-#define GCREG_SRC_ORIGIN_FRACTION_X_Type U16
-
-/*******************************************************************************
-** State gcregAlphaControl
-*/
-
-#define gcregAlphaControlRegAddrs 0x049F
-#define GCREG_ALPHA_CONTROL_MSB 15
-#define GCREG_ALPHA_CONTROL_LSB 0
-#define GCREG_ALPHA_CONTROL_BLK 0
-#define GCREG_ALPHA_CONTROL_Count 1
-#define GCREG_ALPHA_CONTROL_FieldMask 0xFFFF0001
-#define GCREG_ALPHA_CONTROL_ReadMask 0xFFFF0001
-#define GCREG_ALPHA_CONTROL_WriteMask 0xFFFF0001
-#define GCREG_ALPHA_CONTROL_ResetValue 0x00000000
-
-#define GCREG_ALPHA_CONTROL_ENABLE 0 : 0
-#define GCREG_ALPHA_CONTROL_ENABLE_End 0
-#define GCREG_ALPHA_CONTROL_ENABLE_Start 0
-#define GCREG_ALPHA_CONTROL_ENABLE_Type U01
-#define GCREG_ALPHA_CONTROL_ENABLE_OFF 0x0
-#define GCREG_ALPHA_CONTROL_ENABLE_ON 0x1
-
-struct gcregalphacontrol {
- /* gcregAlphaControlRegAddrs:GCREG_ALPHA_CONTROL_ENABLE */
- unsigned int enable:1;
-
- /* gcregAlphaControlRegAddrs:reserved */
- unsigned int _reserved_1_31:31;
-};
-
-static const struct gcregalphacontrol gcregalpha_off = {
- /* gcregAlphaControlRegAddrs:GCREG_ALPHA_CONTROL_ENABLE */
- GCREG_ALPHA_CONTROL_ENABLE_OFF,
-
- /* gcregAlphaControlRegAddrs:reserved */
- 0
-};
-
-static const struct gcregalphacontrol gcregalpha_on = {
- /* gcregAlphaControlRegAddrs:GCREG_ALPHA_CONTROL_ENABLE */
- GCREG_ALPHA_CONTROL_ENABLE_ON,
-
- /* gcregAlphaControlRegAddrs:reserved */
- 0
-};
-
-/*******************************************************************************
-** State gcregAlphaModes
-*/
-
-#define gcregAlphaModesRegAddrs 0x04A0
-#define GCREG_ALPHA_MODES_MSB 15
-#define GCREG_ALPHA_MODES_LSB 0
-#define GCREG_ALPHA_MODES_BLK 0
-#define GCREG_ALPHA_MODES_Count 1
-#define GCREG_ALPHA_MODES_FieldMask 0xFF113311
-#define GCREG_ALPHA_MODES_ReadMask 0xFF113311
-#define GCREG_ALPHA_MODES_WriteMask 0xFF113311
-#define GCREG_ALPHA_MODES_ResetValue 0x00000000
-
-#define GCREG_ALPHA_MODES_SRC_ALPHA_MODE 0 : 0
-#define GCREG_ALPHA_MODES_SRC_ALPHA_MODE_End 0
-#define GCREG_ALPHA_MODES_SRC_ALPHA_MODE_Start 0
-#define GCREG_ALPHA_MODES_SRC_ALPHA_MODE_Type U01
-#define GCREG_ALPHA_MODES_SRC_ALPHA_MODE_NORMAL 0x0
-#define GCREG_ALPHA_MODES_SRC_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_ALPHA_MODES_DST_ALPHA_MODE 4 : 4
-#define GCREG_ALPHA_MODES_DST_ALPHA_MODE_End 4
-#define GCREG_ALPHA_MODES_DST_ALPHA_MODE_Start 4
-#define GCREG_ALPHA_MODES_DST_ALPHA_MODE_Type U01
-#define GCREG_ALPHA_MODES_DST_ALPHA_MODE_NORMAL 0x0
-#define GCREG_ALPHA_MODES_DST_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE 9 : 8
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_End 9
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_Start 8
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_Type U02
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_NORMAL 0x0
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE 13 : 12
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_End 13
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_Start 12
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_Type U02
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_NORMAL 0x0
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE 26 : 24
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_End 26
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_Start 24
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_Type U03
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_ZERO 0x0
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_ONE 0x1
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_NORMAL 0x2
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_INVERSED 0x3
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_COLOR 0x4
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_ALPHA_MODES_SRC_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* Src Blending factor is calculate from Src alpha. */
-#define GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR 27 : 27
-#define GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR_End 27
-#define GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR_Start 27
-#define GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR_Type U01
-#define GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR_DISABLED 0x0
-#define GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR_ENABLED 0x1
-
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE 30 : 28
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_End 30
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_Start 28
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_Type U03
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_ZERO 0x0
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_ONE 0x1
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_NORMAL 0x2
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_INVERSED 0x3
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_COLOR 0x4
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_ALPHA_MODES_DST_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* Dst Blending factor is calculate from Dst alpha. */
-#define GCREG_ALPHA_MODES_DST_ALPHA_FACTOR 31 : 31
-#define GCREG_ALPHA_MODES_DST_ALPHA_FACTOR_End 31
-#define GCREG_ALPHA_MODES_DST_ALPHA_FACTOR_Start 31
-#define GCREG_ALPHA_MODES_DST_ALPHA_FACTOR_Type U01
-#define GCREG_ALPHA_MODES_DST_ALPHA_FACTOR_DISABLED 0x0
-#define GCREG_ALPHA_MODES_DST_ALPHA_FACTOR_ENABLED 0x1
-
-struct gcregalphamodes {
- /* gcregAlphaModes:GCREG_ALPHA_MODES_SRC_ALPHA_MODE */
- unsigned int src_inverse:1;
-
- /* gcregAlphaModes:reserved */
- unsigned int _reserved_1_3:3;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_DST_ALPHA_MODE */
- unsigned int dst_inverse:1;
-
- /* gcregAlphaModes:reserved */
- unsigned int _reserved_5_7:3;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE */
- unsigned int src_global_alpha_mode:2;
-
- /* gcregAlphaModes:reserved */
- unsigned int _reserved_10_11:2;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE */
- unsigned int dst_global_alpha_mode:2;
-
- /* gcregAlphaModes:reserved */
- unsigned int _reserved_14_23:10;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_SRC_BLENDING_MODE */
- unsigned int src_blend:3;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_SRC_ALPHA_FACTOR */
- unsigned int src_color_reverse:1;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_DST_BLENDING_MODE */
- unsigned int dst_blend:3;
-
- /* gcregAlphaModes:GCREG_ALPHA_MODES_DST_ALPHA_FACTOR */
- unsigned int dst_color_reverse:1;
-};
-
-/*******************************************************************************
-** State UPlaneAddress
-*/
-
-/* 32-bit aligned base address of the source U plane. */
-
-#define gcregUPlaneAddressRegAddrs 0x04A1
-#define GCREG_UPLANE_ADDRESS_MSB 15
-#define GCREG_UPLANE_ADDRESS_LSB 0
-#define GCREG_UPLANE_ADDRESS_BLK 0
-#define GCREG_UPLANE_ADDRESS_Count 1
-#define GCREG_UPLANE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_UPLANE_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_UPLANE_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_UPLANE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_UPLANE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_UPLANE_ADDRESS_ADDRESS_End 30
-#define GCREG_UPLANE_ADDRESS_ADDRESS_Start 0
-#define GCREG_UPLANE_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State UPlaneStride
-*/
-
-/* Stride of the source U plane in bytes. */
-
-#define gcregUPlaneStrideRegAddrs 0x04A2
-#define GCREG_UPLANE_STRIDE_MSB 15
-#define GCREG_UPLANE_STRIDE_LSB 0
-#define GCREG_UPLANE_STRIDE_BLK 0
-#define GCREG_UPLANE_STRIDE_Count 1
-#define GCREG_UPLANE_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_UPLANE_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_UPLANE_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_UPLANE_STRIDE_ResetValue 0x00000000
-
-#define GCREG_UPLANE_STRIDE_STRIDE 17 : 0
-#define GCREG_UPLANE_STRIDE_STRIDE_End 17
-#define GCREG_UPLANE_STRIDE_STRIDE_Start 0
-#define GCREG_UPLANE_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State VPlaneAddress
-*/
-
-/* 32-bit aligned base address of the source V plane. */
-
-#define gcregVPlaneAddressRegAddrs 0x04A3
-#define GCREG_VPLANE_ADDRESS_MSB 15
-#define GCREG_VPLANE_ADDRESS_LSB 0
-#define GCREG_VPLANE_ADDRESS_BLK 0
-#define GCREG_VPLANE_ADDRESS_Count 1
-#define GCREG_VPLANE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_VPLANE_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_VPLANE_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_VPLANE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_VPLANE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_VPLANE_ADDRESS_ADDRESS_End 30
-#define GCREG_VPLANE_ADDRESS_ADDRESS_Start 0
-#define GCREG_VPLANE_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State VPlaneStride
-*/
-
-/* Stride of the source V plane in bytes. */
-
-#define gcregVPlaneStrideRegAddrs 0x04A4
-#define GCREG_VPLANE_STRIDE_MSB 15
-#define GCREG_VPLANE_STRIDE_LSB 0
-#define GCREG_VPLANE_STRIDE_BLK 0
-#define GCREG_VPLANE_STRIDE_Count 1
-#define GCREG_VPLANE_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_VPLANE_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_VPLANE_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_VPLANE_STRIDE_ResetValue 0x00000000
-
-#define GCREG_VPLANE_STRIDE_STRIDE 17 : 0
-#define GCREG_VPLANE_STRIDE_STRIDE_End 17
-#define GCREG_VPLANE_STRIDE_STRIDE_Start 0
-#define GCREG_VPLANE_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregPEConfig
-*/
-
-/* PE debug register. */
-
-#define gcregPEConfigRegAddrs 0x04AC
-#define GCREG_PE_CONFIG_Address 0x012B0
-#define GCREG_PE_CONFIG_MSB 15
-#define GCREG_PE_CONFIG_LSB 0
-#define GCREG_PE_CONFIG_BLK 0
-#define GCREG_PE_CONFIG_Count 1
-#define GCREG_PE_CONFIG_FieldMask 0x0000000B
-#define GCREG_PE_CONFIG_ReadMask 0x0000000B
-#define GCREG_PE_CONFIG_WriteMask 0x0000000B
-#define GCREG_PE_CONFIG_ResetValue 0x00000000
-
-#define GCREG_PE_CONFIG_DESTINATION_FETCH 1 : 0
-#define GCREG_PE_CONFIG_DESTINATION_FETCH_End 1
-#define GCREG_PE_CONFIG_DESTINATION_FETCH_Start 0
-#define GCREG_PE_CONFIG_DESTINATION_FETCH_Type U02
-#define GCREG_PE_CONFIG_DESTINATION_FETCH_DISABLE 0x0
-#define GCREG_PE_CONFIG_DESTINATION_FETCH_DEFAULT 0x1
-#define GCREG_PE_CONFIG_DESTINATION_FETCH_ALWAYS 0x2
-
-#define GCREG_PE_CONFIG_MASK_DESTINATION_FETCH 3 : 3
-#define GCREG_PE_CONFIG_MASK_DESTINATION_FETCH_End 3
-#define GCREG_PE_CONFIG_MASK_DESTINATION_FETCH_Start 3
-#define GCREG_PE_CONFIG_MASK_DESTINATION_FETCH_Type U01
-#define GCREG_PE_CONFIG_MASK_DESTINATION_FETCH_ENABLED 0x0
-#define GCREG_PE_CONFIG_MASK_DESTINATION_FETCH_MASKED 0x1
-
-/*******************************************************************************
-** State gcregDstRotationHeight
-*/
-
-/* 180/270 degree rotation configuration for the destination surface. Height
-** field specifies the height of the surface in pixels.
-*/
-
-#define gcregDstRotationHeightRegAddrs 0x04AD
-#define GCREG_DST_ROTATION_HEIGHT_MSB 15
-#define GCREG_DST_ROTATION_HEIGHT_LSB 0
-#define GCREG_DST_ROTATION_HEIGHT_BLK 0
-#define GCREG_DST_ROTATION_HEIGHT_Count 1
-#define GCREG_DST_ROTATION_HEIGHT_FieldMask 0x0000FFFF
-#define GCREG_DST_ROTATION_HEIGHT_ReadMask 0x0000FFFF
-#define GCREG_DST_ROTATION_HEIGHT_WriteMask 0x0000FFFF
-#define GCREG_DST_ROTATION_HEIGHT_ResetValue 0x00000000
-
-#define GCREG_DST_ROTATION_HEIGHT_HEIGHT 15 : 0
-#define GCREG_DST_ROTATION_HEIGHT_HEIGHT_End 15
-#define GCREG_DST_ROTATION_HEIGHT_HEIGHT_Start 0
-#define GCREG_DST_ROTATION_HEIGHT_HEIGHT_Type U16
-
-struct gcregdstrotationheight {
- /* gcregDstRotationHeightRegAddrs:GCREG_DST_ROTATION_HEIGHT_HEIGHT */
- unsigned int height:16;
-
- /* gcregDstRotationHeightRegAddrs:reserved */
- unsigned int _reserved_16_31:16;
-};
-
-/*******************************************************************************
-** State gcregSrcRotationHeight
-*/
-
-/* 180/270 degree rotation configuration for the Source surface. Height field
-** specifies the height of the surface in pixels.
-*/
-
-#define gcregSrcRotationHeightRegAddrs 0x04AE
-#define GCREG_SRC_ROTATION_HEIGHT_MSB 15
-#define GCREG_SRC_ROTATION_HEIGHT_LSB 0
-#define GCREG_SRC_ROTATION_HEIGHT_BLK 0
-#define GCREG_SRC_ROTATION_HEIGHT_Count 1
-#define GCREG_SRC_ROTATION_HEIGHT_FieldMask 0x0000FFFF
-#define GCREG_SRC_ROTATION_HEIGHT_ReadMask 0x0000FFFF
-#define GCREG_SRC_ROTATION_HEIGHT_WriteMask 0x0000FFFF
-#define GCREG_SRC_ROTATION_HEIGHT_ResetValue 0x00000000
-
-#define GCREG_SRC_ROTATION_HEIGHT_HEIGHT 15 : 0
-#define GCREG_SRC_ROTATION_HEIGHT_HEIGHT_End 15
-#define GCREG_SRC_ROTATION_HEIGHT_HEIGHT_Start 0
-#define GCREG_SRC_ROTATION_HEIGHT_HEIGHT_Type U16
-
-struct gcregsrcrotationheight {
- /* gcregSrcRotationHeightRegAddrs:GCREG_SRC_ROTATION_HEIGHT_HEIGHT */
- unsigned int height:16;
-
- /* gcregSrcRotationHeightRegAddrs:reserved */
- unsigned int _reserved_16_31:16;
-};
-
-/*******************************************************************************
-** State gcregRotAngle
-*/
-
-/* 0/90/180/270 degree rotation configuration for the Source surface. Height
-** field specifies the height of the surface in pixels.
-*/
-
-#define gcregRotAngleRegAddrs 0x04AF
-#define GCREG_ROT_ANGLE_MSB 15
-#define GCREG_ROT_ANGLE_LSB 0
-#define GCREG_ROT_ANGLE_BLK 0
-#define GCREG_ROT_ANGLE_Count 1
-#define GCREG_ROT_ANGLE_FieldMask 0x000BB33F
-#define GCREG_ROT_ANGLE_ReadMask 0x000BB33F
-#define GCREG_ROT_ANGLE_WriteMask 0x000BB33F
-#define GCREG_ROT_ANGLE_ResetValue 0x00000000
-
-#define GCREG_ROT_ANGLE_SRC 2 : 0
-#define GCREG_ROT_ANGLE_SRC_End 2
-#define GCREG_ROT_ANGLE_SRC_Start 0
-#define GCREG_ROT_ANGLE_SRC_Type U03
-#define GCREG_ROT_ANGLE_SRC_ROT0 0x0
-#define GCREG_ROT_ANGLE_SRC_FLIP_X 0x1
-#define GCREG_ROT_ANGLE_SRC_FLIP_Y 0x2
-#define GCREG_ROT_ANGLE_SRC_ROT90 0x4
-#define GCREG_ROT_ANGLE_SRC_ROT180 0x5
-#define GCREG_ROT_ANGLE_SRC_ROT270 0x6
-
-#define GCREG_ROT_ANGLE_DST 5 : 3
-#define GCREG_ROT_ANGLE_DST_End 5
-#define GCREG_ROT_ANGLE_DST_Start 3
-#define GCREG_ROT_ANGLE_DST_Type U03
-#define GCREG_ROT_ANGLE_DST_ROT0 0x0
-#define GCREG_ROT_ANGLE_DST_FLIP_X 0x1
-#define GCREG_ROT_ANGLE_DST_FLIP_Y 0x2
-#define GCREG_ROT_ANGLE_DST_ROT90 0x4
-#define GCREG_ROT_ANGLE_DST_ROT180 0x5
-#define GCREG_ROT_ANGLE_DST_ROT270 0x6
-
-#define GCREG_ROT_ANGLE_MASK_SRC 8 : 8
-#define GCREG_ROT_ANGLE_MASK_SRC_End 8
-#define GCREG_ROT_ANGLE_MASK_SRC_Start 8
-#define GCREG_ROT_ANGLE_MASK_SRC_Type U01
-#define GCREG_ROT_ANGLE_MASK_SRC_ENABLED 0x0
-#define GCREG_ROT_ANGLE_MASK_SRC_MASKED 0x1
-
-#define GCREG_ROT_ANGLE_MASK_DST 9 : 9
-#define GCREG_ROT_ANGLE_MASK_DST_End 9
-#define GCREG_ROT_ANGLE_MASK_DST_Start 9
-#define GCREG_ROT_ANGLE_MASK_DST_Type U01
-#define GCREG_ROT_ANGLE_MASK_DST_ENABLED 0x0
-#define GCREG_ROT_ANGLE_MASK_DST_MASKED 0x1
-
-#define GCREG_ROT_ANGLE_SRC_MIRROR 13 : 12
-#define GCREG_ROT_ANGLE_SRC_MIRROR_End 13
-#define GCREG_ROT_ANGLE_SRC_MIRROR_Start 12
-#define GCREG_ROT_ANGLE_SRC_MIRROR_Type U02
-#define GCREG_ROT_ANGLE_SRC_MIRROR_NONE 0x0
-#define GCREG_ROT_ANGLE_SRC_MIRROR_MIRROR_X 0x1
-#define GCREG_ROT_ANGLE_SRC_MIRROR_MIRROR_Y 0x2
-#define GCREG_ROT_ANGLE_SRC_MIRROR_MIRROR_XY 0x3
-
-#define GCREG_ROT_ANGLE_MASK_SRC_MIRROR 15 : 15
-#define GCREG_ROT_ANGLE_MASK_SRC_MIRROR_End 15
-#define GCREG_ROT_ANGLE_MASK_SRC_MIRROR_Start 15
-#define GCREG_ROT_ANGLE_MASK_SRC_MIRROR_Type U01
-#define GCREG_ROT_ANGLE_MASK_SRC_MIRROR_ENABLED 0x0
-#define GCREG_ROT_ANGLE_MASK_SRC_MIRROR_MASKED 0x1
-
-#define GCREG_ROT_ANGLE_DST_MIRROR 17 : 16
-#define GCREG_ROT_ANGLE_DST_MIRROR_End 17
-#define GCREG_ROT_ANGLE_DST_MIRROR_Start 16
-#define GCREG_ROT_ANGLE_DST_MIRROR_Type U02
-#define GCREG_ROT_ANGLE_DST_MIRROR_NONE 0x0
-#define GCREG_ROT_ANGLE_DST_MIRROR_MIRROR_X 0x1
-#define GCREG_ROT_ANGLE_DST_MIRROR_MIRROR_Y 0x2
-#define GCREG_ROT_ANGLE_DST_MIRROR_MIRROR_XY 0x3
-
-#define GCREG_ROT_ANGLE_MASK_DST_MIRROR 19 : 19
-#define GCREG_ROT_ANGLE_MASK_DST_MIRROR_End 19
-#define GCREG_ROT_ANGLE_MASK_DST_MIRROR_Start 19
-#define GCREG_ROT_ANGLE_MASK_DST_MIRROR_Type U01
-#define GCREG_ROT_ANGLE_MASK_DST_MIRROR_ENABLED 0x0
-#define GCREG_ROT_ANGLE_MASK_DST_MIRROR_MASKED 0x1
-
-struct gcregrotangle {
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_SRC */
- unsigned int src:3;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_DST */
- unsigned int dst:3;
-
- /* gcregRotAngleRegAddrs:reserved */
- unsigned int _reserved_6_7:2;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_MASK_SRC */
- unsigned int src_mask:1;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_MASK_DST */
- unsigned int dst_mask:1;
-
- /* gcregRotAngleRegAddrs:reserved */
- unsigned int _reserved_10_11:2;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_SRC_MIRROR */
- unsigned int src_mirror:2;
-
- /* gcregRotAngleRegAddrs:reserved */
- unsigned int _reserved_14:1;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_MASK_SRC_MIRROR */
- unsigned int src_mirror_mask:1;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_DST_MIRROR */
- unsigned int dst_mirror:2;
-
- /* gcregRotAngleRegAddrs:reserved */
- unsigned int _reserved_18:1;
-
- /* gcregRotAngleRegAddrs:GCREG_ROT_ANGLE_MASK_DST_MIRROR */
- unsigned int dst_mirror_mask:1;
-
- /* gcregRotAngleRegAddrs:reserved */
- unsigned int _reserved_20_31:12;
-};
-
-/*******************************************************************************
-** State gcregClearPixelValue32
-*/
-
-/* Clear color value in A8R8G8B8 format. */
-
-#define gcregClearPixelValue32RegAddrs 0x04B0
-#define GCREG_CLEAR_PIXEL_VALUE32_MSB 15
-#define GCREG_CLEAR_PIXEL_VALUE32_LSB 0
-#define GCREG_CLEAR_PIXEL_VALUE32_BLK 0
-#define GCREG_CLEAR_PIXEL_VALUE32_Count 1
-#define GCREG_CLEAR_PIXEL_VALUE32_FieldMask 0xFFFFFFFF
-#define GCREG_CLEAR_PIXEL_VALUE32_ReadMask 0xFFFFFFFF
-#define GCREG_CLEAR_PIXEL_VALUE32_WriteMask 0xFFFFFFFF
-#define GCREG_CLEAR_PIXEL_VALUE32_ResetValue 0x00000000
-
-#define GCREG_CLEAR_PIXEL_VALUE32_ALPHA 31 : 24
-#define GCREG_CLEAR_PIXEL_VALUE32_ALPHA_End 31
-#define GCREG_CLEAR_PIXEL_VALUE32_ALPHA_Start 24
-#define GCREG_CLEAR_PIXEL_VALUE32_ALPHA_Type U08
-
-#define GCREG_CLEAR_PIXEL_VALUE32_RED 23 : 16
-#define GCREG_CLEAR_PIXEL_VALUE32_RED_End 23
-#define GCREG_CLEAR_PIXEL_VALUE32_RED_Start 16
-#define GCREG_CLEAR_PIXEL_VALUE32_RED_Type U08
-
-#define GCREG_CLEAR_PIXEL_VALUE32_GREEN 15 : 8
-#define GCREG_CLEAR_PIXEL_VALUE32_GREEN_End 15
-#define GCREG_CLEAR_PIXEL_VALUE32_GREEN_Start 8
-#define GCREG_CLEAR_PIXEL_VALUE32_GREEN_Type U08
-
-#define GCREG_CLEAR_PIXEL_VALUE32_BLUE 7 : 0
-#define GCREG_CLEAR_PIXEL_VALUE32_BLUE_End 7
-#define GCREG_CLEAR_PIXEL_VALUE32_BLUE_Start 0
-#define GCREG_CLEAR_PIXEL_VALUE32_BLUE_Type U08
-
-struct gcregclearcolor {
- /* gcregClearPixelValue32RegAddrs:GCREG_CLEAR_PIXEL_VALUE32_BLUE */
- unsigned int b:8;
-
- /* gcregClearPixelValue32RegAddrs:GCREG_CLEAR_PIXEL_VALUE32_GREEN */
- unsigned int g:8;
-
- /* gcregClearPixelValue32RegAddrs:GCREG_CLEAR_PIXEL_VALUE32_RED */
- unsigned int r:8;
-
- /* gcregClearPixelValue32RegAddrs:GCREG_CLEAR_PIXEL_VALUE32_ALPHA */
- unsigned int a:8;
-};
-
-/*******************************************************************************
-** State gcregDestColorKey
-*/
-
-/* Defines the destination transparency color in destination format. */
-
-#define gcregDestColorKeyRegAddrs 0x04B1
-#define GCREG_DEST_COLOR_KEY_MSB 15
-#define GCREG_DEST_COLOR_KEY_LSB 0
-#define GCREG_DEST_COLOR_KEY_BLK 0
-#define GCREG_DEST_COLOR_KEY_Count 1
-#define GCREG_DEST_COLOR_KEY_FieldMask 0xFFFFFFFF
-#define GCREG_DEST_COLOR_KEY_ReadMask 0xFFFFFFFF
-#define GCREG_DEST_COLOR_KEY_WriteMask 0xFFFFFFFF
-#define GCREG_DEST_COLOR_KEY_ResetValue 0x00000000
-
-#define GCREG_DEST_COLOR_KEY_ALPHA 31 : 24
-#define GCREG_DEST_COLOR_KEY_ALPHA_End 31
-#define GCREG_DEST_COLOR_KEY_ALPHA_Start 24
-#define GCREG_DEST_COLOR_KEY_ALPHA_Type U08
-
-#define GCREG_DEST_COLOR_KEY_RED 23 : 16
-#define GCREG_DEST_COLOR_KEY_RED_End 23
-#define GCREG_DEST_COLOR_KEY_RED_Start 16
-#define GCREG_DEST_COLOR_KEY_RED_Type U08
-
-#define GCREG_DEST_COLOR_KEY_GREEN 15 : 8
-#define GCREG_DEST_COLOR_KEY_GREEN_End 15
-#define GCREG_DEST_COLOR_KEY_GREEN_Start 8
-#define GCREG_DEST_COLOR_KEY_GREEN_Type U08
-
-#define GCREG_DEST_COLOR_KEY_BLUE 7 : 0
-#define GCREG_DEST_COLOR_KEY_BLUE_End 7
-#define GCREG_DEST_COLOR_KEY_BLUE_Start 0
-#define GCREG_DEST_COLOR_KEY_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregGlobalSrcColor
-*/
-
-/* Defines the global source color and alpha values. */
-
-#define gcregGlobalSrcColorRegAddrs 0x04B2
-#define GCREG_GLOBAL_SRC_COLOR_MSB 15
-#define GCREG_GLOBAL_SRC_COLOR_LSB 0
-#define GCREG_GLOBAL_SRC_COLOR_BLK 0
-#define GCREG_GLOBAL_SRC_COLOR_Count 1
-#define GCREG_GLOBAL_SRC_COLOR_FieldMask 0xFFFFFFFF
-#define GCREG_GLOBAL_SRC_COLOR_ReadMask 0xFFFFFFFF
-#define GCREG_GLOBAL_SRC_COLOR_WriteMask 0xFFFFFFFF
-#define GCREG_GLOBAL_SRC_COLOR_ResetValue 0x00000000
-
-#define GCREG_GLOBAL_SRC_COLOR_ALPHA 31 : 24
-#define GCREG_GLOBAL_SRC_COLOR_ALPHA_End 31
-#define GCREG_GLOBAL_SRC_COLOR_ALPHA_Start 24
-#define GCREG_GLOBAL_SRC_COLOR_ALPHA_Type U08
-
-#define GCREG_GLOBAL_SRC_COLOR_RED 23 : 16
-#define GCREG_GLOBAL_SRC_COLOR_RED_End 23
-#define GCREG_GLOBAL_SRC_COLOR_RED_Start 16
-#define GCREG_GLOBAL_SRC_COLOR_RED_Type U08
-
-#define GCREG_GLOBAL_SRC_COLOR_GREEN 15 : 8
-#define GCREG_GLOBAL_SRC_COLOR_GREEN_End 15
-#define GCREG_GLOBAL_SRC_COLOR_GREEN_Start 8
-#define GCREG_GLOBAL_SRC_COLOR_GREEN_Type U08
-
-#define GCREG_GLOBAL_SRC_COLOR_BLUE 7 : 0
-#define GCREG_GLOBAL_SRC_COLOR_BLUE_End 7
-#define GCREG_GLOBAL_SRC_COLOR_BLUE_Start 0
-#define GCREG_GLOBAL_SRC_COLOR_BLUE_Type U08
-
-struct gcregglobalsrccolor {
- /* gcregGlobalSrcColorRegAddrs:GCREG_GLOBAL_SRC_COLOR_BLUE */
- unsigned int b:8;
-
- /* gcregGlobalSrcColorRegAddrs:GCREG_GLOBAL_SRC_COLOR_GREEN */
- unsigned int g:8;
-
- /* gcregGlobalSrcColorRegAddrs:GCREG_GLOBAL_SRC_COLOR_RED */
- unsigned int r:8;
-
- /* gcregGlobalSrcColorRegAddrs:GCREG_GLOBAL_SRC_COLOR_ALPHA */
- unsigned int a:8;
-};
-
-/*******************************************************************************
-** State gcregGlobalDestColor
-*/
-
-/* Defines the global destination color and alpha values. */
-
-#define gcregGlobalDestColorRegAddrs 0x04B3
-#define GCREG_GLOBAL_DEST_COLOR_MSB 15
-#define GCREG_GLOBAL_DEST_COLOR_LSB 0
-#define GCREG_GLOBAL_DEST_COLOR_BLK 0
-#define GCREG_GLOBAL_DEST_COLOR_Count 1
-#define GCREG_GLOBAL_DEST_COLOR_FieldMask 0xFFFFFFFF
-#define GCREG_GLOBAL_DEST_COLOR_ReadMask 0xFFFFFFFF
-#define GCREG_GLOBAL_DEST_COLOR_WriteMask 0xFFFFFFFF
-#define GCREG_GLOBAL_DEST_COLOR_ResetValue 0x00000000
-
-#define GCREG_GLOBAL_DEST_COLOR_ALPHA 31 : 24
-#define GCREG_GLOBAL_DEST_COLOR_ALPHA_End 31
-#define GCREG_GLOBAL_DEST_COLOR_ALPHA_Start 24
-#define GCREG_GLOBAL_DEST_COLOR_ALPHA_Type U08
-
-#define GCREG_GLOBAL_DEST_COLOR_RED 23 : 16
-#define GCREG_GLOBAL_DEST_COLOR_RED_End 23
-#define GCREG_GLOBAL_DEST_COLOR_RED_Start 16
-#define GCREG_GLOBAL_DEST_COLOR_RED_Type U08
-
-#define GCREG_GLOBAL_DEST_COLOR_GREEN 15 : 8
-#define GCREG_GLOBAL_DEST_COLOR_GREEN_End 15
-#define GCREG_GLOBAL_DEST_COLOR_GREEN_Start 8
-#define GCREG_GLOBAL_DEST_COLOR_GREEN_Type U08
-
-#define GCREG_GLOBAL_DEST_COLOR_BLUE 7 : 0
-#define GCREG_GLOBAL_DEST_COLOR_BLUE_End 7
-#define GCREG_GLOBAL_DEST_COLOR_BLUE_Start 0
-#define GCREG_GLOBAL_DEST_COLOR_BLUE_Type U08
-
-struct gcregglobaldstcolor {
- /* gcregGlobalDestColorRegAddrs:GCREG_GLOBAL_DEST_COLOR_BLUE */
- unsigned int b:8;
-
- /* gcregGlobalDestColorRegAddrs:GCREG_GLOBAL_DEST_COLOR_GREEN */
- unsigned int g:8;
-
- /* gcregGlobalDestColorRegAddrs:GCREG_GLOBAL_DEST_COLOR_RED */
- unsigned int r:8;
-
- /* gcregGlobalDestColorRegAddrs:GCREG_GLOBAL_DEST_COLOR_ALPHA */
- unsigned int a:8;
-};
-
-/*******************************************************************************
-** State gcregColorMultiplyModes
-*/
-
-/* Color modes to multiply Source or Destination pixel color by alpha
-** channel. Alpha can be from global color source or current pixel.
-*/
-
-#define gcregColorMultiplyModesRegAddrs 0x04B4
-#define GCREG_COLOR_MULTIPLY_MODES_MSB 15
-#define GCREG_COLOR_MULTIPLY_MODES_LSB 0
-#define GCREG_COLOR_MULTIPLY_MODES_BLK 0
-#define GCREG_COLOR_MULTIPLY_MODES_Count 1
-#define GCREG_COLOR_MULTIPLY_MODES_FieldMask 0x00100311
-#define GCREG_COLOR_MULTIPLY_MODES_ReadMask 0x00100311
-#define GCREG_COLOR_MULTIPLY_MODES_WriteMask 0x00100311
-#define GCREG_COLOR_MULTIPLY_MODES_ResetValue 0x00000000
-
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY 0 : 0
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_End 0
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_Start 0
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_Type U01
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE 0x0
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE 0x1
-
-#define GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY 4 : 4
-#define GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_End 4
-#define GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_Start 4
-#define GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_Type U01
-#define GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_DISABLE 0x0
-#define GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_ENABLE 0x1
-
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY 9 : 8
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_End 9
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_Start 8
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_Type U02
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_DISABLE 0x0
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_ALPHA 0x1
-#define GCREG_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_COLOR 0x2
-
-#define GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY 20 : 20
-#define GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_End 20
-#define GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_Start 20
-#define GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_Type U01
-#define GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_DISABLE 0x0
-#define GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_ENABLE 0x1
-
-struct gcregcolormultiplymodes {
- /* gcregColorMultiplyModesRegAddrs:
- GCREG_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY */
- unsigned int srcpremul:1;
-
- /* gcregColorMultiplyModesRegAddrs:
- reserved */
- unsigned int _reserved_1_3:3;
-
- /* gcregColorMultiplyModesRegAddrs:
- GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY */
- unsigned int dstpremul:1;
-
- /* gcregColorMultiplyModesRegAddrs:
- reserved */
- unsigned int _reserved_5_7:3;
-
- /* gcregColorMultiplyModesRegAddrs:
- GCREG_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY */
- unsigned int srcglobalpremul:2;
-
- /* gcregColorMultiplyModesRegAddrs:
- reserved */
- unsigned int _reserved_10_19:10;
-
- /* gcregColorMultiplyModesRegAddrs:
- GCREG_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY */
- unsigned int dstdemul:1;
-
- /* gcregColorMultiplyModesRegAddrs:
- reserved */
- unsigned int _reserved_21_31:11;
-};
-
-/*******************************************************************************
-** State gcregPETransparency
-*/
-
-#define gcregPETransparencyRegAddrs 0x04B5
-#define GCREG_PE_TRANSPARENCY_MSB 15
-#define GCREG_PE_TRANSPARENCY_LSB 0
-#define GCREG_PE_TRANSPARENCY_BLK 0
-#define GCREG_PE_TRANSPARENCY_Count 1
-#define GCREG_PE_TRANSPARENCY_FieldMask 0xB3331333
-#define GCREG_PE_TRANSPARENCY_ReadMask 0xB3331333
-#define GCREG_PE_TRANSPARENCY_WriteMask 0xB3331333
-#define GCREG_PE_TRANSPARENCY_ResetValue 0x00000000
-
-/* Source transparency mode. */
-#define GCREG_PE_TRANSPARENCY_SOURCE 1 : 0
-#define GCREG_PE_TRANSPARENCY_SOURCE_End 1
-#define GCREG_PE_TRANSPARENCY_SOURCE_Start 0
-#define GCREG_PE_TRANSPARENCY_SOURCE_Type U02
-#define GCREG_PE_TRANSPARENCY_SOURCE_OPAQUE 0x0
-#define GCREG_PE_TRANSPARENCY_SOURCE_MASK 0x1
-#define GCREG_PE_TRANSPARENCY_SOURCE_KEY 0x2
-
-/* Pattern transparency mode. KEY transparency mode is reserved. */
-#define GCREG_PE_TRANSPARENCY_PATTERN 5 : 4
-#define GCREG_PE_TRANSPARENCY_PATTERN_End 5
-#define GCREG_PE_TRANSPARENCY_PATTERN_Start 4
-#define GCREG_PE_TRANSPARENCY_PATTERN_Type U02
-#define GCREG_PE_TRANSPARENCY_PATTERN_OPAQUE 0x0
-#define GCREG_PE_TRANSPARENCY_PATTERN_MASK 0x1
-#define GCREG_PE_TRANSPARENCY_PATTERN_KEY 0x2
-
-/* Destination transparency mode. MASK transparency mode is reserved. */
-#define GCREG_PE_TRANSPARENCY_DESTINATION 9 : 8
-#define GCREG_PE_TRANSPARENCY_DESTINATION_End 9
-#define GCREG_PE_TRANSPARENCY_DESTINATION_Start 8
-#define GCREG_PE_TRANSPARENCY_DESTINATION_Type U02
-#define GCREG_PE_TRANSPARENCY_DESTINATION_OPAQUE 0x0
-#define GCREG_PE_TRANSPARENCY_DESTINATION_MASK 0x1
-#define GCREG_PE_TRANSPARENCY_DESTINATION_KEY 0x2
-
-/* Mask field for Source/Pattern/Destination fields. */
-#define GCREG_PE_TRANSPARENCY_MASK_TRANSPARENCY 12 : 12
-#define GCREG_PE_TRANSPARENCY_MASK_TRANSPARENCY_End 12
-#define GCREG_PE_TRANSPARENCY_MASK_TRANSPARENCY_Start 12
-#define GCREG_PE_TRANSPARENCY_MASK_TRANSPARENCY_Type U01
-#define GCREG_PE_TRANSPARENCY_MASK_TRANSPARENCY_ENABLED 0x0
-#define GCREG_PE_TRANSPARENCY_MASK_TRANSPARENCY_MASKED 0x1
-
-/* Source usage override. */
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE 17 : 16
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE_End 17
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE_Start 16
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE_Type U02
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE_DEFAULT 0x0
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_PE_TRANSPARENCY_USE_SRC_OVERRIDE_USE_DISABLE 0x2
-
-/* Pattern usage override. */
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE 21 : 20
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE_End 21
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE_Start 20
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE_Type U02
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE_DEFAULT 0x0
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_PE_TRANSPARENCY_USE_PAT_OVERRIDE_USE_DISABLE 0x2
-
-/* Destination usage override. */
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE 25 : 24
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE_End 25
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE_Start 24
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE_Type U02
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE_DEFAULT 0x0
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_PE_TRANSPARENCY_USE_DST_OVERRIDE_USE_DISABLE 0x2
-
-/* 2D resource usage override mask field. */
-#define GCREG_PE_TRANSPARENCY_MASK_RESOURCE_OVERRIDE 28 : 28
-#define GCREG_PE_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_End 28
-#define GCREG_PE_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_Start 28
-#define GCREG_PE_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_Type U01
-#define GCREG_PE_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_ENABLED 0x0
-#define GCREG_PE_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_MASKED 0x1
-
-/* DEB Color Key. */
-#define GCREG_PE_TRANSPARENCY_DFB_COLOR_KEY 29 : 29
-#define GCREG_PE_TRANSPARENCY_DFB_COLOR_KEY_End 29
-#define GCREG_PE_TRANSPARENCY_DFB_COLOR_KEY_Start 29
-#define GCREG_PE_TRANSPARENCY_DFB_COLOR_KEY_Type U01
-#define GCREG_PE_TRANSPARENCY_DFB_COLOR_KEY_DISABLED 0x0
-#define GCREG_PE_TRANSPARENCY_DFB_COLOR_KEY_ENABLED 0x1
-
-#define GCREG_PE_TRANSPARENCY_MASK_DFB_COLOR_KEY 31 : 31
-#define GCREG_PE_TRANSPARENCY_MASK_DFB_COLOR_KEY_End 31
-#define GCREG_PE_TRANSPARENCY_MASK_DFB_COLOR_KEY_Start 31
-#define GCREG_PE_TRANSPARENCY_MASK_DFB_COLOR_KEY_Type U01
-#define GCREG_PE_TRANSPARENCY_MASK_DFB_COLOR_KEY_ENABLED 0x0
-#define GCREG_PE_TRANSPARENCY_MASK_DFB_COLOR_KEY_MASKED 0x1
-
-/*******************************************************************************
-** State gcregPEControl
-*/
-
-/* General purpose control register. */
-
-#define gcregPEControlRegAddrs 0x04B6
-#define GCREG_PE_CONTROL_MSB 15
-#define GCREG_PE_CONTROL_LSB 0
-#define GCREG_PE_CONTROL_BLK 0
-#define GCREG_PE_CONTROL_Count 1
-#define GCREG_PE_CONTROL_FieldMask 0x00000999
-#define GCREG_PE_CONTROL_ReadMask 0x00000999
-#define GCREG_PE_CONTROL_WriteMask 0x00000999
-#define GCREG_PE_CONTROL_ResetValue 0x00000000
-
-#define GCREG_PE_CONTROL_YUV 0 : 0
-#define GCREG_PE_CONTROL_YUV_End 0
-#define GCREG_PE_CONTROL_YUV_Start 0
-#define GCREG_PE_CONTROL_YUV_Type U01
-#define GCREG_PE_CONTROL_YUV_601 0x0
-#define GCREG_PE_CONTROL_YUV_709 0x1
-
-#define GCREG_PE_CONTROL_MASK_YUV 3 : 3
-#define GCREG_PE_CONTROL_MASK_YUV_End 3
-#define GCREG_PE_CONTROL_MASK_YUV_Start 3
-#define GCREG_PE_CONTROL_MASK_YUV_Type U01
-#define GCREG_PE_CONTROL_MASK_YUV_ENABLED 0x0
-#define GCREG_PE_CONTROL_MASK_YUV_MASKED 0x1
-
-#define GCREG_PE_CONTROL_UV_SWIZZLE 4 : 4
-#define GCREG_PE_CONTROL_UV_SWIZZLE_End 4
-#define GCREG_PE_CONTROL_UV_SWIZZLE_Start 4
-#define GCREG_PE_CONTROL_UV_SWIZZLE_Type U01
-#define GCREG_PE_CONTROL_UV_SWIZZLE_UV 0x0
-#define GCREG_PE_CONTROL_UV_SWIZZLE_VU 0x1
-
-#define GCREG_PE_CONTROL_MASK_UV_SWIZZLE 7 : 7
-#define GCREG_PE_CONTROL_MASK_UV_SWIZZLE_End 7
-#define GCREG_PE_CONTROL_MASK_UV_SWIZZLE_Start 7
-#define GCREG_PE_CONTROL_MASK_UV_SWIZZLE_Type U01
-#define GCREG_PE_CONTROL_MASK_UV_SWIZZLE_ENABLED 0x0
-#define GCREG_PE_CONTROL_MASK_UV_SWIZZLE_MASKED 0x1
-
-/* YUV to RGB convert enable */
-#define GCREG_PE_CONTROL_YUVRGB 8 : 8
-#define GCREG_PE_CONTROL_YUVRGB_End 8
-#define GCREG_PE_CONTROL_YUVRGB_Start 8
-#define GCREG_PE_CONTROL_YUVRGB_Type U01
-#define GCREG_PE_CONTROL_YUVRGB_DISABLED 0x0
-#define GCREG_PE_CONTROL_YUVRGB_ENABLED 0x1
-
-#define GCREG_PE_CONTROL_MASK_YUVRGB 11 : 11
-#define GCREG_PE_CONTROL_MASK_YUVRGB_End 11
-#define GCREG_PE_CONTROL_MASK_YUVRGB_Start 11
-#define GCREG_PE_CONTROL_MASK_YUVRGB_Type U01
-#define GCREG_PE_CONTROL_MASK_YUVRGB_ENABLED 0x0
-#define GCREG_PE_CONTROL_MASK_YUVRGB_MASKED 0x1
-
-struct gcregpecontrol {
- /* gcregPEControlRegAddrs:YUV */
- unsigned int standard:1;
-
- /* gcregPEControlRegAddrs:reserved */
- unsigned int _reserved_1_2:2;
-
- /* gcregPEControlRegAddrs:MASK_YUV */
- unsigned int standard_mask:1;
-
- /* gcregPEControlRegAddrs:UV_SWIZZLE */
- unsigned int swizzle:1;
-
- /* gcregPEControlRegAddrs:reserved */
- unsigned int _reserved_5_6:2;
-
- /* gcregPEControlRegAddrs:MASK_UV_SWIZZLE */
- unsigned int swizzle_mask:1;
-
- /* gcregPEControlRegAddrs:YUVRGB */
- unsigned int convert:1;
-
- /* gcregPEControlRegAddrs:reserved */
- unsigned int _reserved_9_10:2;
-
- /* gcregPEControlRegAddrs:MASK_YUVRGB */
- unsigned int convert_mask:1;
-
- /* gcregPEControlRegAddrs:reserved */
- unsigned int _reserved_12_31:20;
-};
-
-/*******************************************************************************
-** State gcregSrcColorKeyHigh
-*/
-
-/* Defines the source transparency color in source format. */
-
-#define gcregSrcColorKeyHighRegAddrs 0x04B7
-#define GCREG_SRC_COLOR_KEY_HIGH_Address 0x012DC
-#define GCREG_SRC_COLOR_KEY_HIGH_MSB 15
-#define GCREG_SRC_COLOR_KEY_HIGH_LSB 0
-#define GCREG_SRC_COLOR_KEY_HIGH_BLK 0
-#define GCREG_SRC_COLOR_KEY_HIGH_Count 1
-#define GCREG_SRC_COLOR_KEY_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_KEY_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_KEY_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_SRC_COLOR_KEY_HIGH_ResetValue 0x00000000
-
-#define GCREG_SRC_COLOR_KEY_HIGH_ALPHA 31 : 24
-#define GCREG_SRC_COLOR_KEY_HIGH_ALPHA_End 31
-#define GCREG_SRC_COLOR_KEY_HIGH_ALPHA_Start 24
-#define GCREG_SRC_COLOR_KEY_HIGH_ALPHA_Type U08
-
-#define GCREG_SRC_COLOR_KEY_HIGH_RED 23 : 16
-#define GCREG_SRC_COLOR_KEY_HIGH_RED_End 23
-#define GCREG_SRC_COLOR_KEY_HIGH_RED_Start 16
-#define GCREG_SRC_COLOR_KEY_HIGH_RED_Type U08
-
-#define GCREG_SRC_COLOR_KEY_HIGH_GREEN 15 : 8
-#define GCREG_SRC_COLOR_KEY_HIGH_GREEN_End 15
-#define GCREG_SRC_COLOR_KEY_HIGH_GREEN_Start 8
-#define GCREG_SRC_COLOR_KEY_HIGH_GREEN_Type U08
-
-#define GCREG_SRC_COLOR_KEY_HIGH_BLUE 7 : 0
-#define GCREG_SRC_COLOR_KEY_HIGH_BLUE_End 7
-#define GCREG_SRC_COLOR_KEY_HIGH_BLUE_Start 0
-#define GCREG_SRC_COLOR_KEY_HIGH_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregDestColorKeyHigh
-*/
-
-/* Defines the destination transparency color in destination format. */
-
-#define gcregDestColorKeyHighRegAddrs 0x04B8
-#define GCREG_DEST_COLOR_KEY_HIGH_MSB 15
-#define GCREG_DEST_COLOR_KEY_HIGH_LSB 0
-#define GCREG_DEST_COLOR_KEY_HIGH_BLK 0
-#define GCREG_DEST_COLOR_KEY_HIGH_Count 1
-#define GCREG_DEST_COLOR_KEY_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_DEST_COLOR_KEY_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_DEST_COLOR_KEY_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_DEST_COLOR_KEY_HIGH_ResetValue 0x00000000
-
-#define GCREG_DEST_COLOR_KEY_HIGH_ALPHA 31 : 24
-#define GCREG_DEST_COLOR_KEY_HIGH_ALPHA_End 31
-#define GCREG_DEST_COLOR_KEY_HIGH_ALPHA_Start 24
-#define GCREG_DEST_COLOR_KEY_HIGH_ALPHA_Type U08
-
-#define GCREG_DEST_COLOR_KEY_HIGH_RED 23 : 16
-#define GCREG_DEST_COLOR_KEY_HIGH_RED_End 23
-#define GCREG_DEST_COLOR_KEY_HIGH_RED_Start 16
-#define GCREG_DEST_COLOR_KEY_HIGH_RED_Type U08
-
-#define GCREG_DEST_COLOR_KEY_HIGH_GREEN 15 : 8
-#define GCREG_DEST_COLOR_KEY_HIGH_GREEN_End 15
-#define GCREG_DEST_COLOR_KEY_HIGH_GREEN_Start 8
-#define GCREG_DEST_COLOR_KEY_HIGH_GREEN_Type U08
-
-#define GCREG_DEST_COLOR_KEY_HIGH_BLUE 7 : 0
-#define GCREG_DEST_COLOR_KEY_HIGH_BLUE_End 7
-#define GCREG_DEST_COLOR_KEY_HIGH_BLUE_Start 0
-#define GCREG_DEST_COLOR_KEY_HIGH_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregPEDitherLow
-*/
-
-/* PE dither register.
-** If you don't want dither, set all fields to their reset values.
-*/
-
-#define gcregPEDitherLowRegAddrs 0x04BA
-#define GCREG_PE_DITHER_LOW_MSB 15
-#define GCREG_PE_DITHER_LOW_LSB 0
-#define GCREG_PE_DITHER_LOW_BLK 0
-#define GCREG_PE_DITHER_LOW_Count 1
-#define GCREG_PE_DITHER_LOW_FieldMask 0xFFFFFFFF
-#define GCREG_PE_DITHER_LOW_ReadMask 0xFFFFFFFF
-#define GCREG_PE_DITHER_LOW_WriteMask 0xFFFFFFFF
-#define GCREG_PE_DITHER_LOW_ResetValue 0xFFFFFFFF
-
-/* X,Y = 0,0 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y0 3 : 0
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y0_End 3
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y0_Start 0
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y0_Type U04
-
-/* X,Y = 1,0 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y0 7 : 4
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y0_End 7
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y0_Start 4
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y0_Type U04
-
-/* X,Y = 2,0 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y0 11 : 8
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y0_End 11
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y0_Start 8
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y0_Type U04
-
-/* X,Y = 3,0 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y0 15 : 12
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y0_End 15
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y0_Start 12
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y0_Type U04
-
-/* X,Y = 0,1 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y1 19 : 16
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y1_End 19
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y1_Start 16
-#define GCREG_PE_DITHER_LOW_PIXEL_X0_Y1_Type U04
-
-/* X,Y = 1,1 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y1 23 : 20
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y1_End 23
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y1_Start 20
-#define GCREG_PE_DITHER_LOW_PIXEL_X1_Y1_Type U04
-
-/* X,Y = 2,1 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y1 27 : 24
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y1_End 27
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y1_Start 24
-#define GCREG_PE_DITHER_LOW_PIXEL_X2_Y1_Type U04
-
-/* X,Y = 3,1 */
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y1 31 : 28
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y1_End 31
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y1_Start 28
-#define GCREG_PE_DITHER_LOW_PIXEL_X3_Y1_Type U04
-
-/*******************************************************************************
-** State gcregPEDitherHigh
-*/
-
-#define gcregPEDitherHighRegAddrs 0x04BB
-#define GCREG_PE_DITHER_HIGH_MSB 15
-#define GCREG_PE_DITHER_HIGH_LSB 0
-#define GCREG_PE_DITHER_LOW_HIGH_BLK 0
-#define GCREG_PE_DITHER_HIGH_Count 1
-#define GCREG_PE_DITHER_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_PE_DITHER_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_PE_DITHER_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_PE_DITHER_HIGH_ResetValue 0xFFFFFFFF
-
-/* X,Y = 0,2 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y2 3 : 0
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y2_End 3
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y2_Start 0
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y2_Type U04
-
-/* X,Y = 1,2 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y2 7 : 4
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y2_End 7
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y2_Start 4
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y2_Type U04
-
-/* X,Y = 2,2 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y2 11 : 8
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y2_End 11
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y2_Start 8
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y2_Type U04
-
-/* X,Y = 0,3 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y2 15 : 12
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y2_End 15
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y2_Start 12
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y2_Type U04
-
-/* X,Y = 1,3 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y3 19 : 16
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y3_End 19
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y3_Start 16
-#define GCREG_PE_DITHER_HIGH_PIXEL_X0_Y3_Type U04
-
-/* X,Y = 2,3 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y3 23 : 20
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y3_End 23
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y3_Start 20
-#define GCREG_PE_DITHER_HIGH_PIXEL_X1_Y3_Type U04
-
-/* X,Y = 3,3 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y3 27 : 24
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y3_End 27
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y3_Start 24
-#define GCREG_PE_DITHER_HIGH_PIXEL_X2_Y3_Type U04
-
-/* X,Y = 3,2 */
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y3 31 : 28
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y3_End 31
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y3_Start 28
-#define GCREG_PE_DITHER_HIGH_PIXEL_X3_Y3_Type U04
-
-/*******************************************************************************
-** State gcregSrcExConfig
-*/
-
-#define gcregSrcExConfigRegAddrs 0x04C0
-#define GCREG_SRC_EX_CONFIG_MSB 15
-#define GCREG_SRC_EX_CONFIG_LSB 0
-#define GCREG_SRC_EX_CONFIG_BLK 0
-#define GCREG_SRC_EX_CONFIG_Count 1
-#define GCREG_SRC_EX_CONFIG_FieldMask 0x00000109
-#define GCREG_SRC_EX_CONFIG_ReadMask 0x00000109
-#define GCREG_SRC_EX_CONFIG_WriteMask 0x00000109
-#define GCREG_SRC_EX_CONFIG_ResetValue 0x00000000
-
-/* Source multi tiled address computation control. */
-#define GCREG_SRC_EX_CONFIG_MULTI_TILED 0 : 0
-#define GCREG_SRC_EX_CONFIG_MULTI_TILED_End 0
-#define GCREG_SRC_EX_CONFIG_MULTI_TILED_Start 0
-#define GCREG_SRC_EX_CONFIG_MULTI_TILED_Type U01
-#define GCREG_SRC_EX_CONFIG_MULTI_TILED_DISABLED 0x0
-#define GCREG_SRC_EX_CONFIG_MULTI_TILED_ENABLED 0x1
-
-/* Source super tiled address computation control. */
-#define GCREG_SRC_EX_CONFIG_SUPER_TILED 3 : 3
-#define GCREG_SRC_EX_CONFIG_SUPER_TILED_End 3
-#define GCREG_SRC_EX_CONFIG_SUPER_TILED_Start 3
-#define GCREG_SRC_EX_CONFIG_SUPER_TILED_Type U01
-#define GCREG_SRC_EX_CONFIG_SUPER_TILED_DISABLED 0x0
-#define GCREG_SRC_EX_CONFIG_SUPER_TILED_ENABLED 0x1
-
-/* Source super tiled address computation control. */
-#define GCREG_SRC_EX_CONFIG_MINOR_TILED 8 : 8
-#define GCREG_SRC_EX_CONFIG_MINOR_TILED_End 8
-#define GCREG_SRC_EX_CONFIG_MINOR_TILED_Start 8
-#define GCREG_SRC_EX_CONFIG_MINOR_TILED_Type U01
-#define GCREG_SRC_EX_CONFIG_MINOR_TILED_DISABLED 0x0
-#define GCREG_SRC_EX_CONFIG_MINOR_TILED_ENABLED 0x1
-
-/* Source CacheMode. */
-#define GCREG_SRC_SRC_EX_CONFIG_CACHE_MODE 12 : 12
-#define GCREG_SRC_SRC_EX_CONFIG_CACHE_MODE_End 12
-#define GCREG_SRC_SRC_EX_CONFIG_CACHE_MODE_Start 12
-#define GCREG_SRC_SRC_EX_CONFIG_CACHE_MODE_Type U01
-#define GCREG_SRC_SRC_EX_CONFIG_CACHE_MODE_DISABLED 0x0
-#define GCREG_SRC_SRC_EX_CONFIG_CACHE_MODE_ENABLED 0x1
-
-/*******************************************************************************
-** State gcregSrcExAddress
-*/
-
-/* 32-bit aligned base address of the source extra surface. */
-
-#define gcregSrcExAddressRegAddrs 0x04C1
-#define GCREG_SRC_EX_ADDRESS_MSB 15
-#define GCREG_SRC_EX_ADDRESS_LSB 0
-#define GCREG_SRC_EX_ADDRESS_BLK 0
-#define GCREG_SRC_EX_ADDRESS_Count 1
-#define GCREG_SRC_EX_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_SRC_EX_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_SRC_EX_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_SRC_EX_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_SRC_EX_ADDRESS_ADDRESS 31 : 0
-#define GCREG_SRC_EX_ADDRESS_ADDRESS_End 30
-#define GCREG_SRC_EX_ADDRESS_ADDRESS_Start 0
-#define GCREG_SRC_EX_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregDEMultiSource
-*/
-
-/* MutiSource control register. */
-
-#define gcregDEMultiSourceRegAddrs 0x04C2
-#define GCREG_DE_MULTI_SOURCE_MSB 15
-#define GCREG_DE_MULTI_SOURCE_LSB 0
-#define GCREG_DE_MULTI_SOURCE_BLK 0
-#define GCREG_DE_MULTI_SOURCE_Count 1
-#define GCREG_DE_MULTI_SOURCE_FieldMask 0x00070707
-#define GCREG_DE_MULTI_SOURCE_ReadMask 0x00070707
-#define GCREG_DE_MULTI_SOURCE_WriteMask 0x00070707
-#define GCREG_DE_MULTI_SOURCE_ResetValue 0x00000000
-
-/* Number of source surfaces minus 1. */
-#define GCREG_DE_MULTI_SOURCE_MAX_SOURCE 2 : 0
-#define GCREG_DE_MULTI_SOURCE_MAX_SOURCE_End 2
-#define GCREG_DE_MULTI_SOURCE_MAX_SOURCE_Start 0
-#define GCREG_DE_MULTI_SOURCE_MAX_SOURCE_Type U03
-
-/* Number of pixels for horizontal block walker. */
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK 10 : 8
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_End 10
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_Start 8
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_Type U03
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL16 0x0
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL32 0x1
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL64 0x2
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL128 0x3
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL256 0x4
-#define GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK_PIXEL512 0x5
-
-/* Number of lines for vertical block walker. */
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK 18 : 16
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_End 18
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_Start 16
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_Type U03
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE1 0x0
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE2 0x1
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE4 0x2
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE8 0x3
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE16 0x4
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE32 0x5
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE64 0x6
-#define GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK_LINE128 0x7
-
-struct gcregmultisource {
- /* gcregDEMultiSourceRegAddrs:GCREG_DE_MULTI_SOURCE_MAX_SOURCE */
- unsigned int srccount:3;
-
- /* gcregDEMultiSourceRegAddrs:reserved */
- unsigned int _reserved_3_7:5;
-
- /* gcregDEMultiSourceRegAddrs:GCREG_DE_MULTI_SOURCE_HORIZONTAL_BLOCK */
- unsigned int horblock:3;
-
- /* gcregDEMultiSourceRegAddrs:reserved */
- unsigned int _reserved_11_15:5;
-
- /* gcregDEMultiSourceRegAddrs:GCREG_DE_MULTI_SOURCE_VERTICAL_BLOCK */
- unsigned int verblock:3;
-
- /* gcregDEMultiSourceRegAddrs:reserved */
- unsigned int _reserved_19_31:13;
-};
-
-/*******************************************************************************
-** State gcregDEYUVConversion
-*/
-
-/* Configure the YUV to YUV conversion. */
-
-#define gcregDEYUVConversionRegAddrs 0x04C3
-#define GCREG_DEYUV_CONVERSION_MSB 15
-#define GCREG_DEYUV_CONVERSION_LSB 0
-#define GCREG_DEYUV_CONVERSION_BLK 0
-#define GCREG_DEYUV_CONVERSION_Count 1
-#define GCREG_DEYUV_CONVERSION_FieldMask 0xFFFFFFFF
-#define GCREG_DEYUV_CONVERSION_ReadMask 0xFFFFFFFF
-#define GCREG_DEYUV_CONVERSION_WriteMask 0xFFFFFFFF
-#define GCREG_DEYUV_CONVERSION_ResetValue 0x00000000
-
-/* Select the number of planes we need to process. */
-#define GCREG_DEYUV_CONVERSION_ENABLE 1 : 0
-#define GCREG_DEYUV_CONVERSION_ENABLE_End 1
-#define GCREG_DEYUV_CONVERSION_ENABLE_Start 0
-#define GCREG_DEYUV_CONVERSION_ENABLE_Type U02
-/* YUV to YUV conversion is turned off. */
-#define GCREG_DEYUV_CONVERSION_ENABLE_OFF 0x0
-/* YUV to YUV conversion is writing to 1 plane. */
-#define GCREG_DEYUV_CONVERSION_ENABLE_PLANE1 0x1
-/* YUV to YUV conversion is writing to 2 planes. */
-#define GCREG_DEYUV_CONVERSION_ENABLE_PLANE2 0x2
-/* YUV to YUV conversion is writing to 3 planes. */
-#define GCREG_DEYUV_CONVERSION_ENABLE_PLANE3 0x3
-
-/* Number of channels to process - 1 for plane 1. */
-#define GCREG_DEYUV_CONVERSION_PLANE1_COUNT 3 : 2
-#define GCREG_DEYUV_CONVERSION_PLANE1_COUNT_End 3
-#define GCREG_DEYUV_CONVERSION_PLANE1_COUNT_Start 2
-#define GCREG_DEYUV_CONVERSION_PLANE1_COUNT_Type U02
-
-/* Number of channels to process - 1 for plane 2. */
-#define GCREG_DEYUV_CONVERSION_PLANE2_COUNT 5 : 4
-#define GCREG_DEYUV_CONVERSION_PLANE2_COUNT_End 5
-#define GCREG_DEYUV_CONVERSION_PLANE2_COUNT_Start 4
-#define GCREG_DEYUV_CONVERSION_PLANE2_COUNT_Type U02
-
-/* Number of channels to process - 1 for plane 3. */
-#define GCREG_DEYUV_CONVERSION_PLANE3_COUNT 7 : 6
-#define GCREG_DEYUV_CONVERSION_PLANE3_COUNT_End 7
-#define GCREG_DEYUV_CONVERSION_PLANE3_COUNT_Start 6
-#define GCREG_DEYUV_CONVERSION_PLANE3_COUNT_Type U02
-
-/* Select which color channel to pick for B channel for plane 1. */
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B 9 : 8
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_End 9
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_Start 8
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_B_ALPHA 0x3
-
-/* Select which color channel to pick for G channel for plane 1. */
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G 11 : 10
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_End 11
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_Start 10
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_G_ALPHA 0x3
-
-/* Select which color channel to pick for R channel for plane 1. */
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R 13 : 12
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_End 13
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_Start 12
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_R_ALPHA 0x3
-
-/* Select which color channel to pick for A channel for plane 1. */
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A 15 : 14
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_End 15
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_Start 14
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE1_SWIZZLE_A_ALPHA 0x3
-
-/* Select which color channel to pick for B channel for plane 2. */
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B 17 : 16
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_End 17
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_Start 16
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_B_ALPHA 0x3
-
-/* Select which color channel to pick for G channel for plane 2. */
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G 19 : 18
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_End 19
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_Start 18
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_G_ALPHA 0x3
-
-/* Select which color channel to pick for R channel for plane 2. */
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R 21 : 20
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_End 21
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_Start 20
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_R_ALPHA 0x3
-
-/* Select which color channel to pick for A channel for plane 2. */
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A 23 : 22
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_End 23
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_Start 22
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE2_SWIZZLE_A_ALPHA 0x3
-
-/* Select which color channel to pick for B channel for plane 3. */
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B 25 : 24
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_End 25
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_Start 24
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_B_ALPHA 0x3
-
-/* Select which color channel to pick for G channel for plane 3. */
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G 27 : 26
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_End 27
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_Start 26
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_G_ALPHA 0x3
-
-/* Select which color channel to pick for R channel for plane 3. */
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R 29 : 28
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_End 29
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_Start 28
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_R_ALPHA 0x3
-
-/* Select which color channel to pick for A channel for plane 3. */
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A 31 : 30
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_End 31
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_Start 30
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_Type U02
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_BLUE 0x0
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_GREEN 0x1
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_RED 0x2
-#define GCREG_DEYUV_CONVERSION_PLANE3_SWIZZLE_A_ALPHA 0x3
-
-/*******************************************************************************
-** State gcregDEPlane2Address
-*/
-
-/* Address for plane 2 if gcregDEYUVConversion.
-** Enable is set to Plane2 or Plane3.
-*/
-
-#define gcregDEPlane2AddressRegAddrs 0x04C4
-#define GCREG_DE_PLANE2_ADDRESS_Address 0x01310
-#define GCREG_DE_PLANE2_ADDRESS_MSB 15
-#define GCREG_DE_PLANE2_ADDRESS_LSB 0
-#define GCREG_DE_PLANE2_ADDRESS_BLK 0
-#define GCREG_DE_PLANE2_ADDRESS_Count 1
-#define GCREG_DE_PLANE2_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_DE_PLANE2_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_DE_PLANE2_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_DE_PLANE2_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_DE_PLANE2_ADDRESS_ADDRESS 31 : 0
-#define GCREG_DE_PLANE2_ADDRESS_ADDRESS_End 30
-#define GCREG_DE_PLANE2_ADDRESS_ADDRESS_Start 0
-#define GCREG_DE_PLANE2_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregDEPlane2Stride
-*/
-
-/* Stride for plane 2 if gcregDEYUVConversion.
-** Enable is set to Plane2 or Plane3.
-*/
-
-#define gcregDEPlane2StrideRegAddrs 0x04C5
-#define GCREG_DE_PLANE2_STRIDE_MSB 15
-#define GCREG_DE_PLANE2_STRIDE_LSB 0
-#define GCREG_DE_PLANE2_STRIDE_BLK 0
-#define GCREG_DE_PLANE2_STRIDE_Count 1
-#define GCREG_DE_PLANE2_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_DE_PLANE2_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_DE_PLANE2_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_DE_PLANE2_STRIDE_ResetValue 0x00000000
-
-#define GCREG_DE_PLANE2_STRIDE_STRIDE 17 : 0
-#define GCREG_DE_PLANE2_STRIDE_STRIDE_End 17
-#define GCREG_DE_PLANE2_STRIDE_STRIDE_Start 0
-#define GCREG_DE_PLANE2_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregDEPlane3Address
-*/
-
-/* Address for plane 3 if gcregDEYUVConversion.
-** Enable is set to Plane3.
-*/
-
-#define gcregDEPlane3AddressRegAddrs 0x04C6
-#define GCREG_DE_PLANE3_ADDRESS_MSB 15
-#define GCREG_DE_PLANE3_ADDRESS_LSB 0
-#define GCREG_DE_PLANE3_ADDRESS_BLK 0
-#define GCREG_DE_PLANE3_ADDRESS_Count 1
-#define GCREG_DE_PLANE3_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_DE_PLANE3_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_DE_PLANE3_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_DE_PLANE3_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_DE_PLANE3_ADDRESS_ADDRESS 31 : 0
-#define GCREG_DE_PLANE3_ADDRESS_ADDRESS_End 30
-#define GCREG_DE_PLANE3_ADDRESS_ADDRESS_Start 0
-#define GCREG_DE_PLANE3_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregDEPlane3Stride
-*/
-
-/* Stride for plane 3 if gcregDEYUVConversion.
-** Enable is set to Plane3.
-*/
-
-#define gcregDEPlane3StrideRegAddrs 0x04C7
-#define GCREG_DE_PLANE3_STRIDE_MSB 15
-#define GCREG_DE_PLANE3_STRIDE_LSB 0
-#define GCREG_DE_PLANE3_STRIDE_BLK 0
-#define GCREG_DE_PLANE3_STRIDE_Count 1
-#define GCREG_DE_PLANE3_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_DE_PLANE3_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_DE_PLANE3_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_DE_PLANE3_STRIDE_ResetValue 0x00000000
-
-#define GCREG_DE_PLANE3_STRIDE_STRIDE 17 : 0
-#define GCREG_DE_PLANE3_STRIDE_STRIDE_End 17
-#define GCREG_DE_PLANE3_STRIDE_STRIDE_Start 0
-#define GCREG_DE_PLANE3_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregDEStallDE
-*/
-
-#define gcregDEStallDERegAddrs 0x04C8
-#define GCREG_DE_STALL_DE_MSB 15
-#define GCREG_DE_STALL_DE_LSB 0
-#define GCREG_DE_STALL_DE_BLK 0
-#define GCREG_DE_STALL_DE_Count 1
-#define GCREG_DE_STALL_DE_FieldMask 0x00000001
-#define GCREG_DE_STALL_DE_ReadMask 0x00000001
-#define GCREG_DE_STALL_DE_WriteMask 0x00000001
-#define GCREG_DE_STALL_DE_ResetValue 0x00000000
-
-/* Stall de enable. */
-#define GCREG_DE_STALL_DE_ENABLE 0 : 0
-#define GCREG_DE_STALL_DE_ENABLE_End 0
-#define GCREG_DE_STALL_DE_ENABLE_Start 0
-#define GCREG_DE_STALL_DE_ENABLE_Type U01
-#define GCREG_DE_STALL_DE_ENABLE_DISABLED 0x0
-#define GCREG_DE_STALL_DE_ENABLE_ENABLED 0x1
-
-/*******************************************************************************
-** State gcregBlock4SrcAddress
-*/
-
-/* 32-bit aligned base address of the source surface. */
-
-#define gcregBlock4SrcAddressRegAddrs 0x4A00
-#define GCREG_BLOCK4_SRC_ADDRESS_MSB 15
-#define GCREG_BLOCK4_SRC_ADDRESS_LSB 2
-#define GCREG_BLOCK4_SRC_ADDRESS_BLK 0
-#define GCREG_BLOCK4_SRC_ADDRESS_Count 4
-#define GCREG_BLOCK4_SRC_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK4_SRC_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK4_SRC_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK4_SRC_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK4_SRC_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK4_SRC_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock4SrcStride
-*/
-
-/* Stride of the source surface in bytes. To calculate the stride multiply
-** the surface width in pixels by the number of bytes per pixel.
-*/
-
-#define gcregBlock4SrcStrideRegAddrs 0x4A04
-#define GCREG_BLOCK4_SRC_STRIDE_MSB 15
-#define GCREG_BLOCK4_SRC_STRIDE_LSB 2
-#define GCREG_BLOCK4_SRC_STRIDE_BLK 0
-#define GCREG_BLOCK4_SRC_STRIDE_Count 4
-#define GCREG_BLOCK4_SRC_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_BLOCK4_SRC_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_BLOCK4_SRC_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_BLOCK4_SRC_STRIDE_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_STRIDE_STRIDE 17 : 0
-#define GCREG_BLOCK4_SRC_STRIDE_STRIDE_End 17
-#define GCREG_BLOCK4_SRC_STRIDE_STRIDE_Start 0
-#define GCREG_BLOCK4_SRC_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregBlock4SrcRotationConfig
-*/
-
-/* 90 degree rotation configuration for the source surface. Width field
-** specifies the width of the surface in pixels.
-*/
-
-#define gcregBlock4SrcRotationConfigRegAddrs 0x4A08
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_MSB 15
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_LSB 2
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_BLK 0
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_Count 4
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_FieldMask 0x0001FFFF
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ReadMask 0x0001FFFF
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_WriteMask 0x0001FFFF
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_WIDTH 15 : 0
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_WIDTH_End 15
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_WIDTH_Start 0
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_WIDTH_Type U16
-
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ROTATION 16 : 16
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ROTATION_End 16
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ROTATION_Start 16
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ROTATION_Type U01
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ROTATION_DISABLE 0x0
-#define GCREG_BLOCK4_SRC_ROTATION_CONFIG_ROTATION_ENABLE 0x1
-
-/*******************************************************************************
-** State gcregBlock4SrcConfig
-*/
-
-/* Source surface configuration register. */
-
-#define gcregBlock4SrcConfigRegAddrs 0x4A0C
-#define GCREG_BLOCK4_SRC_CONFIG_MSB 15
-#define GCREG_BLOCK4_SRC_CONFIG_LSB 2
-#define GCREG_BLOCK4_SRC_CONFIG_BLK 0
-#define GCREG_BLOCK4_SRC_CONFIG_Count 4
-#define GCREG_BLOCK4_SRC_CONFIG_FieldMask 0xDF30B1C0
-#define GCREG_BLOCK4_SRC_CONFIG_ReadMask 0xDF30B1C0
-#define GCREG_BLOCK4_SRC_CONFIG_WriteMask 0xDF30B1C0
-#define GCREG_BLOCK4_SRC_CONFIG_ResetValue 0x00000000
-
-/* Control source endianess. */
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL 31 : 30
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL_End 31
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL_Start 30
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL_Type U02
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL_NO_SWAP 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL_SWAP_WORD 0x1
-#define GCREG_BLOCK4_SRC_CONFIG_ENDIAN_CONTROL_SWAP_DWORD 0x2
-
-/* Defines the pixel format of the source surface. */
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT 28 : 24
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_End 28
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_Start 24
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_Type U05
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_X4R4G4B4 0x00
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_A4R4G4B4 0x01
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_X1R5G5B5 0x02
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_A1R5G5B5 0x03
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_R5G6B5 0x04
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_X8R8G8B8 0x05
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_A8R8G8B8 0x06
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_YUY2 0x07
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_UYVY 0x08
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_INDEX8 0x09
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_MONOCHROME 0x0A
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_YV12 0x0F
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_A8 0x10
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_NV12 0x11
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_NV16 0x12
-#define GCREG_BLOCK4_SRC_CONFIG_SOURCE_FORMAT_RG16 0x13
-
-/* Color channel swizzles. */
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE 21 : 20
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_End 21
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_Start 20
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_Type U02
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_ARGB 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_RGBA 0x1
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_ABGR 0x2
-#define GCREG_BLOCK4_SRC_CONFIG_SWIZZLE_BGRA 0x3
-
-/* Mono expansion: if 0, transparency color will be 0, otherwise transparency **
-** color will be 1. */
-#define GCREG_BLOCK4_SRC_CONFIG_MONO_TRANSPARENCY 15 : 15
-#define GCREG_BLOCK4_SRC_CONFIG_MONO_TRANSPARENCY_End 15
-#define GCREG_BLOCK4_SRC_CONFIG_MONO_TRANSPARENCY_Start 15
-#define GCREG_BLOCK4_SRC_CONFIG_MONO_TRANSPARENCY_Type U01
-#define GCREG_BLOCK4_SRC_CONFIG_MONO_TRANSPARENCY_BACKGROUND 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_MONO_TRANSPARENCY_FOREGROUND 0x1
-
-/* Mono expansion or masked blit: stream packing in pixels. Determines how **
-** many horizontal pixels are there per each 32-bit chunk. For example, if **
-** set to Packed8, each 32-bit chunk is 8-pixel wide, which also means that **
-** it defines 4 vertical lines of pixels. */
-#define GCREG_BLOCK4_SRC_CONFIG_PACK 13 : 12
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_End 13
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_Start 12
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_Type U02
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_PACKED8 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_PACKED16 0x1
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_PACKED32 0x2
-#define GCREG_BLOCK4_SRC_CONFIG_PACK_UNPACKED 0x3
-
-/* Source data location: set to STREAM for mono expansion blits or masked **
-** blits. For mono expansion blits the complete bitmap comes from the command **
-** stream. For masked blits the source data comes from the memory and the **
-** mask from the command stream. */
-#define GCREG_BLOCK4_SRC_CONFIG_LOCATION 8 : 8
-#define GCREG_BLOCK4_SRC_CONFIG_LOCATION_End 8
-#define GCREG_BLOCK4_SRC_CONFIG_LOCATION_Start 8
-#define GCREG_BLOCK4_SRC_CONFIG_LOCATION_Type U01
-#define GCREG_BLOCK4_SRC_CONFIG_LOCATION_MEMORY 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_LOCATION_STREAM 0x1
-
-/* Source linear/tiled address computation control. */
-#define GCREG_BLOCK4_SRC_CONFIG_TILED 7 : 7
-#define GCREG_BLOCK4_SRC_CONFIG_TILED_End 7
-#define GCREG_BLOCK4_SRC_CONFIG_TILED_Start 7
-#define GCREG_BLOCK4_SRC_CONFIG_TILED_Type U01
-#define GCREG_BLOCK4_SRC_CONFIG_TILED_DISABLED 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_TILED_ENABLED 0x1
-
-/* If set to ABSOLUTE, the source coordinates are treated as absolute **
-** coordinates inside the source surface. If set to RELATIVE, the source **
-** coordinates are treated as the offsets from the destination coordinates **
-** with the source size equal to the size of the destination. */
-#define GCREG_BLOCK4_SRC_CONFIG_SRC_RELATIVE 6 : 6
-#define GCREG_BLOCK4_SRC_CONFIG_SRC_RELATIVE_End 6
-#define GCREG_BLOCK4_SRC_CONFIG_SRC_RELATIVE_Start 6
-#define GCREG_BLOCK4_SRC_CONFIG_SRC_RELATIVE_Type U01
-#define GCREG_BLOCK4_SRC_CONFIG_SRC_RELATIVE_ABSOLUTE 0x0
-#define GCREG_BLOCK4_SRC_CONFIG_SRC_RELATIVE_RELATIVE 0x1
-
-/*******************************************************************************
-** State gcregBlock4SrcOrigin
-*/
-
-/* Absolute or relative (see SRC_RELATIVE field of gcregBlock4SrcConfig
-** register) X and Y coordinates in pixels of the top left corner of the
-** source rectangle within the source surface.
-*/
-
-#define gcregBlock4SrcOriginRegAddrs 0x4A10
-#define GCREG_BLOCK4_SRC_ORIGIN_MSB 15
-#define GCREG_BLOCK4_SRC_ORIGIN_LSB 2
-#define GCREG_BLOCK4_SRC_ORIGIN_BLK 0
-#define GCREG_BLOCK4_SRC_ORIGIN_Count 4
-#define GCREG_BLOCK4_SRC_ORIGIN_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_ORIGIN_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_ORIGIN_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_ORIGIN_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_ORIGIN_Y 31 : 16
-#define GCREG_BLOCK4_SRC_ORIGIN_Y_End 31
-#define GCREG_BLOCK4_SRC_ORIGIN_Y_Start 16
-#define GCREG_BLOCK4_SRC_ORIGIN_Y_Type U16
-
-#define GCREG_BLOCK4_SRC_ORIGIN_X 15 : 0
-#define GCREG_BLOCK4_SRC_ORIGIN_X_End 15
-#define GCREG_BLOCK4_SRC_ORIGIN_X_Start 0
-#define GCREG_BLOCK4_SRC_ORIGIN_X_Type U16
-
-/*******************************************************************************
-** State gcregBlock4SrcSize
-*/
-
-/* Width and height of the source rectangle in pixels. If the source is
-** relative (see SRC_RELATIVE field of gcregBlock4SrcConfig register) or a
-** regular bitblt is being performed without stretching, this register is
-** ignored and the source size is assumed to be the same as the destination.
-*/
-
-#define gcregBlock4SrcSizeRegAddrs 0x4A14
-#define GCREG_BLOCK4_SRC_SIZE_MSB 15
-#define GCREG_BLOCK4_SRC_SIZE_LSB 2
-#define GCREG_BLOCK4_SRC_SIZE_BLK 0
-#define GCREG_BLOCK4_SRC_SIZE_Count 4
-#define GCREG_BLOCK4_SRC_SIZE_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_SIZE_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_SIZE_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_SIZE_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_SIZE_Y 31 : 16
-#define GCREG_BLOCK4_SRC_SIZE_Y_End 31
-#define GCREG_BLOCK4_SRC_SIZE_Y_Start 16
-#define GCREG_BLOCK4_SRC_SIZE_Y_Type U16
-
-#define GCREG_BLOCK4_SRC_SIZE_X 15 : 0
-#define GCREG_BLOCK4_SRC_SIZE_X_End 15
-#define GCREG_BLOCK4_SRC_SIZE_X_Start 0
-#define GCREG_BLOCK4_SRC_SIZE_X_Type U16
-
-/*******************************************************************************
-** State gcregBlock4SrcColorBg
-*/
-
-/* Select the color where source becomes transparent. It must be programmed
-** in A8R8G8B8 format.
-*/
-
-#define gcregBlock4SrcColorBgRegAddrs 0x4A18
-#define GCREG_BLOCK4_SRC_COLOR_BG_MSB 15
-#define GCREG_BLOCK4_SRC_COLOR_BG_LSB 2
-#define GCREG_BLOCK4_SRC_COLOR_BG_BLK 0
-#define GCREG_BLOCK4_SRC_COLOR_BG_Count 4
-#define GCREG_BLOCK4_SRC_COLOR_BG_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_COLOR_BG_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_COLOR_BG_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_COLOR_BG_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_COLOR_BG_ALPHA 31 : 24
-#define GCREG_BLOCK4_SRC_COLOR_BG_ALPHA_End 31
-#define GCREG_BLOCK4_SRC_COLOR_BG_ALPHA_Start 24
-#define GCREG_BLOCK4_SRC_COLOR_BG_ALPHA_Type U08
-
-#define GCREG_BLOCK4_SRC_COLOR_BG_RED 23 : 16
-#define GCREG_BLOCK4_SRC_COLOR_BG_RED_End 23
-#define GCREG_BLOCK4_SRC_COLOR_BG_RED_Start 16
-#define GCREG_BLOCK4_SRC_COLOR_BG_RED_Type U08
-
-#define GCREG_BLOCK4_SRC_COLOR_BG_GREEN 15 : 8
-#define GCREG_BLOCK4_SRC_COLOR_BG_GREEN_End 15
-#define GCREG_BLOCK4_SRC_COLOR_BG_GREEN_Start 8
-#define GCREG_BLOCK4_SRC_COLOR_BG_GREEN_Type U08
-
-#define GCREG_BLOCK4_SRC_COLOR_BG_BLUE 7 : 0
-#define GCREG_BLOCK4_SRC_COLOR_BG_BLUE_End 7
-#define GCREG_BLOCK4_SRC_COLOR_BG_BLUE_Start 0
-#define GCREG_BLOCK4_SRC_COLOR_BG_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock4Rop
-*/
-
-/* Raster operation foreground and background codes. Even though ROP is not
-** used in CLEAR, HOR_FILTER_BLT, VER_FILTER_BLT and alpha-eanbled BIT_BLTs,
-** ROP code still has to be programmed, because the engine makes the decision
-** whether source, destination and pattern are involved in the current
-** operation and the correct decision is essential for the engine to complete
-** the operation as expected.
-*/
-
-#define gcregBlock4RopRegAddrs 0x4A1C
-#define GCREG_BLOCK4_ROP_MSB 15
-#define GCREG_BLOCK4_ROP_LSB 2
-#define GCREG_BLOCK4_ROP_BLK 0
-#define GCREG_BLOCK4_ROP_Count 4
-#define GCREG_BLOCK4_ROP_FieldMask 0x0030FFFF
-#define GCREG_BLOCK4_ROP_ReadMask 0x0030FFFF
-#define GCREG_BLOCK4_ROP_WriteMask 0x0030FFFF
-#define GCREG_BLOCK4_ROP_ResetValue 0x00000000
-
-/* ROP type: ROP2, ROP3 or ROP4 */
-#define GCREG_BLOCK4_ROP_TYPE 21 : 20
-#define GCREG_BLOCK4_ROP_TYPE_End 21
-#define GCREG_BLOCK4_ROP_TYPE_Start 20
-#define GCREG_BLOCK4_ROP_TYPE_Type U02
-#define GCREG_BLOCK4_ROP_TYPE_ROP2_PATTERN 0x0
-#define GCREG_BLOCK4_ROP_TYPE_ROP2_SOURCE 0x1
-#define GCREG_BLOCK4_ROP_TYPE_ROP3 0x2
-#define GCREG_BLOCK4_ROP_TYPE_ROP4 0x3
-
-/* Background ROP code is used for transparent pixels. */
-#define GCREG_BLOCK4_ROP_ROP_BG 15 : 8
-#define GCREG_BLOCK4_ROP_ROP_BG_End 15
-#define GCREG_BLOCK4_ROP_ROP_BG_Start 8
-#define GCREG_BLOCK4_ROP_ROP_BG_Type U08
-
-/* Background ROP code is used for opaque pixels. */
-#define GCREG_BLOCK4_ROP_ROP_FG 7 : 0
-#define GCREG_BLOCK4_ROP_ROP_FG_End 7
-#define GCREG_BLOCK4_ROP_ROP_FG_Start 0
-#define GCREG_BLOCK4_ROP_ROP_FG_Type U08
-
-/*******************************************************************************
-** State gcregBlock4AlphaControl
-*/
-
-#define gcregBlock4AlphaControlRegAddrs 0x4A20
-#define GCREG_BLOCK4_ALPHA_CONTROL_MSB 15
-#define GCREG_BLOCK4_ALPHA_CONTROL_LSB 2
-#define GCREG_BLOCK4_ALPHA_CONTROL_BLK 0
-#define GCREG_BLOCK4_ALPHA_CONTROL_Count 4
-#define GCREG_BLOCK4_ALPHA_CONTROL_FieldMask 0x00000001
-#define GCREG_BLOCK4_ALPHA_CONTROL_ReadMask 0x00000001
-#define GCREG_BLOCK4_ALPHA_CONTROL_WriteMask 0x00000001
-#define GCREG_BLOCK4_ALPHA_CONTROL_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_ALPHA_CONTROL_ENABLE 0 : 0
-#define GCREG_BLOCK4_ALPHA_CONTROL_ENABLE_End 0
-#define GCREG_BLOCK4_ALPHA_CONTROL_ENABLE_Start 0
-#define GCREG_BLOCK4_ALPHA_CONTROL_ENABLE_Type U01
-#define GCREG_BLOCK4_ALPHA_CONTROL_ENABLE_OFF 0x0
-#define GCREG_BLOCK4_ALPHA_CONTROL_ENABLE_ON 0x1
-
-/*******************************************************************************
-** State gcregBlock4AlphaModes
-*/
-
-#define gcregBlock4AlphaModesRegAddrs 0x4A24
-#define GCREG_BLOCK4_ALPHA_MODES_MSB 15
-#define GCREG_BLOCK4_ALPHA_MODES_LSB 2
-#define GCREG_BLOCK4_ALPHA_MODES_BLK 0
-#define GCREG_BLOCK4_ALPHA_MODES_Count 4
-#define GCREG_BLOCK4_ALPHA_MODES_FieldMask 0xFF003311
-#define GCREG_BLOCK4_ALPHA_MODES_ReadMask 0xFF003311
-#define GCREG_BLOCK4_ALPHA_MODES_WriteMask 0xFF003311
-#define GCREG_BLOCK4_ALPHA_MODES_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_MODE 0 : 0
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_MODE_End 0
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_MODE_Start 0
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_MODE_Type U01
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_MODE 4 : 4
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_MODE_End 4
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_MODE_Start 4
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_MODE_Type U01
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE 9 : 8
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_End 9
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_Start 8
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_Type U02
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE 13 : 12
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_End 13
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_Start 12
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_Type U02
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_BLOCK4_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE 26 : 24
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_End 26
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_Start 24
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_Type U03
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_ZERO 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_ONE 0x1
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_NORMAL 0x2
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_INVERSED 0x3
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_COLOR 0x4
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* Src Blending factor is calculate from Src alpha. */
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_FACTOR 27 : 27
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_FACTOR_End 27
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_FACTOR_Start 27
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_FACTOR_Type U01
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_FACTOR_DISABLED 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_SRC_ALPHA_FACTOR_ENABLED 0x1
-
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE 30 : 28
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_End 30
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_Start 28
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_Type U03
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_ZERO 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_ONE 0x1
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_NORMAL 0x2
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_INVERSED 0x3
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_COLOR 0x4
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_BLOCK4_ALPHA_MODES_DST_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* Dst Blending factor is calculate from Dst alpha. */
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_FACTOR 31 : 31
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_FACTOR_End 31
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_FACTOR_Start 31
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_FACTOR_Type U01
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_FACTOR_DISABLED 0x0
-#define GCREG_BLOCK4_ALPHA_MODES_DST_ALPHA_FACTOR_ENABLED 0x1
-
-/*******************************************************************************
-** State gcregBlock4AddressU
-*/
-
-/* 32-bit aligned base address of the source U plane. */
-
-#define gcregBlock4UPlaneAddressRegAddrs 0x4A28
-#define GCREG_BLOCK4_UPLANE_ADDRESS_MSB 15
-#define GCREG_BLOCK4_UPLANE_ADDRESS_LSB 2
-#define GCREG_BLOCK4_UPLANE_ADDRESS_BLK 0
-#define GCREG_BLOCK4_UPLANE_ADDRESS_Count 4
-#define GCREG_BLOCK4_UPLANE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_UPLANE_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK4_UPLANE_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK4_UPLANE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_UPLANE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK4_UPLANE_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK4_UPLANE_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK4_UPLANE_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock4StrideU
-*/
-
-/* Stride of the source U plane in bytes. */
-
-#define gcregBlock4UPlaneStrideRegAddrs 0x4A2C
-#define GCREG_BLOCK4_UPLANE_STRIDE_MSB 15
-#define GCREG_BLOCK4_UPLANE_STRIDE_LSB 2
-#define GCREG_BLOCK4_UPLANE_STRIDE_BLK 0
-#define GCREG_BLOCK4_UPLANE_STRIDE_Count 4
-#define GCREG_BLOCK4_UPLANE_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_BLOCK4_UPLANE_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_BLOCK4_UPLANE_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_BLOCK4_UPLANE_STRIDE_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_UPLANE_STRIDE_STRIDE 17 : 0
-#define GCREG_BLOCK4_UPLANE_STRIDE_STRIDE_End 17
-#define GCREG_BLOCK4_UPLANE_STRIDE_STRIDE_Start 0
-#define GCREG_BLOCK4_UPLANE_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregBlock4AddressV
-*/
-
-/* 32-bit aligned base address of the source V plane. */
-
-#define gcregBlock4VPlaneAddressRegAddrs 0x4A30
-#define GCREG_BLOCK4_VPLANE_ADDRESS_MSB 15
-#define GCREG_BLOCK4_VPLANE_ADDRESS_LSB 2
-#define GCREG_BLOCK4_VPLANE_ADDRESS_BLK 0
-#define GCREG_BLOCK4_VPLANE_ADDRESS_Count 4
-#define GCREG_BLOCK4_VPLANE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_VPLANE_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK4_VPLANE_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK4_VPLANE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_VPLANE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK4_VPLANE_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK4_VPLANE_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK4_VPLANE_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock4StrideV
-*/
-
-/* Stride of the source V plane in bytes. */
-
-#define gcregBlock4VPlaneStrideRegAddrs 0x4A34
-#define GCREG_BLOCK4_VPLANE_STRIDE_MSB 15
-#define GCREG_BLOCK4_VPLANE_STRIDE_LSB 2
-#define GCREG_BLOCK4_VPLANE_STRIDE_BLK 0
-#define GCREG_BLOCK4_VPLANE_STRIDE_Count 4
-#define GCREG_BLOCK4_VPLANE_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_BLOCK4_VPLANE_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_BLOCK4_VPLANE_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_BLOCK4_VPLANE_STRIDE_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_VPLANE_STRIDE_STRIDE 17 : 0
-#define GCREG_BLOCK4_VPLANE_STRIDE_STRIDE_End 17
-#define GCREG_BLOCK4_VPLANE_STRIDE_STRIDE_Start 0
-#define GCREG_BLOCK4_VPLANE_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregBlock4SrcRotationHeight
-*/
-
-/* 180/270 degree rotation configuration for the Source surface. Height field
-** specifies the height of the surface in pixels.
-*/
-
-#define gcregBlock4SrcRotationHeightRegAddrs 0x4A38
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_MSB 15
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_LSB 2
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_BLK 0
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_Count 4
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_FieldMask 0x0000FFFF
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_ReadMask 0x0000FFFF
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_WriteMask 0x0000FFFF
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_HEIGHT 15 : 0
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_HEIGHT_End 15
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_HEIGHT_Start 0
-#define GCREG_BLOCK4_SRC_ROTATION_HEIGHT_HEIGHT_Type U16
-
-/*******************************************************************************
-** State gcregBlock4RotAngle
-*/
-
-/* 0/90/180/270 degree rotation configuration for the Source surface. Height
-** field specifies the height of the surface in pixels.
-*/
-
-#define gcregBlock4RotAngleRegAddrs 0x4A3C
-#define GCREG_BLOCK4_ROT_ANGLE_MSB 15
-#define GCREG_BLOCK4_ROT_ANGLE_LSB 2
-#define GCREG_BLOCK4_ROT_ANGLE_BLK 0
-#define GCREG_BLOCK4_ROT_ANGLE_Count 4
-#define GCREG_BLOCK4_ROT_ANGLE_FieldMask 0x000BB33F
-#define GCREG_BLOCK4_ROT_ANGLE_ReadMask 0x000BB33F
-#define GCREG_BLOCK4_ROT_ANGLE_WriteMask 0x000BB33F
-#define GCREG_BLOCK4_ROT_ANGLE_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_ROT_ANGLE_SRC 2 : 0
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_End 2
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_Start 0
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_Type U03
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_ROT0 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_FLIP_X 0x1
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_FLIP_Y 0x2
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_ROT90 0x4
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_ROT180 0x5
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_ROT270 0x6
-
-#define GCREG_BLOCK4_ROT_ANGLE_DST 5 : 3
-#define GCREG_BLOCK4_ROT_ANGLE_DST_End 5
-#define GCREG_BLOCK4_ROT_ANGLE_DST_Start 3
-#define GCREG_BLOCK4_ROT_ANGLE_DST_Type U03
-#define GCREG_BLOCK4_ROT_ANGLE_DST_ROT0 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_DST_FLIP_X 0x1
-#define GCREG_BLOCK4_ROT_ANGLE_DST_FLIP_Y 0x2
-#define GCREG_BLOCK4_ROT_ANGLE_DST_ROT90 0x4
-#define GCREG_BLOCK4_ROT_ANGLE_DST_ROT180 0x5
-#define GCREG_BLOCK4_ROT_ANGLE_DST_ROT270 0x6
-
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC 8 : 8
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_End 8
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_Start 8
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_Type U01
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_ENABLED 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MASKED 0x1
-
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST 9 : 9
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_End 9
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_Start 9
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_Type U01
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_ENABLED 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MASKED 0x1
-
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR 13 : 12
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_End 13
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_Start 12
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_Type U02
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_NONE 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_MIRROR_X 0x1
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_MIRROR_Y 0x2
-#define GCREG_BLOCK4_ROT_ANGLE_SRC_MIRROR_MIRROR_XY 0x3
-
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MIRROR 15 : 15
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MIRROR_End 15
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MIRROR_Start 15
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MIRROR_Type U01
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MIRROR_ENABLED 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_SRC_MIRROR_MASKED 0x1
-
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR 17 : 16
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_End 17
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_Start 16
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_Type U02
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_NONE 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_MIRROR_X 0x1
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_MIRROR_Y 0x2
-#define GCREG_BLOCK4_ROT_ANGLE_DST_MIRROR_MIRROR_XY 0x3
-
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MIRROR 19 : 19
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MIRROR_End 19
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MIRROR_Start 19
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MIRROR_Type U01
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MIRROR_ENABLED 0x0
-#define GCREG_BLOCK4_ROT_ANGLE_MASK_DST_MIRROR_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBlock4GlobalSrcColor
-*/
-
-/* Defines the global source color and alpha values. */
-
-#define gcregBlock4GlobalSrcColorRegAddrs 0x4A40
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_MSB 15
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_LSB 2
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_BLK 0
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_Count 4
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_ALPHA 31 : 24
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_ALPHA_End 31
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_ALPHA_Start 24
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_ALPHA_Type U08
-
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_RED 23 : 16
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_RED_End 23
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_RED_Start 16
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_RED_Type U08
-
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_GREEN 15 : 8
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_GREEN_End 15
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_GREEN_Start 8
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_GREEN_Type U08
-
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_BLUE 7 : 0
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_BLUE_End 7
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_BLUE_Start 0
-#define GCREG_BLOCK4_GLOBAL_SRC_COLOR_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock4GlobalDestColor
-*/
-
-/* Defines the global destination color and alpha values. */
-
-#define gcregBlock4GlobalDestColorRegAddrs 0x4A44
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_MSB 15
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_LSB 2
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_BLK 0
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_Count 4
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_ALPHA 31 : 24
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_ALPHA_End 31
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_ALPHA_Start 24
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_ALPHA_Type U08
-
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_RED 23 : 16
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_RED_End 23
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_RED_Start 16
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_RED_Type U08
-
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_GREEN 15 : 8
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_GREEN_End 15
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_GREEN_Start 8
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_GREEN_Type U08
-
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_BLUE 7 : 0
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_BLUE_End 7
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_BLUE_Start 0
-#define GCREG_BLOCK4_GLOBAL_DEST_COLOR_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock4ColorMultiplyModes
-*/
-
-/* Color modes to multiply Source or Destination pixel color by alpha
-** channel. Alpha can be from global color source or current pixel.
-*/
-
-#define gcregBlock4ColorMultiplyModesRegAddrs 0x4A48
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_MSB 15
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_LSB 2
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_BLK 0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_Count 4
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_FieldMask 0x00100311
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_ReadMask 0x00100311
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_WriteMask 0x00100311
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY 0 : 0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_End 0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_Start 0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_Type U01
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE 0x1
-
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY 4 : 4
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_End 4
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_Start 4
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_Type U01
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_ENABLE 0x1
-
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY 9 : 8
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_End 9
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_Start 8
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_Type U02
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_ALPHA 0x1
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_COLOR 0x2
-
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY 20 : 20
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_End 20
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_Start 20
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_Type U01
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK4_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_ENABLE 0x1
-
-/*******************************************************************************
-** State gcregBlock4Transparency
-*/
-
-#define gcregBlock4TransparencyRegAddrs 0x4A4C
-#define GCREG_BLOCK4_TRANSPARENCY_MSB 15
-#define GCREG_BLOCK4_TRANSPARENCY_LSB 2
-#define GCREG_BLOCK4_TRANSPARENCY_BLK 0
-#define GCREG_BLOCK4_TRANSPARENCY_Count 4
-#define GCREG_BLOCK4_TRANSPARENCY_FieldMask 0xB3331333
-#define GCREG_BLOCK4_TRANSPARENCY_ReadMask 0xB3331333
-#define GCREG_BLOCK4_TRANSPARENCY_WriteMask 0xB3331333
-#define GCREG_BLOCK4_TRANSPARENCY_ResetValue 0x00000000
-
-/* Source transparency mode. */
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE 1 : 0
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE_End 1
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE_Start 0
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE_Type U02
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE_OPAQUE 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE_MASK 0x1
-#define GCREG_BLOCK4_TRANSPARENCY_SOURCE_KEY 0x2
-
-/* Pattern transparency mode. KEY transparency mode is reserved. */
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN 5 : 4
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN_End 5
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN_Start 4
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN_Type U02
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN_OPAQUE 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN_MASK 0x1
-#define GCREG_BLOCK4_TRANSPARENCY_PATTERN_KEY 0x2
-
-/* Destination transparency mode. MASK transparency mode is reserved. */
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION 9 : 8
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION_End 9
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION_Start 8
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION_Type U02
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION_OPAQUE 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION_MASK 0x1
-#define GCREG_BLOCK4_TRANSPARENCY_DESTINATION_KEY 0x2
-
-/* Mask field for Source/Pattern/Destination fields. */
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_TRANSPARENCY 12 : 12
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_TRANSPARENCY_End 12
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_TRANSPARENCY_Start 12
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_TRANSPARENCY_Type U01
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_TRANSPARENCY_ENABLED 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_TRANSPARENCY_MASKED 0x1
-
-/* Source usage override. */
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE 17 : 16
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE_End 17
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE_Start 16
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE_Type U02
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE_DEFAULT 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_BLOCK4_TRANSPARENCY_USE_SRC_OVERRIDE_USE_DISABLE 0x2
-
-/* Pattern usage override. */
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE 21 : 20
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE_End 21
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE_Start 20
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE_Type U02
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE_DEFAULT 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_BLOCK4_TRANSPARENCY_USE_PAT_OVERRIDE_USE_DISABLE 0x2
-
-/* Destination usage override. */
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE 25 : 24
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE_End 25
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE_Start 24
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE_Type U02
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE_DEFAULT 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_BLOCK4_TRANSPARENCY_USE_DST_OVERRIDE_USE_DISABLE 0x2
-
-/* 2D resource usage override mask field. */
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_RESOURCE_OVERRIDE 28 : 28
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_End 28
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_Start 28
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_Type U01
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_ENABLED 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_MASKED 0x1
-
-/* DFB Color Key. */
-#define GCREG_BLOCK4_TRANSPARENCY_DFB_COLOR_KEY 29 : 29
-#define GCREG_BLOCK4_TRANSPARENCY_DFB_COLOR_KEY_End 29
-#define GCREG_BLOCK4_TRANSPARENCY_DFB_COLOR_KEY_Start 29
-#define GCREG_BLOCK4_TRANSPARENCY_DFB_COLOR_KEY_Type U01
-#define GCREG_BLOCK4_TRANSPARENCY_DFB_COLOR_KEY_DISABLED 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_DFB_COLOR_KEY_ENABLED 0x1
-
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_DFB_COLOR_KEY 31 : 31
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_DFB_COLOR_KEY_End 31
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_DFB_COLOR_KEY_Start 31
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_DFB_COLOR_KEY_Type U01
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_DFB_COLOR_KEY_ENABLED 0x0
-#define GCREG_BLOCK4_TRANSPARENCY_MASK_DFB_COLOR_KEY_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBlock4Control
-*/
-
-/* General purpose control register. */
-
-#define gcregBlock4PEControlRegAddrs 0x4A50
-#define GCREG_BLOCK4_PE_CONTROL_MSB 15
-#define GCREG_BLOCK4_PE_CONTROL_LSB 2
-#define GCREG_BLOCK4_PE_CONTROL_BLK 0
-#define GCREG_BLOCK4_PE_CONTROL_Count 4
-#define GCREG_BLOCK4_PE_CONTROL_FieldMask 0x00000999
-#define GCREG_BLOCK4_PE_CONTROL_ReadMask 0x00000999
-#define GCREG_BLOCK4_PE_CONTROL_WriteMask 0x00000999
-#define GCREG_BLOCK4_PE_CONTROL_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_PE_CONTROL_YUV 0 : 0
-#define GCREG_BLOCK4_PE_CONTROL_YUV_End 0
-#define GCREG_BLOCK4_PE_CONTROL_YUV_Start 0
-#define GCREG_BLOCK4_PE_CONTROL_YUV_Type U01
-#define GCREG_BLOCK4_PE_CONTROL_YUV_601 0x0
-#define GCREG_BLOCK4_PE_CONTROL_YUV_709 0x1
-
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUV 3 : 3
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUV_End 3
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUV_Start 3
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUV_Type U01
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUV_ENABLED 0x0
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUV_MASKED 0x1
-
-#define GCREG_BLOCK4_PE_CONTROL_UV_SWIZZLE 4 : 4
-#define GCREG_BLOCK4_PE_CONTROL_UV_SWIZZLE_End 4
-#define GCREG_BLOCK4_PE_CONTROL_UV_SWIZZLE_Start 4
-#define GCREG_BLOCK4_PE_CONTROL_UV_SWIZZLE_Type U01
-#define GCREG_BLOCK4_PE_CONTROL_UV_SWIZZLE_UV 0x0
-#define GCREG_BLOCK4_PE_CONTROL_UV_SWIZZLE_VU 0x1
-
-#define GCREG_BLOCK4_PE_CONTROL_MASK_UV_SWIZZLE 7 : 7
-#define GCREG_BLOCK4_PE_CONTROL_MASK_UV_SWIZZLE_End 7
-#define GCREG_BLOCK4_PE_CONTROL_MASK_UV_SWIZZLE_Start 7
-#define GCREG_BLOCK4_PE_CONTROL_MASK_UV_SWIZZLE_Type U01
-#define GCREG_BLOCK4_PE_CONTROL_MASK_UV_SWIZZLE_ENABLED 0x0
-#define GCREG_BLOCK4_PE_CONTROL_MASK_UV_SWIZZLE_MASKED 0x1
-
-/* YUV to RGB convert enable */
-#define GCREG_BLOCK4_PE_CONTROL_YUVRGB 8 : 8
-#define GCREG_BLOCK4_PE_CONTROL_YUVRGB_End 8
-#define GCREG_BLOCK4_PE_CONTROL_YUVRGB_Start 8
-#define GCREG_BLOCK4_PE_CONTROL_YUVRGB_Type U01
-#define GCREG_BLOCK4_PE_CONTROL_YUVRGB_DISABLED 0x0
-#define GCREG_BLOCK4_PE_CONTROL_YUVRGB_ENABLED 0x1
-
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUVRGB 11 : 11
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUVRGB_End 11
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUVRGB_Start 11
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUVRGB_Type U01
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUVRGB_ENABLED 0x0
-#define GCREG_BLOCK4_PE_CONTROL_MASK_YUVRGB_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBlock4SrcColorKeyHigh
-*/
-
-/* Defines the source transparency color in source format. */
-
-#define gcregBlock4SrcColorKeyHighRegAddrs 0x4A54
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_MSB 15
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_LSB 2
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_BLK 0
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_Count 4
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_ALPHA 31 : 24
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_ALPHA_End 31
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_ALPHA_Start 24
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_ALPHA_Type U08
-
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_RED 23 : 16
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_RED_End 23
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_RED_Start 16
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_RED_Type U08
-
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_GREEN 15 : 8
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_GREEN_End 15
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_GREEN_Start 8
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_GREEN_Type U08
-
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_BLUE 7 : 0
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_BLUE_End 7
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_BLUE_Start 0
-#define GCREG_BLOCK4_SRC_COLOR_KEY_HIGH_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock4SrcExConfig
-*/
-
-#define gcregBlock4SrcExConfigRegAddrs 0x4A58
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MSB 15
-#define GCREG_BLOCK4_SRC_EX_CONFIG_LSB 2
-#define GCREG_BLOCK4_SRC_EX_CONFIG_BLK 0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_Count 4
-#define GCREG_BLOCK4_SRC_EX_CONFIG_FieldMask 0x00000109
-#define GCREG_BLOCK4_SRC_EX_CONFIG_ReadMask 0x00000109
-#define GCREG_BLOCK4_SRC_EX_CONFIG_WriteMask 0x00000109
-#define GCREG_BLOCK4_SRC_EX_CONFIG_ResetValue 0x00000000
-
-/* Source multi tiled address computation control. */
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MULTI_TILED 0 : 0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MULTI_TILED_End 0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MULTI_TILED_Start 0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MULTI_TILED_Type U01
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MULTI_TILED_DISABLED 0x0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MULTI_TILED_ENABLED 0x1
-
-/* Source super tiled address computation control. */
-#define GCREG_BLOCK4_SRC_EX_CONFIG_SUPER_TILED 3 : 3
-#define GCREG_BLOCK4_SRC_EX_CONFIG_SUPER_TILED_End 3
-#define GCREG_BLOCK4_SRC_EX_CONFIG_SUPER_TILED_Start 3
-#define GCREG_BLOCK4_SRC_EX_CONFIG_SUPER_TILED_Type U01
-#define GCREG_BLOCK4_SRC_EX_CONFIG_SUPER_TILED_DISABLED 0x0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_SUPER_TILED_ENABLED 0x1
-
-/* Source super tiled address computation control. */
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MINOR_TILED 8 : 8
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MINOR_TILED_End 8
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MINOR_TILED_Start 8
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MINOR_TILED_Type U01
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MINOR_TILED_DISABLED 0x0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_MINOR_TILED_ENABLED 0x1
-
-/* Source CacheMode. */
-#define GCREG_BLOCK4_SRC_EX_CONFIG_CACHE_MODE 12 : 12
-#define GCREG_BLOCK4_SRC_EX_CONFIG_CACHE_MODE_End 12
-#define GCREG_BLOCK4_SRC_EX_CONFIG_CACHE_MODE_Start 12
-#define GCREG_BLOCK4_SRC_EX_CONFIG_CACHE_MODE_Type U01
-#define GCREG_BLOCK4_SRC_EX_CONFIG_CACHE_MODE_DISABLED 0x0
-#define GCREG_BLOCK4_SRC_EX_CONFIG_CACHE_MODE_ENABLED 0x1
-
-/*******************************************************************************
-** State gcregBlock4SrcExAddress
-*/
-
-/* 32-bit aligned base address of the source extra surface. */
-
-#define gcregBlock4SrcExAddressRegAddrs 0x4A5C
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_MSB 15
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_LSB 2
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_BLK 0
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_Count 4
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK4_SRC_EX_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock8SrcAddressEx
-*/
-
-/* 32-bit aligned base address of the source surface. */
-
-#define gcregBlock8SrcAddressRegAddrs 0x4A80
-#define GCREG_BLOCK8_SRC_ADDRESS_MSB 15
-#define GCREG_BLOCK8_SRC_ADDRESS_LSB 3
-#define GCREG_BLOCK8_SRC_ADDRESS_BLK 0
-#define GCREG_BLOCK8_SRC_ADDRESS_Count 8
-#define GCREG_BLOCK8_SRC_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK8_SRC_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK8_SRC_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK8_SRC_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK8_SRC_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK8_SRC_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock8SrcStride
-*/
-
-/* Stride of the source surface in bytes. To calculate the stride multiply
-** the surface width in pixels by the number of bytes per pixel.
-*/
-
-#define gcregBlock8SrcStrideRegAddrs 0x4A88
-#define GCREG_BLOCK8_SRC_STRIDE_MSB 15
-#define GCREG_BLOCK8_SRC_STRIDE_LSB 3
-#define GCREG_BLOCK8_SRC_STRIDE_BLK 0
-#define GCREG_BLOCK8_SRC_STRIDE_Count 8
-#define GCREG_BLOCK8_SRC_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_BLOCK8_SRC_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_BLOCK8_SRC_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_BLOCK8_SRC_STRIDE_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_STRIDE_STRIDE 17 : 0
-#define GCREG_BLOCK8_SRC_STRIDE_STRIDE_End 17
-#define GCREG_BLOCK8_SRC_STRIDE_STRIDE_Start 0
-#define GCREG_BLOCK8_SRC_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregBlock8SrcRotationConfig
-*/
-
-/* 90 degree rotation configuration for the source surface. Width field
-** specifies the width of the surface in pixels.
-*/
-
-#define gcregBlock8SrcRotationConfigRegAddrs 0x4A90
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_MSB 15
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_LSB 3
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_BLK 0
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_Count 8
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_FieldMask 0x0001FFFF
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ReadMask 0x0001FFFF
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_WriteMask 0x0001FFFF
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_WIDTH 15 : 0
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_WIDTH_End 15
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_WIDTH_Start 0
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_WIDTH_Type U16
-
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ROTATION 16 : 16
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ROTATION_End 16
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ROTATION_Start 16
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ROTATION_Type U01
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ROTATION_NORMAL 0x0
-#define GCREG_BLOCK8_SRC_ROTATION_CONFIG_ROTATION_ROTATED 0x1
-
-/*******************************************************************************
-** State gcregBlock8SrcConfig
-*/
-
-/* Source surface configuration register. */
-
-#define gcregBlock8SrcConfigRegAddrs 0x4A98
-#define GCREG_BLOCK8_SRC_CONFIG_MSB 15
-#define GCREG_BLOCK8_SRC_CONFIG_LSB 3
-#define GCREG_BLOCK8_SRC_CONFIG_BLK 0
-#define GCREG_BLOCK8_SRC_CONFIG_Count 8
-#define GCREG_BLOCK8_SRC_CONFIG_FieldMask 0xDF30B1C0
-#define GCREG_BLOCK8_SRC_CONFIG_ReadMask 0xDF30B1C0
-#define GCREG_BLOCK8_SRC_CONFIG_WriteMask 0xDF30B1C0
-#define GCREG_BLOCK8_SRC_CONFIG_ResetValue 0x00000000
-
-/* Control source endianess. */
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL 31 : 30
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL_End 31
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL_Start 30
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL_Type U02
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL_NO_SWAP 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL_SWAP_WORD 0x1
-#define GCREG_BLOCK8_SRC_CONFIG_ENDIAN_CONTROL_SWAP_DWORD 0x2
-
-/* Defines the pixel format of the source surface. */
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT 28 : 24
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_End 28
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_Start 24
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_Type U05
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_X4R4G4B4 0x00
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_A4R4G4B4 0x01
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_X1R5G5B5 0x02
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_A1R5G5B5 0x03
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_R5G6B5 0x04
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_X8R8G8B8 0x05
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_A8R8G8B8 0x06
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_YUY2 0x07
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_UYVY 0x08
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_INDEX8 0x09
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_MONOCHROME 0x0A
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_YV12 0x0F
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_A8 0x10
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_NV12 0x11
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_NV16 0x12
-#define GCREG_BLOCK8_SRC_CONFIG_SOURCE_FORMAT_RG16 0x13
-
-/* Color channel swizzles. */
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE 21 : 20
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_End 21
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_Start 20
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_Type U02
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_ARGB 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_RGBA 0x1
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_ABGR 0x2
-#define GCREG_BLOCK8_SRC_CONFIG_SWIZZLE_BGRA 0x3
-
-/* Mono expansion: if 0, transparency color will be 0, otherwise transparency **
-** color will be 1. */
-#define GCREG_BLOCK8_SRC_CONFIG_MONO_TRANSPARENCY 15 : 15
-#define GCREG_BLOCK8_SRC_CONFIG_MONO_TRANSPARENCY_End 15
-#define GCREG_BLOCK8_SRC_CONFIG_MONO_TRANSPARENCY_Start 15
-#define GCREG_BLOCK8_SRC_CONFIG_MONO_TRANSPARENCY_Type U01
-#define GCREG_BLOCK8_SRC_CONFIG_MONO_TRANSPARENCY_BACKGROUND 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_MONO_TRANSPARENCY_FOREGROUND 0x1
-
-/* Mono expansion or masked blit: stream packing in pixels. Determines how **
-** many horizontal pixels are there per each 32-bit chunk. For example, if **
-** set to Packed8, each 32-bit chunk is 8-pixel wide, which also means that **
-** it defines 4 vertical lines of pixels. */
-#define GCREG_BLOCK8_SRC_CONFIG_PACK 13 : 12
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_End 13
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_Start 12
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_Type U02
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_PACKED8 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_PACKED16 0x1
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_PACKED32 0x2
-#define GCREG_BLOCK8_SRC_CONFIG_PACK_UNPACKED 0x3
-
-/* Source data location: set to STREAM for mono expansion blits or masked **
-** blits. For mono expansion blits the complete bitmap comes from the command **
-** stream. For masked blits the source data comes from the memory and the **
-** mask from the command stream. */
-#define GCREG_BLOCK8_SRC_CONFIG_LOCATION 8 : 8
-#define GCREG_BLOCK8_SRC_CONFIG_LOCATION_End 8
-#define GCREG_BLOCK8_SRC_CONFIG_LOCATION_Start 8
-#define GCREG_BLOCK8_SRC_CONFIG_LOCATION_Type U01
-#define GCREG_BLOCK8_SRC_CONFIG_LOCATION_MEMORY 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_LOCATION_STREAM 0x1
-
-/* Source linear/tiled address computation control. */
-#define GCREG_BLOCK8_SRC_CONFIG_TILED 7 : 7
-#define GCREG_BLOCK8_SRC_CONFIG_TILED_End 7
-#define GCREG_BLOCK8_SRC_CONFIG_TILED_Start 7
-#define GCREG_BLOCK8_SRC_CONFIG_TILED_Type U01
-#define GCREG_BLOCK8_SRC_CONFIG_TILED_DISABLED 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_TILED_ENABLED 0x1
-
-/* If set to ABSOLUTE, the source coordinates are treated as absolute **
-** coordinates inside the source surface. If set to RELATIVE, the source **
-** coordinates are treated as the offsets from the destination coordinates **
-** with the source size equal to the size of the destination. */
-#define GCREG_BLOCK8_SRC_CONFIG_SRC_RELATIVE 6 : 6
-#define GCREG_BLOCK8_SRC_CONFIG_SRC_RELATIVE_End 6
-#define GCREG_BLOCK8_SRC_CONFIG_SRC_RELATIVE_Start 6
-#define GCREG_BLOCK8_SRC_CONFIG_SRC_RELATIVE_Type U01
-#define GCREG_BLOCK8_SRC_CONFIG_SRC_RELATIVE_ABSOLUTE 0x0
-#define GCREG_BLOCK8_SRC_CONFIG_SRC_RELATIVE_RELATIVE 0x1
-
-/*******************************************************************************
-** State gcregBlock8SrcOrigin
-*/
-
-/* Absolute or relative (see SRC_RELATIVE field of gcregBlock8SrcConfig
-** register) X and Y coordinates in pixels of the top left corner of the
-** source rectangle within the source surface.
-*/
-
-#define gcregBlock8SrcOriginRegAddrs 0x4AA0
-#define GCREG_BLOCK8_SRC_ORIGIN_MSB 15
-#define GCREG_BLOCK8_SRC_ORIGIN_LSB 3
-#define GCREG_BLOCK8_SRC_ORIGIN_BLK 0
-#define GCREG_BLOCK8_SRC_ORIGIN_Count 8
-#define GCREG_BLOCK8_SRC_ORIGIN_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_ORIGIN_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_ORIGIN_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_ORIGIN_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_ORIGIN_Y 31 : 16
-#define GCREG_BLOCK8_SRC_ORIGIN_Y_End 31
-#define GCREG_BLOCK8_SRC_ORIGIN_Y_Start 16
-#define GCREG_BLOCK8_SRC_ORIGIN_Y_Type U16
-
-#define GCREG_BLOCK8_SRC_ORIGIN_X 15 : 0
-#define GCREG_BLOCK8_SRC_ORIGIN_X_End 15
-#define GCREG_BLOCK8_SRC_ORIGIN_X_Start 0
-#define GCREG_BLOCK8_SRC_ORIGIN_X_Type U16
-
-/*******************************************************************************
-** State gcregBlock8SrcSize
-*/
-
-/* Width and height of the source rectangle in pixels. If the source is
-** relative (see SRC_RELATIVE field of gcregBlock8SrcConfig register) or a
-** regular bitblt is being performed without stretching, this register is
-** ignored and the source size is assumed to be the same as the destination.
-*/
-
-#define gcregBlock8SrcSizeRegAddrs 0x4AA8
-#define GCREG_BLOCK8_SRC_SIZE_MSB 15
-#define GCREG_BLOCK8_SRC_SIZE_LSB 3
-#define GCREG_BLOCK8_SRC_SIZE_BLK 0
-#define GCREG_BLOCK8_SRC_SIZE_Count 8
-#define GCREG_BLOCK8_SRC_SIZE_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_SIZE_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_SIZE_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_SIZE_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_SIZE_Y 31 : 16
-#define GCREG_BLOCK8_SRC_SIZE_Y_End 31
-#define GCREG_BLOCK8_SRC_SIZE_Y_Start 16
-#define GCREG_BLOCK8_SRC_SIZE_Y_Type U16
-
-#define GCREG_BLOCK8_SRC_SIZE_X 15 : 0
-#define GCREG_BLOCK8_SRC_SIZE_X_End 15
-#define GCREG_BLOCK8_SRC_SIZE_X_Start 0
-#define GCREG_BLOCK8_SRC_SIZE_X_Type U16
-
-/*******************************************************************************
-** State gcregBlock8SrcColorBg
-*/
-
-/* Select the color where source becomes transparent. It must be programmed
-** in A8R8G8B8 format.
-*/
-
-#define gcregBlock8SrcColorBgRegAddrs 0x4AB0
-#define GCREG_BLOCK8_SRC_COLOR_BG_MSB 15
-#define GCREG_BLOCK8_SRC_COLOR_BG_LSB 3
-#define GCREG_BLOCK8_SRC_COLOR_BG_BLK 0
-#define GCREG_BLOCK8_SRC_COLOR_BG_Count 8
-#define GCREG_BLOCK8_SRC_COLOR_BG_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_COLOR_BG_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_COLOR_BG_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_COLOR_BG_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_COLOR_BG_ALPHA 31 : 24
-#define GCREG_BLOCK8_SRC_COLOR_BG_ALPHA_End 31
-#define GCREG_BLOCK8_SRC_COLOR_BG_ALPHA_Start 24
-#define GCREG_BLOCK8_SRC_COLOR_BG_ALPHA_Type U08
-
-#define GCREG_BLOCK8_SRC_COLOR_BG_RED 23 : 16
-#define GCREG_BLOCK8_SRC_COLOR_BG_RED_End 23
-#define GCREG_BLOCK8_SRC_COLOR_BG_RED_Start 16
-#define GCREG_BLOCK8_SRC_COLOR_BG_RED_Type U08
-
-#define GCREG_BLOCK8_SRC_COLOR_BG_GREEN 15 : 8
-#define GCREG_BLOCK8_SRC_COLOR_BG_GREEN_End 15
-#define GCREG_BLOCK8_SRC_COLOR_BG_GREEN_Start 8
-#define GCREG_BLOCK8_SRC_COLOR_BG_GREEN_Type U08
-
-#define GCREG_BLOCK8_SRC_COLOR_BG_BLUE 7 : 0
-#define GCREG_BLOCK8_SRC_COLOR_BG_BLUE_End 7
-#define GCREG_BLOCK8_SRC_COLOR_BG_BLUE_Start 0
-#define GCREG_BLOCK8_SRC_COLOR_BG_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock8Rop
-*/
-
-/* Raster operation foreground and background codes. Even though ROP is not
-** used in CLEAR, HOR_FILTER_BLT, VER_FILTER_BLT and alpha-eanbled BIT_BLTs,
-** ROP code still has to be programmed, because the engine makes the decision
-** whether source, destination and pattern are involved in the current
-** operation and the correct decision is essential for the engine to complete
-** the operation as expected.
-*/
-
-#define gcregBlock8RopRegAddrs 0x4AB8
-#define GCREG_BLOCK8_ROP_MSB 15
-#define GCREG_BLOCK8_ROP_LSB 3
-#define GCREG_BLOCK8_ROP_BLK 0
-#define GCREG_BLOCK8_ROP_Count 8
-#define GCREG_BLOCK8_ROP_FieldMask 0x0030FFFF
-#define GCREG_BLOCK8_ROP_ReadMask 0x0030FFFF
-#define GCREG_BLOCK8_ROP_WriteMask 0x0030FFFF
-#define GCREG_BLOCK8_ROP_ResetValue 0x00000000
-
-/* ROP type: ROP2, ROP3 or ROP4 */
-#define GCREG_BLOCK8_ROP_TYPE 21 : 20
-#define GCREG_BLOCK8_ROP_TYPE_End 21
-#define GCREG_BLOCK8_ROP_TYPE_Start 20
-#define GCREG_BLOCK8_ROP_TYPE_Type U02
-#define GCREG_BLOCK8_ROP_TYPE_ROP2_PATTERN 0x0
-#define GCREG_BLOCK8_ROP_TYPE_ROP2_SOURCE 0x1
-#define GCREG_BLOCK8_ROP_TYPE_ROP3 0x2
-#define GCREG_BLOCK8_ROP_TYPE_ROP4 0x3
-
-/* Background ROP code is used for transparent pixels. */
-#define GCREG_BLOCK8_ROP_ROP_BG 15 : 8
-#define GCREG_BLOCK8_ROP_ROP_BG_End 15
-#define GCREG_BLOCK8_ROP_ROP_BG_Start 8
-#define GCREG_BLOCK8_ROP_ROP_BG_Type U08
-
-/* Background ROP code is used for opaque pixels. */
-#define GCREG_BLOCK8_ROP_ROP_FG 7 : 0
-#define GCREG_BLOCK8_ROP_ROP_FG_End 7
-#define GCREG_BLOCK8_ROP_ROP_FG_Start 0
-#define GCREG_BLOCK8_ROP_ROP_FG_Type U08
-
-/*******************************************************************************
-** State gcregBlock8AlphaControl
-*/
-
-#define gcregBlock8AlphaControlRegAddrs 0x4AC0
-#define GCREG_BLOCK8_ALPHA_CONTROL_MSB 15
-#define GCREG_BLOCK8_ALPHA_CONTROL_LSB 3
-#define GCREG_BLOCK8_ALPHA_CONTROL_BLK 0
-#define GCREG_BLOCK8_ALPHA_CONTROL_Count 8
-#define GCREG_BLOCK8_ALPHA_CONTROL_FieldMask 0x00000001
-#define GCREG_BLOCK8_ALPHA_CONTROL_ReadMask 0x00000001
-#define GCREG_BLOCK8_ALPHA_CONTROL_WriteMask 0x00000001
-#define GCREG_BLOCK8_ALPHA_CONTROL_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_ALPHA_CONTROL_ENABLE 0 : 0
-#define GCREG_BLOCK8_ALPHA_CONTROL_ENABLE_End 0
-#define GCREG_BLOCK8_ALPHA_CONTROL_ENABLE_Start 0
-#define GCREG_BLOCK8_ALPHA_CONTROL_ENABLE_Type U01
-#define GCREG_BLOCK8_ALPHA_CONTROL_ENABLE_OFF 0x0
-#define GCREG_BLOCK8_ALPHA_CONTROL_ENABLE_ON 0x1
-
-/*******************************************************************************
-** State gcregBlock8AlphaModes
-*/
-
-#define gcregBlock8AlphaModesRegAddrs 0x4AC8
-#define GCREG_BLOCK8_ALPHA_MODES_MSB 15
-#define GCREG_BLOCK8_ALPHA_MODES_LSB 3
-#define GCREG_BLOCK8_ALPHA_MODES_BLK 0
-#define GCREG_BLOCK8_ALPHA_MODES_Count 8
-#define GCREG_BLOCK8_ALPHA_MODES_FieldMask 0xFF003311
-#define GCREG_BLOCK8_ALPHA_MODES_ReadMask 0xFF003311
-#define GCREG_BLOCK8_ALPHA_MODES_WriteMask 0xFF003311
-#define GCREG_BLOCK8_ALPHA_MODES_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_MODE 0 : 0
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_MODE_End 0
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_MODE_Start 0
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_MODE_Type U01
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_MODE 4 : 4
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_MODE_End 4
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_MODE_Start 4
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_MODE_Type U01
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE 9 : 8
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_End 9
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_Start 8
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_Type U02
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_SRC_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE 13 : 12
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_End 13
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_Start 12
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_Type U02
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_NORMAL 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_BLOCK8_ALPHA_MODES_GLOBAL_DST_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE 26 : 24
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_End 26
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_Start 24
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_Type U03
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_ZERO 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_ONE 0x1
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_NORMAL 0x2
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_INVERSED 0x3
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_COLOR 0x4
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* Src Blending factor is calculate from Src alpha. */
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_FACTOR 27 : 27
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_FACTOR_End 27
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_FACTOR_Start 27
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_FACTOR_Type U01
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_FACTOR_DISABLED 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_SRC_ALPHA_FACTOR_ENABLED 0x1
-
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE 30 : 28
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_End 30
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_Start 28
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_Type U03
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_ZERO 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_ONE 0x1
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_NORMAL 0x2
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_INVERSED 0x3
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_COLOR 0x4
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_BLOCK8_ALPHA_MODES_DST_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* Dst Blending factor is calculate from Dst alpha. */
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_FACTOR 31 : 31
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_FACTOR_End 31
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_FACTOR_Start 31
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_FACTOR_Type U01
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_FACTOR_DISABLED 0x0
-#define GCREG_BLOCK8_ALPHA_MODES_DST_ALPHA_FACTOR_ENABLED 0x1
-
-/*******************************************************************************
-** State gcregBlock8AddressU
-*/
-
-/* 32-bit aligned base address of the source U plane. */
-
-#define gcregBlock8AddressURegAddrs 0x4AD0
-#define GCREG_BLOCK8_UPLANE_ADDRESS_MSB 15
-#define GCREG_BLOCK8_UPLANE_ADDRESS_LSB 3
-#define GCREG_BLOCK8_UPLANE_ADDRESS_BLK 0
-#define GCREG_BLOCK8_UPLANE_ADDRESS_Count 8
-#define GCREG_BLOCK8_UPLANE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_UPLANE_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK8_UPLANE_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK8_UPLANE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_UPLANE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK8_UPLANE_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK8_UPLANE_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK8_UPLANE_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock8StrideU
-*/
-
-/* Stride of the source U plane in bytes. */
-
-#define gcregBlock8StrideURegAddrs 0x4AD8
-#define GCREG_BLOCK8_UPLANE_STRIDE_MSB 15
-#define GCREG_BLOCK8_UPLANE_STRIDE_LSB 3
-#define GCREG_BLOCK8_UPLANE_STRIDE_BLK 0
-#define GCREG_BLOCK8_UPLANE_STRIDE_Count 8
-#define GCREG_BLOCK8_UPLANE_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_BLOCK8_UPLANE_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_BLOCK8_UPLANE_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_BLOCK8_UPLANE_STRIDE_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_UPLANE_STRIDE_STRIDE 17 : 0
-#define GCREG_BLOCK8_UPLANE_STRIDE_STRIDE_End 17
-#define GCREG_BLOCK8_UPLANE_STRIDE_STRIDE_Start 0
-#define GCREG_BLOCK8_UPLANE_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregBlock8AddressV
-*/
-
-/* 32-bit aligned base address of the source V plane. */
-
-#define gcregBlock8AddressVRegAddrs 0x4AE0
-#define GCREG_BLOCK8_VPLANE_ADDRESS_MSB 15
-#define GCREG_BLOCK8_VPLANE_ADDRESS_LSB 3
-#define GCREG_BLOCK8_VPLANE_ADDRESS_BLK 0
-#define GCREG_BLOCK8_VPLANE_ADDRESS_Count 8
-#define GCREG_BLOCK8_VPLANE_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_VPLANE_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK8_VPLANE_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK8_VPLANE_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_VPLANE_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK8_VPLANE_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK8_VPLANE_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK8_VPLANE_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** State gcregBlock8StrideV
-*/
-
-/* Stride of the source V plane in bytes. */
-
-#define gcregBlock8StrideVRegAddrs 0x4AE8
-#define GCREG_BLOCK8_VPLANE_STRIDE_MSB 15
-#define GCREG_BLOCK8_VPLANE_STRIDE_LSB 3
-#define GCREG_BLOCK8_VPLANE_STRIDE_BLK 0
-#define GCREG_BLOCK8_VPLANE_STRIDE_Count 8
-#define GCREG_BLOCK8_VPLANE_STRIDE_FieldMask 0x0003FFFF
-#define GCREG_BLOCK8_VPLANE_STRIDE_ReadMask 0x0003FFFC
-#define GCREG_BLOCK8_VPLANE_STRIDE_WriteMask 0x0003FFFC
-#define GCREG_BLOCK8_VPLANE_STRIDE_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_VPLANE_STRIDE_STRIDE 17 : 0
-#define GCREG_BLOCK8_VPLANE_STRIDE_STRIDE_End 17
-#define GCREG_BLOCK8_VPLANE_STRIDE_STRIDE_Start 0
-#define GCREG_BLOCK8_VPLANE_STRIDE_STRIDE_Type U18
-
-/*******************************************************************************
-** State gcregBlock8SrcRotationHeight
-*/
-
-/* 180/270 degree rotation configuration for the Source surface. Height field
-** specifies the height of the surface in pixels.
-*/
-
-#define gcregBlock8SrcRotationHeightRegAddrs 0x4AF0
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_MSB 15
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_LSB 3
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_BLK 0
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_Count 8
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_FieldMask 0x0000FFFF
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_ReadMask 0x0000FFFF
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_WriteMask 0x0000FFFF
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_HEIGHT 15 : 0
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_HEIGHT_End 15
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_HEIGHT_Start 0
-#define GCREG_BLOCK8_SRC_ROTATION_HEIGHT_HEIGHT_Type U16
-
-/*******************************************************************************
-** State gcregBlock8RotAngle
-*/
-
-/* 0/90/180/270 degree rotation configuration for the Source surface. Height
-** field specifies the height of the surface in pixels.
-*/
-
-#define gcregBlock8RotAngleRegAddrs 0x4AF8
-#define GCREG_BLOCK8_ROT_ANGLE_MSB 15
-#define GCREG_BLOCK8_ROT_ANGLE_LSB 3
-#define GCREG_BLOCK8_ROT_ANGLE_BLK 0
-#define GCREG_BLOCK8_ROT_ANGLE_Count 8
-#define GCREG_BLOCK8_ROT_ANGLE_FieldMask 0x000BB33F
-#define GCREG_BLOCK8_ROT_ANGLE_ReadMask 0x000BB33F
-#define GCREG_BLOCK8_ROT_ANGLE_WriteMask 0x000BB33F
-#define GCREG_BLOCK8_ROT_ANGLE_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_ROT_ANGLE_SRC 2 : 0
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_End 2
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_Start 0
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_Type U03
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_ROT0 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_FLIP_X 0x1
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_FLIP_Y 0x2
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_ROT90 0x4
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_ROT180 0x5
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_ROT270 0x6
-
-#define GCREG_BLOCK8_ROT_ANGLE_DST 5 : 3
-#define GCREG_BLOCK8_ROT_ANGLE_DST_End 5
-#define GCREG_BLOCK8_ROT_ANGLE_DST_Start 3
-#define GCREG_BLOCK8_ROT_ANGLE_DST_Type U03
-#define GCREG_BLOCK8_ROT_ANGLE_DST_ROT0 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_DST_FLIP_X 0x1
-#define GCREG_BLOCK8_ROT_ANGLE_DST_FLIP_Y 0x2
-#define GCREG_BLOCK8_ROT_ANGLE_DST_ROT90 0x4
-#define GCREG_BLOCK8_ROT_ANGLE_DST_ROT180 0x5
-#define GCREG_BLOCK8_ROT_ANGLE_DST_ROT270 0x6
-
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC 8 : 8
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_End 8
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_Start 8
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_Type U01
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_ENABLED 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MASKED 0x1
-
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST 9 : 9
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_End 9
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_Start 9
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_Type U01
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_ENABLED 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MASKED 0x1
-
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR 13 : 12
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_End 13
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_Start 12
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_Type U02
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_NONE 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_MIRROR_X 0x1
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_MIRROR_Y 0x2
-#define GCREG_BLOCK8_ROT_ANGLE_SRC_MIRROR_MIRROR_XY 0x3
-
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MIRROR 15 : 15
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MIRROR_End 15
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MIRROR_Start 15
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MIRROR_Type U01
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MIRROR_ENABLED 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_SRC_MIRROR_MASKED 0x1
-
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR 17 : 16
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_End 17
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_Start 16
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_Type U02
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_NONE 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_MIRROR_X 0x1
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_MIRROR_Y 0x2
-#define GCREG_BLOCK8_ROT_ANGLE_DST_MIRROR_MIRROR_XY 0x3
-
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MIRROR 19 : 19
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MIRROR_End 19
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MIRROR_Start 19
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MIRROR_Type U01
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MIRROR_ENABLED 0x0
-#define GCREG_BLOCK8_ROT_ANGLE_MASK_DST_MIRROR_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBlock8GlobalSrcColor
-*/
-
-/* Defines the global source color and alpha values. */
-
-#define gcregBlock8GlobalSrcColorRegAddrs 0x4B00
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_MSB 15
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_LSB 3
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_BLK 0
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_Count 8
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_ALPHA 31 : 24
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_ALPHA_End 31
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_ALPHA_Start 24
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_ALPHA_Type U08
-
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_RED 23 : 16
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_RED_End 23
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_RED_Start 16
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_RED_Type U08
-
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_GREEN 15 : 8
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_GREEN_End 15
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_GREEN_Start 8
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_GREEN_Type U08
-
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_BLUE 7 : 0
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_BLUE_End 7
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_BLUE_Start 0
-#define GCREG_BLOCK8_GLOBAL_SRC_COLOR_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock8GlobalDestColor
-*/
-
-/* Defines the global destination color and alpha values. */
-
-#define gcregBlock8GlobalDestColorRegAddrs 0x4B08
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_MSB 15
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_LSB 3
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_BLK 0
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_Count 8
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_ALPHA 31 : 24
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_ALPHA_End 31
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_ALPHA_Start 24
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_ALPHA_Type U08
-
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_RED 23 : 16
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_RED_End 23
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_RED_Start 16
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_RED_Type U08
-
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_GREEN 15 : 8
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_GREEN_End 15
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_GREEN_Start 8
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_GREEN_Type U08
-
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_BLUE 7 : 0
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_BLUE_End 7
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_BLUE_Start 0
-#define GCREG_BLOCK8_GLOBAL_DEST_COLOR_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock8ColorMultiplyModes
-*/
-
-/* Color modes to multiply Source or Destination pixel color by alpha
-** channel. Alpha can be from global color source or current pixel.
-*/
-
-#define gcregBlock8ColorMultiplyModesRegAddrs 0x4B10
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_MSB 15
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_LSB 3
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_BLK 0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_Count 8
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_FieldMask 0x00100311
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_ReadMask 0x00100311
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_WriteMask 0x00100311
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY 0 : 0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_End 0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_Start 0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_Type U01
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_PREMULTIPLY_ENABLE 0x1
-
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY 4 : 4
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_End 4
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_Start 4
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_Type U01
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_PREMULTIPLY_ENABLE 0x1
-
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY 9 : 8
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_End 9
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_Start 8
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_Type U02
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_ALPHA 0x1
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_SRC_GLOBAL_PREMULTIPLY_COLOR 0x2
-
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY 20 : 20
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_End 20
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_Start 20
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_Type U01
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_DISABLE 0x0
-#define GCREG_BLOCK8_COLOR_MULTIPLY_MODES_DST_DEMULTIPLY_ENABLE 0x1
-
-/*******************************************************************************
-** State gcregBlock8Transparency
-*/
-
-#define gcregBlock8TransparencyRegAddrs 0x4B18
-#define GCREG_BLOCK8_TRANSPARENCY_MSB 15
-#define GCREG_BLOCK8_TRANSPARENCY_LSB 3
-#define GCREG_BLOCK8_TRANSPARENCY_BLK 0
-#define GCREG_BLOCK8_TRANSPARENCY_Count 8
-#define GCREG_BLOCK8_TRANSPARENCY_FieldMask 0xB3331333
-#define GCREG_BLOCK8_TRANSPARENCY_ReadMask 0xB3331333
-#define GCREG_BLOCK8_TRANSPARENCY_WriteMask 0xB3331333
-#define GCREG_BLOCK8_TRANSPARENCY_ResetValue 0x00000000
-
-/* Source transparency mode. */
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE 1 : 0
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE_End 1
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE_Start 0
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE_Type U02
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE_OPAQUE 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE_MASK 0x1
-#define GCREG_BLOCK8_TRANSPARENCY_SOURCE_KEY 0x2
-
-/* Pattern transparency mode. KEY transparency mode is reserved. */
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN 5 : 4
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN_End 5
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN_Start 4
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN_Type U02
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN_OPAQUE 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN_MASK 0x1
-#define GCREG_BLOCK8_TRANSPARENCY_PATTERN_KEY 0x2
-
-/* Destination transparency mode. MASK transparency mode is reserved. */
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION 9 : 8
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION_End 9
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION_Start 8
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION_Type U02
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION_OPAQUE 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION_MASK 0x1
-#define GCREG_BLOCK8_TRANSPARENCY_DESTINATION_KEY 0x2
-
-/* Mask field for Source/Pattern/Destination fields. */
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_TRANSPARENCY 12 : 12
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_TRANSPARENCY_End 12
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_TRANSPARENCY_Start 12
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_TRANSPARENCY_Type U01
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_TRANSPARENCY_ENABLED 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_TRANSPARENCY_MASKED 0x1
-
-/* Source usage override. */
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE 17 : 16
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE_End 17
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE_Start 16
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE_Type U02
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE_DEFAULT 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_BLOCK8_TRANSPARENCY_USE_SRC_OVERRIDE_USE_DISABLE 0x2
-
-/* Pattern usage override. */
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE 21 : 20
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE_End 21
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE_Start 20
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE_Type U02
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE_DEFAULT 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_BLOCK8_TRANSPARENCY_USE_PAT_OVERRIDE_USE_DISABLE 0x2
-
-/* Destination usage override. */
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE 25 : 24
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE_End 25
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE_Start 24
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE_Type U02
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE_DEFAULT 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_BLOCK8_TRANSPARENCY_USE_DST_OVERRIDE_USE_DISABLE 0x2
-
-/* 2D resource usage override mask field. */
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_RESOURCE_OVERRIDE 28 : 28
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_End 28
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_Start 28
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_Type U01
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_ENABLED 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_RESOURCE_OVERRIDE_MASKED 0x1
-
-/* DFB Color Key. */
-#define GCREG_BLOCK8_TRANSPARENCY_DFB_COLOR_KEY 29 : 29
-#define GCREG_BLOCK8_TRANSPARENCY_DFB_COLOR_KEY_End 29
-#define GCREG_BLOCK8_TRANSPARENCY_DFB_COLOR_KEY_Start 29
-#define GCREG_BLOCK8_TRANSPARENCY_DFB_COLOR_KEY_Type U01
-#define GCREG_BLOCK8_TRANSPARENCY_DFB_COLOR_KEY_DISABLED 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_DFB_COLOR_KEY_ENABLED 0x1
-
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_DFB_COLOR_KEY 31 : 31
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_DFB_COLOR_KEY_End 31
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_DFB_COLOR_KEY_Start 31
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_DFB_COLOR_KEY_Type U01
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_DFB_COLOR_KEY_ENABLED 0x0
-#define GCREG_BLOCK8_TRANSPARENCY_MASK_DFB_COLOR_KEY_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBlock8Control
-*/
-
-/* General purpose control register. */
-
-#define gcregBlock8PEControlRegAddrs 0x4B20
-#define GCREG_BLOCK8_PE_CONTROL_MSB 15
-#define GCREG_BLOCK8_PE_CONTROL_LSB 3
-#define GCREG_BLOCK8_PE_CONTROL_BLK 0
-#define GCREG_BLOCK8_PE_CONTROL_Count 8
-#define GCREG_BLOCK8_PE_CONTROL_FieldMask 0x00000999
-#define GCREG_BLOCK8_PE_CONTROL_ReadMask 0x00000999
-#define GCREG_BLOCK8_PE_CONTROL_WriteMask 0x00000999
-#define GCREG_BLOCK8_PE_CONTROL_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_PE_CONTROL_YUV 0 : 0
-#define GCREG_BLOCK8_PE_CONTROL_YUV_End 0
-#define GCREG_BLOCK8_PE_CONTROL_YUV_Start 0
-#define GCREG_BLOCK8_PE_CONTROL_YUV_Type U01
-#define GCREG_BLOCK8_PE_CONTROL_YUV_601 0x0
-#define GCREG_BLOCK8_PE_CONTROL_YUV_709 0x1
-
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUV 3 : 3
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUV_End 3
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUV_Start 3
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUV_Type U01
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUV_ENABLED 0x0
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUV_MASKED 0x1
-
-#define GCREG_BLOCK8_PE_CONTROL_UV_SWIZZLE 4 : 4
-#define GCREG_BLOCK8_PE_CONTROL_UV_SWIZZLE_End 4
-#define GCREG_BLOCK8_PE_CONTROL_UV_SWIZZLE_Start 4
-#define GCREG_BLOCK8_PE_CONTROL_UV_SWIZZLE_Type U01
-#define GCREG_BLOCK8_PE_CONTROL_UV_SWIZZLE_UV 0x0
-#define GCREG_BLOCK8_PE_CONTROL_UV_SWIZZLE_VU 0x1
-
-#define GCREG_BLOCK8_PE_CONTROL_MASK_UV_SWIZZLE 7 : 7
-#define GCREG_BLOCK8_PE_CONTROL_MASK_UV_SWIZZLE_End 7
-#define GCREG_BLOCK8_PE_CONTROL_MASK_UV_SWIZZLE_Start 7
-#define GCREG_BLOCK8_PE_CONTROL_MASK_UV_SWIZZLE_Type U01
-#define GCREG_BLOCK8_PE_CONTROL_MASK_UV_SWIZZLE_ENABLED 0x0
-#define GCREG_BLOCK8_PE_CONTROL_MASK_UV_SWIZZLE_MASKED 0x1
-
-/* YUV to RGB convert enable */
-#define GCREG_BLOCK8_PE_CONTROL_YUVRGB 8 : 8
-#define GCREG_BLOCK8_PE_CONTROL_YUVRGB_End 8
-#define GCREG_BLOCK8_PE_CONTROL_YUVRGB_Start 8
-#define GCREG_BLOCK8_PE_CONTROL_YUVRGB_Type U01
-#define GCREG_BLOCK8_PE_CONTROL_YUVRGB_DISABLED 0x0
-#define GCREG_BLOCK8_PE_CONTROL_YUVRGB_ENABLED 0x1
-
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUVRGB 11 : 11
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUVRGB_End 11
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUVRGB_Start 11
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUVRGB_Type U01
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUVRGB_ENABLED 0x0
-#define GCREG_BLOCK8_PE_CONTROL_MASK_YUVRGB_MASKED 0x1
-
-/*******************************************************************************
-** State gcregBlock8SrcColorKeyHigh
-*/
-
-/* Defines the source transparency color in source format. */
-
-#define gcregBlock8SrcColorKeyHighRegAddrs 0x4B28
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_MSB 15
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_LSB 3
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_BLK 0
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_Count 8
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_ReadMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_WriteMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_ALPHA 31 : 24
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_ALPHA_End 31
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_ALPHA_Start 24
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_ALPHA_Type U08
-
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_RED 23 : 16
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_RED_End 23
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_RED_Start 16
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_RED_Type U08
-
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_GREEN 15 : 8
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_GREEN_End 15
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_GREEN_Start 8
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_GREEN_Type U08
-
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_BLUE 7 : 0
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_BLUE_End 7
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_BLUE_Start 0
-#define GCREG_BLOCK8_SRC_COLOR_KEY_HIGH_BLUE_Type U08
-
-/*******************************************************************************
-** State gcregBlock8SrcExConfig
-*/
-
-#define gcregBlock8SrcExConfigRegAddrs 0x4B30
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MSB 15
-#define GCREG_BLOCK8_SRC_EX_CONFIG_LSB 3
-#define GCREG_BLOCK8_SRC_EX_CONFIG_BLK 0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_Count 8
-#define GCREG_BLOCK8_SRC_EX_CONFIG_FieldMask 0x00000109
-#define GCREG_BLOCK8_SRC_EX_CONFIG_ReadMask 0x00000109
-#define GCREG_BLOCK8_SRC_EX_CONFIG_WriteMask 0x00000109
-#define GCREG_BLOCK8_SRC_EX_CONFIG_ResetValue 0x00000000
-
-/* Source multi tiled address computation control. */
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MULTI_TILED 0 : 0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MULTI_TILED_End 0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MULTI_TILED_Start 0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MULTI_TILED_Type U01
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MULTI_TILED_DISABLED 0x0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MULTI_TILED_ENABLED 0x1
-
-/* Source super tiled address computation control. */
-#define GCREG_BLOCK8_SRC_EX_CONFIG_SUPER_TILED 3 : 3
-#define GCREG_BLOCK8_SRC_EX_CONFIG_SUPER_TILED_End 3
-#define GCREG_BLOCK8_SRC_EX_CONFIG_SUPER_TILED_Start 3
-#define GCREG_BLOCK8_SRC_EX_CONFIG_SUPER_TILED_Type U01
-#define GCREG_BLOCK8_SRC_EX_CONFIG_SUPER_TILED_DISABLED 0x0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_SUPER_TILED_ENABLED 0x1
-
-/* Source super tiled address computation control. */
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MINOR_TILED 8 : 8
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MINOR_TILED_End 8
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MINOR_TILED_Start 8
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MINOR_TILED_Type U01
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MINOR_TILED_DISABLED 0x0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_MINOR_TILED_ENABLED 0x1
-
-/* Source CacheMode. */
-#define GCREG_BLOCK8_SRC_EX_CONFIG_CACHE_MODE 12 : 12
-#define GCREG_BLOCK8_SRC_EX_CONFIG_CACHE_MODE_End 12
-#define GCREG_BLOCK8_SRC_EX_CONFIG_CACHE_MODE_Start 12
-#define GCREG_BLOCK8_SRC_EX_CONFIG_CACHE_MODE_Type U01
-#define GCREG_BLOCK8_SRC_EX_CONFIG_CACHE_MODE_DISABLED 0x0
-#define GCREG_BLOCK8_SRC_EX_CONFIG_CACHE_MODE_ENABLED 0x1
-
-/*******************************************************************************
-** State gcregBlock8SrcExAddress
-*/
-
-/* 32-bit aligned base address of the source extra surface. */
-
-#define gcregBlock8SrcExAddressRegAddrs 0x4B38
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_MSB 15
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_LSB 3
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_BLK 0
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_Count 8
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_FieldMask 0xFFFFFFFF
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_ReadMask 0xFFFFFFFC
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_WriteMask 0xFFFFFFFC
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_ResetValue 0x00000000
-
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_ADDRESS 31 : 0
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_ADDRESS_End 30
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_ADDRESS_Start 0
-#define GCREG_BLOCK8_SRC_EX_ADDRESS_ADDRESS_Type U31
-
-/*******************************************************************************
-** Generic defines
-*/
-
-#define GCREG_FORMAT_SUB_SAMPLE_MODE_YUV_MODE422 0x0
-#define GCREG_FORMAT_SUB_SAMPLE_MODE_YUV_MODE420 0x1
-
-#define GCREG_DE_SWIZZLE_ARGB 0x0
-#define GCREG_DE_SWIZZLE_RGBA 0x1
-#define GCREG_DE_SWIZZLE_ABGR 0x2
-#define GCREG_DE_SWIZZLE_BGRA 0x3
-
-#define GCREG_DE_FORMAT_X4R4G4B4 0x00
-#define GCREG_DE_FORMAT_A4R4G4B4 0x01
-#define GCREG_DE_FORMAT_X1R5G5B5 0x02
-#define GCREG_DE_FORMAT_A1R5G5B5 0x03
-#define GCREG_DE_FORMAT_R5G6B5 0x04
-#define GCREG_DE_FORMAT_X8R8G8B8 0x05
-#define GCREG_DE_FORMAT_A8R8G8B8 0x06
-#define GCREG_DE_FORMAT_YUY2 0x07
-#define GCREG_DE_FORMAT_UYVY 0x08
-#define GCREG_DE_FORMAT_INDEX8 0x09
-#define GCREG_DE_FORMAT_MONOCHROME 0x0A
-#define GCREG_DE_FORMAT_YV12 0x0F
-#define GCREG_DE_FORMAT_A8 0x10
-#define GCREG_DE_FORMAT_NV12 0x11
-#define GCREG_DE_FORMAT_NV16 0x12
-#define GCREG_DE_FORMAT_RG16 0x13
-
-/* ~~~~~~~~~~~~~ */
-
-#define GCREG_ALPHA_MODE_NORMAL 0x0
-#define GCREG_ALPHA_MODE_INVERSED 0x1
-
-#define GCREG_GLOBAL_ALPHA_MODE_NORMAL 0x0
-#define GCREG_GLOBAL_ALPHA_MODE_GLOBAL 0x1
-#define GCREG_GLOBAL_ALPHA_MODE_SCALED 0x2
-
-#define GCREG_COLOR_MODE_NORMAL 0x0
-#define GCREG_COLOR_MODE_MULTIPLY 0x1
-
-#define GCREG_BLENDING_MODE_ZERO 0x0
-#define GCREG_BLENDING_MODE_ONE 0x1
-#define GCREG_BLENDING_MODE_NORMAL 0x2
-#define GCREG_BLENDING_MODE_INVERSED 0x3
-#define GCREG_BLENDING_MODE_COLOR 0x4
-#define GCREG_BLENDING_MODE_COLOR_INVERSED 0x5
-#define GCREG_BLENDING_MODE_SATURATED_ALPHA 0x6
-#define GCREG_BLENDING_MODE_SATURATED_DEST_ALPHA 0x7
-
-/* ~~~~~~~~~~~~~ */
-
-#define GCREG_FACTOR_INVERSE_DISABLE 0x0
-#define GCREG_FACTOR_INVERSE_ENABLE 0x1
-
-/* ~~~~~~~~~~~~~ */
-
-#define GCREG_RESOURCE_USAGE_OVERRIDE_DEFAULT 0x0
-#define GCREG_RESOURCE_USAGE_OVERRIDE_USE_ENABLE 0x1
-#define GCREG_RESOURCE_USAGE_OVERRIDE_USE_DISABLE 0x2
-
-/*******************************************************************************
-** Modular operations: pipesel
-*/
-
-static const struct gccmdldstate gcmopipesel_pipesel_ldst =
- GCLDSTATE(gcregPipeSelectRegAddrs, 1);
-
-struct gcmopipesel {
- /* gcregPipeSelectRegAddrs */
- struct gccmdldstate pipesel_ldst;
-
- /* gcregPipeSelectRegAddrs */
- union {
- struct gcregpipeselect reg;
- unsigned int raw;
- } pipesel;
-};
-
-/*******************************************************************************
-** Modular operations: signal
-*/
-
-static const struct gccmdldstate gcmosignal_signal_ldst =
- GCLDSTATE(gcregEventRegAddrs, 1);
-
-struct gcmosignal {
- /* gcregEventRegAddrs */
- struct gccmdldstate signal_ldst;
-
- /* gcregEventRegAddrs */
- union {
- struct gcregevent reg;
- unsigned int raw;
- } signal;
-};
-
-/*******************************************************************************
-** Modular operations: flush
-*/
-
-static const struct gccmdldstate gcmoflush_flush_ldst =
- GCLDSTATE(gcregFlushRegAddrs, 1);
-
-struct gcmoflush {
- /* gcregFlushRegAddrs */
- struct gccmdldstate flush_ldst;
-
- /* gcregFlushRegAddrs */
- union {
- struct gcregflush reg;
- unsigned int raw;
- } flush;
-};
-
-/*******************************************************************************
-** Modular operations: semaphore
-*/
-
-static const struct gccmdldstate gcmosema_sema_ldst =
- GCLDSTATE(gcregSemaphoreRegAddrs, 1);
-
-struct gcmosema {
- /* gcregSemaphoreRegAddrs */
- struct gccmdldstate sema_ldst;
-
- /* gcregSemaphoreRegAddrs */
- union {
- struct gcregsemaphore reg;
- unsigned int raw;
- } sema;
-};
-
-/*******************************************************************************
-** Modular operations: mmuinit
-*/
-
-struct gcmoterminator {
- union {
- struct gcmosignal done;
- struct gccmdnop nop;
- } u1;
-
- union {
- struct gccmdwait wait;
- struct gccmdlink linknext;
- struct gccmdend end;
- } u2;
-
- union {
- struct gccmdlink linkwait;
- struct gccmdnop nop;
- } u3;
-};
-
-/*******************************************************************************
-** Modular operations: mmuinit
-*/
-
-static const struct gccmdldstate gcmommuinit_safe_ldst =
- GCLDSTATE(gcregMMUSafeAddressRegAddrs, 2);
-
-struct gcmommuinit {
- /* gcregMMUSafeAddressRegAddrs */
- struct gccmdldstate safe_ldst;
-
- /* gcregMMUSafeAddressRegAddrs */
- unsigned int safe;
-
- /* gcregMMUConfigurationRegAddrs */
- unsigned int mtlb;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-/*******************************************************************************
-** Modular operations: mmumaster
-*/
-
-static const struct gccmdldstate gcmommumaster_master_ldst =
- GCLDSTATE(gcregMMUConfigurationRegAddrs, 1);
-
-struct gcmommumaster {
- /* gcregMMUConfigurationRegAddrs */
- struct gccmdldstate master_ldst;
-
- /* gcregMMUConfigurationRegAddrs */
- unsigned int master;
-};
-
-/*******************************************************************************
-** Modular operations: mmuflush
-*/
-
-static const struct gccmdldstate gcmommuflush_mmuflush_ldst =
- GCLDSTATE(gcregMMUConfigurationRegAddrs, 1);
-
-struct gcmommuflush {
- /* PE cache flush. */
- struct gcmoflush peflush;
-
- /* Semaphore/stall after PE flush. */
- struct gcmosema peflushsema;
- struct gccmdstall peflushstall;
-
- /* Link to flush FE FIFO. */
- struct gccmdlink feflush;
-
- /* MMU flush. */
- struct gccmdldstate mmuflush_ldst;
-
- /* gcregMMUConfigurationRegAddrs */
- union {
- struct gcregmmuconfiguration reg;
- unsigned int raw;
- } mmuflush;
-
- /* Semaphore/stall after MMU flush. */
- struct gcmosema mmuflushsema;
- struct gccmdstall mmuflushstall;
-
- /* Link to the user buffer. */
- struct gccmdlink link;
-};
-
-/*******************************************************************************
-** Modular operations: dst
-*/
-
-static const struct gccmdldstate gcmodst_config_ldst =
- GCLDSTATE(gcregDestAddressRegAddrs, 3);
-
-static const struct gccmdldstate gcmodst_rotationheight_ldst =
- GCLDSTATE(gcregDstRotationHeightRegAddrs, 1);
-
-static const struct gccmdldstate gcmodst_clip_ldst =
- GCLDSTATE(gcregClipTopLeftRegAddrs, 2);
-
-struct gcmodst {
- /* Configuration block. */
- struct gccmdldstate config_ldst;
-
- /* gcregDestAddressRegAddrs */
- unsigned int address;
-
- /* gcregDestStrideRegAddrs */
- unsigned int stride;
-
- /* gcregDestRotationConfigRegAddrs */
- union {
- struct gcregdstrotationconfig reg;
- unsigned int raw;
- } rotation;
-
- /* gcregDstRotationHeightRegAddrs */
- struct gccmdldstate rotationheight_ldst;
-
- /* gcregDstRotationHeightRegAddrs */
- union {
- struct gcregdstrotationheight reg;
- unsigned int raw;
- } rotationheight;
-
- /* Clipping block. */
- struct gccmdldstate clip_ldst;
-
- /* gcregClipTopLeftRegAddrs */
- union {
- struct gcregcliplt reg;
- unsigned int raw;
- } cliplt;
-
- /* gcregClipBottomRight */
- union {
- struct gcregcliprb reg;
- unsigned int raw;
- } cliprb;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-/*******************************************************************************
-** Modular operations: alphaoff
-*/
-
-static const struct gccmdldstate gcmoalphaoff_control_ldst[4] = {
- GCLDSTATE(gcregAlphaControlRegAddrs, 1),
- GCLDSTATE(gcregBlock4AlphaControlRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4AlphaControlRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4AlphaControlRegAddrs + 3, 1),
-};
-
-struct gcmoalphaoff {
- /* gcregAlphaControlRegAddrs */
- struct gccmdldstate control_ldst;
-
- /* gcregAlphaControlRegAddrs */
- union {
- struct gcregalphacontrol reg;
- unsigned int raw;
- } control;
-};
-
-/*******************************************************************************
-** Modular operations: alpha
-*/
-
-static const struct gccmdldstate gcmoalpha_config_ldst =
- GCLDSTATE(gcregAlphaControlRegAddrs, 2);
-
-struct gcmoalpha {
- /* Alpha control block. */
- struct gccmdldstate config_ldst;
-
- /* gcregAlphaControlRegAddrs */
- union {
- struct gcregalphacontrol reg;
- unsigned int raw;
- } control;
-
- /* gcregAlphaModesRegAddrs */
- union {
- struct gcregalphamodes reg;
- unsigned int raw;
- } mode;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gccmdldstate gcmoxsrcalpha_control_ldst[4] = {
- GCLDSTATE(gcregAlphaControlRegAddrs, 1),
- GCLDSTATE(gcregBlock4AlphaControlRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4AlphaControlRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4AlphaControlRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmoxsrcalpha_mode_ldst[4] = {
- GCLDSTATE(gcregAlphaModesRegAddrs, 1),
- GCLDSTATE(gcregBlock4AlphaModesRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4AlphaModesRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4AlphaModesRegAddrs + 3, 1),
-};
-
-struct gcmoxsrcalpha {
- /* gcregBlock4AlphaControlRegAddrs */
- struct gccmdldstate control_ldst;
-
- /* gcregBlock4AlphaControlRegAddrs */
- union {
- struct gcregalphacontrol reg;
- unsigned int raw;
- } control;
-
- /* gcregBlock4AlphaModesRegAddrs */
- struct gccmdldstate mode_ldst;
-
- /* gcregBlock4AlphaModesRegAddrs */
- union {
- struct gcregalphamodes reg;
- unsigned int raw;
- } mode;
-};
-
-/*******************************************************************************
-** Modular operations: alphaglobal
-*/
-
-static const struct gccmdldstate gcmoglobal_color_ldst =
- GCLDSTATE(gcregGlobalSrcColorRegAddrs, 2);
-
-struct gcmoglobal {
- /* Global color block. */
- struct gccmdldstate color_ldst;
-
- /* gcregGlobalSrcColorRegAddrs */
- union {
- struct gcregglobalsrccolor reg;
- unsigned int raw;
- } srcglobal;
-
- /* gcregGlobalDestColorRegAddrs */
- union {
- struct gcregglobaldstcolor reg;
- unsigned int raw;
- } dstglobal;
-
- /* Alignment filler. */
- unsigned int _filler;
-};
-
-static const struct gccmdldstate gcmoxsrcglobal_srcglobal_ldst[4] = {
- GCLDSTATE(gcregGlobalSrcColorRegAddrs, 1),
- GCLDSTATE(gcregBlock4GlobalSrcColorRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4GlobalSrcColorRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4GlobalSrcColorRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmoxsrcglobal_dstglobal_ldst[4] = {
- GCLDSTATE(gcregGlobalDestColorRegAddrs, 1),
- GCLDSTATE(gcregBlock4GlobalDestColorRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4GlobalDestColorRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4GlobalDestColorRegAddrs + 3, 1),
-};
-
-struct gcmoxsrcglobal {
- /* gcregBlock4GlobalSrcColorRegAddrs */
- struct gccmdldstate srcglobal_ldst;
-
- /* gcregBlock4GlobalSrcColorRegAddrs */
- union {
- struct gcregglobalsrccolor reg;
- unsigned int raw;
- } srcglobal;
-
- /* gcregBlock4GlobalDestColorRegAddrs */
- struct gccmdldstate dstglobal_ldst;
-
- /* gcregBlock4GlobalDestColorRegAddrs */
- union {
- struct gcregglobaldstcolor reg;
- unsigned int raw;
- } dstglobal;
-};
-
-/*******************************************************************************
-** Modular operations: yuv
-*/
-
-static const struct gccmdldstate gcmoyuv_pectrl_ldst =
- GCLDSTATE(gcregPEControlRegAddrs, 1);
-
-static const struct gccmdldstate gcmoyuv2_plane_ldst =
- GCLDSTATE(gcregUPlaneAddressRegAddrs, 2);
-
-static const struct gccmdldstate gcmoyuv3_plane_ldst =
- GCLDSTATE(gcregUPlaneAddressRegAddrs, 4);
-
-struct gcmoyuv1 {
- /* gcregPEControlRegAddrs */
- struct gccmdldstate pectrl_ldst;
-
- /* gcregPEControlRegAddrs */
- union {
- struct gcregpecontrol reg;
- unsigned int raw;
- } pectrl;
-};
-
-struct gcmoyuv2 {
- /* gcregPEControlRegAddrs */
- struct gccmdldstate pectrl_ldst;
-
- /* gcregPEControlRegAddrs */
- union {
- struct gcregpecontrol reg;
- unsigned int raw;
- } pectrl;
-
- /* Plane state block. */
- struct gccmdldstate plane_ldst;
-
- /* gcregUPlaneAddressRegAddrs */
- unsigned int uplaneaddress;
-
- /* gcregUPlaneStrideRegAddrs */
- unsigned int uplanestride;
-
- /* Alignment filler. */
- unsigned int _filler1;
-};
-
-struct gcmoyuv3 {
- /* gcregPEControlRegAddrs */
- struct gccmdldstate pectrl_ldst;
-
- /* gcregPEControlRegAddrs */
- union {
- struct gcregpecontrol reg;
- unsigned int raw;
- } pectrl;
-
- /* Plane state block. */
- struct gccmdldstate plane_ldst;
-
- /* gcregUPlaneAddressRegAddrs */
- unsigned int uplaneaddress;
-
- /* gcregUPlaneStrideRegAddrs */
- unsigned int uplanestride;
-
- /* gcregVPlaneAddressRegAddrs */
- unsigned int vplaneaddress;
-
- /* gcregVPlaneStrideRegAddrs */
- unsigned int vplanestride;
-
- /* Alignment filler. */
- unsigned int _filler1;
-};
-
-/*******************************************************************************
-** Modular operations: xsrcyuv
-*/
-
-static const struct gccmdldstate gcmoxsrcyuv_uplaneaddress_ldst[4] = {
- GCLDSTATE(gcregUPlaneAddressRegAddrs, 1),
- GCLDSTATE(gcregBlock4UPlaneAddressRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4UPlaneAddressRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4UPlaneAddressRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmoxsrcyuv_uplanestride_ldst[4] = {
- GCLDSTATE(gcregUPlaneStrideRegAddrs, 1),
- GCLDSTATE(gcregBlock4UPlaneStrideRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4UPlaneStrideRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4UPlaneStrideRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmoxsrcyuv_vplaneaddress_ldst[4] = {
- GCLDSTATE(gcregVPlaneAddressRegAddrs, 1),
- GCLDSTATE(gcregBlock4VPlaneAddressRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4VPlaneAddressRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4VPlaneAddressRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmoxsrcyuv_vplanestride_ldst[4] = {
- GCLDSTATE(gcregVPlaneStrideRegAddrs, 1),
- GCLDSTATE(gcregBlock4VPlaneStrideRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4VPlaneStrideRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4VPlaneStrideRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmoxsrcyuv_pectrl_ldst[4] = {
- GCLDSTATE(gcregPEControlRegAddrs, 1),
- GCLDSTATE(gcregBlock4PEControlRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4PEControlRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4PEControlRegAddrs + 3, 1),
-};
-
-struct gcmoxsrcyuv1 {
- /* gcregBlock4PEControlRegAddrs */
- struct gccmdldstate pectrl_ldst;
-
- /* gcregBlock4PEControlRegAddrs */
- union {
- struct gcregpecontrol reg;
- unsigned int raw;
- } pectrl;
-};
-
-struct gcmoxsrcyuv2 {
- /* gcregBlock4PEControlRegAddrs */
- struct gccmdldstate pectrl_ldst;
-
- /* gcregBlock4PEControlRegAddrs */
- union {
- struct gcregpecontrol reg;
- unsigned int raw;
- } pectrl;
-
- /* gcregBlock4UPlaneAddressRegAddrs */
- struct gccmdldstate uplaneaddress_ldst;
-
- /* gcregBlock4UPlaneAddressRegAddrs */
- unsigned int uplaneaddress;
-
- /* gcregBlock4UPlaneStrideRegAddrs */
- struct gccmdldstate uplanestride_ldst;
-
- /* gcregBlock4UPlaneStrideRegAddrs */
- unsigned int uplanestride;
-};
-
-struct gcmoxsrcyuv3 {
- /* gcregBlock4PEControlRegAddrs */
- struct gccmdldstate pectrl_ldst;
-
- /* gcregBlock4PEControlRegAddrs */
- union {
- struct gcregpecontrol reg;
- unsigned int raw;
- } pectrl;
-
- /* gcregBlock4UPlaneAddressRegAddrs */
- struct gccmdldstate uplaneaddress_ldst;
-
- /* gcregBlock4UPlaneAddressRegAddrs */
- unsigned int uplaneaddress;
-
- /* gcregBlock4UPlaneStrideRegAddrs */
- struct gccmdldstate uplanestride_ldst;
-
- /* gcregBlock4UPlaneStrideRegAddrs */
- unsigned int uplanestride;
-
- /* gcregBlock4VPlaneAddressRegAddrs */
- struct gccmdldstate vplaneaddress_ldst;
-
- /* gcregBlock4VPlaneAddressRegAddrs */
- unsigned int vplaneaddress;
-
- /* gcregBlock4VPlaneStrideRegAddrs */
- struct gccmdldstate vplanestride_ldst;
-
- /* gcregBlock4VPlaneStrideRegAddrs */
- unsigned int vplanestride;
-};
-
-/*******************************************************************************
-** Modular operations: src
-*/
-
-static const struct gccmdldstate gcmosrc0_config_ldst =
- GCLDSTATE(gcregSrcAddressRegAddrs, 6);
-
-static const struct gccmdldstate gcmosrc0_rotation_ldst =
- GCLDSTATE(gcregSrcRotationHeightRegAddrs, 2);
-
-static const struct gccmdldstate gcmosrc0_rop_ldst =
- GCLDSTATE(gcregRopRegAddrs, 1);
-
-static const struct gccmdldstate gcmosrc0_mult_ldst =
- GCLDSTATE(gcregColorMultiplyModesRegAddrs, 1);
-
-struct gcmosrc0 {
- /* Configuration block. */
- struct gccmdldstate config_ldst;
-
- /* gcregSrcAddressRegAddrs */
- unsigned int address;
-
- /* gcregSrcStrideRegAddrs */
- unsigned int stride;
-
- /* gcregSrcRotationConfigRegAddrs */
- union {
- struct gcregsrcrotationconfig reg;
- unsigned int raw;
- } rotation;
-
- /* gcregSrcConfigRegAddrs */
- union {
- struct gcregsrcconfig reg;
- unsigned int raw;
- } config;
-
- /* gcregSrcOriginRegAddrs */
- union {
- struct gcregsrcorigin reg;
- unsigned int raw;
- } origin;
-
- /* gcregSrcSizeRegAddrs */
- union {
- struct gcregsrcsize reg;
- unsigned int raw;
- } size;
-
- /* Alignment filler. */
- unsigned int _filler1;
-
- /* Rotation block. */
- struct gccmdldstate rotation_ldst;
-
- /* gcregSrcRotationHeightRegAddrs */
- union {
- struct gcregsrcrotationheight reg;
- unsigned int raw;
- } rotationheight;
-
- /* gcregRotAngleRegAddrs */
- union {
- struct gcregrotangle reg;
- unsigned int raw;
- } rotationangle;
-
- /* Alignment filler. */
- unsigned int _filler2;
-
- /* gcregRopRegAddrs */
- struct gccmdldstate rop_ldst;
-
- /* gcregRopRegAddrs */
- union {
- struct gcregrop reg;
- unsigned int raw;
- } rop;
-
- /* gcregColorMultiplyModesRegAddrs */
- struct gccmdldstate mult_ldst;
-
- /* gcregColorMultiplyModesRegAddrs */
- union {
- struct gcregcolormultiplymodes reg;
- unsigned int raw;
- } mult;
-};
-
-static const struct gccmdldstate gcmosrc_address_ldst[4] = {
- GCLDSTATE(gcregSrcAddressRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcAddressRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcAddressRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcAddressRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_stride_ldst[4] = {
- GCLDSTATE(gcregSrcStrideRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcStrideRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcStrideRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcStrideRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_rotation_ldst[4] = {
- GCLDSTATE(gcregSrcRotationConfigRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcRotationConfigRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcRotationConfigRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcRotationConfigRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_config_ldst[4] = {
- GCLDSTATE(gcregSrcConfigRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcConfigRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcConfigRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcConfigRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_origin_ldst[4] = {
- GCLDSTATE(gcregSrcOriginRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcOriginRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcOriginRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcOriginRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_size_ldst[4] = {
- GCLDSTATE(gcregSrcSizeRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcSizeRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcSizeRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcSizeRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_rotationheight_ldst[4] = {
- GCLDSTATE(gcregSrcRotationHeightRegAddrs, 1),
- GCLDSTATE(gcregBlock4SrcRotationHeightRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4SrcRotationHeightRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4SrcRotationHeightRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_rotationangle_ldst[4] = {
- GCLDSTATE(gcregRotAngleRegAddrs, 1),
- GCLDSTATE(gcregBlock4RotAngleRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4RotAngleRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4RotAngleRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_rop_ldst[4] = {
- GCLDSTATE(gcregRopRegAddrs, 1),
- GCLDSTATE(gcregBlock4RopRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4RopRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4RopRegAddrs + 3, 1),
-};
-
-static const struct gccmdldstate gcmosrc_mult_ldst[4] = {
- GCLDSTATE(gcregColorMultiplyModesRegAddrs, 1),
- GCLDSTATE(gcregBlock4ColorMultiplyModesRegAddrs + 1, 1),
- GCLDSTATE(gcregBlock4ColorMultiplyModesRegAddrs + 2, 1),
- GCLDSTATE(gcregBlock4ColorMultiplyModesRegAddrs + 3, 1),
-};
-
-struct gcmosrc {
- /* gcregBlock4SrcAddressRegAddrs */
- struct gccmdldstate address_ldst;
-
- /* gcregBlock4SrcAddressRegAddrs */
- unsigned int address;
-
- /* gcregBlock4SrcStrideRegAddrs */
- struct gccmdldstate stride_ldst;
-
- /* gcregBlock4SrcStrideRegAddrs */
- unsigned int stride;
-
- /* gcregBlock4SrcRotationConfigRegAddrs */
- struct gccmdldstate rotation_ldst;
-
- /* gcregBlock4SrcRotationConfigRegAddrs */
- union {
- struct gcregsrcrotationconfig reg;
- unsigned int raw;
- } rotation;
-
- /* gcregBlock4SrcConfigRegAddrs */
- struct gccmdldstate config_ldst;
-
- /* gcregBlock4SrcConfigRegAddrs */
- union {
- struct gcregsrcconfig reg;
- unsigned int raw;
- } config;
-
- /* gcregBlock4SrcOriginRegAddrs */
- struct gccmdldstate origin_ldst;
-
- /* gcregBlock4SrcOriginRegAddrs */
- union {
- struct gcregsrcorigin reg;
- unsigned int raw;
- } origin;
-
- /* gcregBlock4SrcSizeRegAddrs */
- struct gccmdldstate size_ldst;
-
- /* gcregBlock4SrcSizeRegAddrs */
- union {
- struct gcregsrcsize reg;
- unsigned int raw;
- } size;
-
- /* gcregBlock4SrcRotationHeightRegAddrs */
- struct gccmdldstate rotationheight_ldst;
-
- /* gcregBlock4SrcRotationHeightRegAddrs */
- union {
- struct gcregsrcrotationheight reg;
- unsigned int raw;
- } rotationheight;
-
- /* gcregBlock4RotAngleRegAddrs */
- struct gccmdldstate rotationangle_ldst;
-
- /* gcregBlock4RotAngleRegAddrs */
- union {
- struct gcregrotangle reg;
- unsigned int raw;
- } rotationangle;
-
- /* gcregBlock4RopRegAddrs */
- struct gccmdldstate rop_ldst;
-
- /* gcregBlock4RopRegAddrs */
- union {
- struct gcregrop reg;
- unsigned int raw;
- } rop;
-
- /* gcregBlock4ColorMultiplyModesRegAddrs */
- struct gccmdldstate mult_ldst;
-
- /* gcregBlock4ColorMultiplyModesRegAddrs */
- union {
- struct gcregcolormultiplymodes reg;
- unsigned int raw;
- } mult;
-};
-
-static const struct gccmdldstate gcmovrsrc_config_ldst =
- GCLDSTATE(gcregSrcAddressRegAddrs, 4);
-
-static const struct gccmdldstate gcmovrsrc_pos_ldst =
- GCLDSTATE(gcregVRSourceImageLowRegAddrs, 4);
-
-static const struct gccmdldstate gcmovrsrc_rotation_ldst =
- GCLDSTATE(gcregSrcRotationHeightRegAddrs, 2);
-
-static const struct gccmdldstate gcmovrsrc_rop_ldst =
- GCLDSTATE(gcregRopRegAddrs, 1);
-
-static const struct gccmdldstate gcmovrsrc_mult_ldst =
- GCLDSTATE(gcregColorMultiplyModesRegAddrs, 1);
-
-struct gcmovrsrc {
- /* Configuration block. */
- struct gccmdldstate config_ldst;
-
- /* gcregSrcAddressRegAddrs */
- unsigned int address;
-
- /* gcregSrcStrideRegAddrs */
- unsigned int stride;
-
- /* gcregSrcRotationConfigRegAddrs */
- union {
- struct gcregsrcrotationconfig reg;
- unsigned int raw;
- } rotation;
-
- /* gcregSrcConfigRegAddrs */
- union {
- struct gcregsrcconfig reg;
- unsigned int raw;
- } config;
-
- /* Alignment filler. */
- unsigned int _filler1;
-
- /* Source position block. */
- struct gccmdldstate pos_ldst;
-
- /* gcregVRSourceImageLowRegAddrs */
- union {
- struct gcregvrsourceimagelow reg;
- unsigned int raw;
- } lt;
-
- /* gcregVRSourceImageHighRegAddrs */
- union {
- struct gcregvrsourceimagehigh reg;
- unsigned int raw;
- } rb;
-
- /* gcregVRSourceOriginLowRegAddrs */
- unsigned int x;
-
- /* gcregVRSourceOriginHighRegAddrs */
- unsigned int y;
-
- /* Alignment filler. */
- unsigned int _filler2;
-
- /* Rotation block. */
- struct gccmdldstate rotation_ldst;
-
- /* gcregSrcRotationHeightRegAddrs */
- union {
- struct gcregsrcrotationheight reg;
- unsigned int raw;
- } rotationheight;
-
- /* gcregRotAngleRegAddrs */
- union {
- struct gcregrotangle reg;
- unsigned int raw;
- } rotationangle;
-
- /* Alignment filler. */
- unsigned int _filler3;
-
- /* gcregRopRegAddrs */
- struct gccmdldstate rop_ldst;
-
- /* gcregRopRegAddrs */
- union {
- struct gcregrop reg;
- unsigned int raw;
- } rop;
-
- /* gcregColorMultiplyModesRegAddrs */
- struct gccmdldstate mult_ldst;
-
- /* gcregColorMultiplyModesRegAddrs */
- union {
- struct gcregcolormultiplymodes reg;
- unsigned int raw;
- } mult;
-};
-
-/*******************************************************************************
-** Modular operations: bltconfig
-*/
-
-static const struct gccmdldstate gcmobltconfig_multisource_ldst =
- GCLDSTATE(gcregDEMultiSourceRegAddrs, 1);
-
-static const struct gccmdldstate gcmobltconfig_dstconfig_ldst =
- GCLDSTATE(gcregDestConfigRegAddrs, 1);
-
-struct gcmobltconfig {
- /* gcregDEMultiSourceRegAddrs */
- struct gccmdldstate multisource_ldst;
-
- /* gcregDEMultiSourceRegAddrs */
- union {
- struct gcregmultisource reg;
- unsigned int raw;
- } multisource;
-
- /* gcregDestConfigRegAddrs */
- struct gccmdldstate dstconfig_ldst;
-
- /* gcregDestConfigRegAddrs */
- union {
- struct gcregdstconfig reg;
- unsigned int raw;
- } dstconfig;
-};
-
-/*******************************************************************************
-** Modular operations: startde
-*/
-
-struct gcmostartde {
- /* Start DE command. */
- struct gccmdstartde startde;
- struct gccmdstartderect rect;
-};
-
-/*******************************************************************************
-** Modular operations: fillsrc
-*/
-
-static const struct gccmdldstate gcmofillsrc_rotation_ldst =
- GCLDSTATE(gcregSrcRotationConfigRegAddrs, 2);
-
-static const struct gccmdldstate gcmofillsrc_rotationheight_ldst =
- GCLDSTATE(gcregSrcRotationHeightRegAddrs, 2);
-
-static const struct gccmdldstate gcmofillsrc_alphacontrol_ldst =
- GCLDSTATE(gcregAlphaControlRegAddrs, 1);
-
-struct gcmofillsrc {
- /* gcregSrcRotationConfigRegAddrs */
- struct gccmdldstate rotation_ldst;
-
- /* gcregSrcRotationConfigRegAddrs */
- union {
- struct gcregsrcrotationconfig reg;
- unsigned int raw;
- } rotation;
-
- /* gcregSrcConfigRegAddrs */
- union {
- struct gcregsrcconfig reg;
- unsigned int raw;
- } config;
-
- /* Alignment filler. */
- unsigned int _filler1;
-
- /* gcregSrcRotationHeightRegAddrs */
- struct gccmdldstate rotationheight_ldst;
-
- /* gcregSrcRotationHeightRegAddrs */
- union {
- struct gcregsrcrotationheight reg;
- unsigned int raw;
- } rotationheight;
-
- /* gcregRotAngleRegAddrs */
- union {
- struct gcregrotangle reg;
- unsigned int raw;
- } rotationangle;
-
- /* Alignment filler. */
- unsigned int _filler2;
-
- /* gcregAlphaControlRegAddrs */
- struct gccmdldstate alphacontrol_ldst;
-
- /* gcregAlphaControlRegAddrs */
- union {
- struct gcregalphacontrol reg;
- unsigned int raw;
- } alphacontrol;
-};
-
-/*******************************************************************************
-** Modular operations: fill
-*/
-
-static const struct gccmdldstate gcmofill_clearcolor_ldst =
- GCLDSTATE(gcregClearPixelValue32RegAddrs, 1);
-
-static const struct gccmdldstate gcmofill_dstconfig_ldst =
- GCLDSTATE(gcregDestConfigRegAddrs, 1);
-
-static const struct gccmdldstate gcmofill_rop_ldst =
- GCLDSTATE(gcregRopRegAddrs, 1);
-
-struct gcmofill {
- struct gcmofillsrc src;
-
- /* gcregClearPixelValue32RegAddrs */
- struct gccmdldstate clearcolor_ldst;
-
- /* gcregClearPixelValue32RegAddrs */
- union {
- struct gcregclearcolor reg;
- unsigned int raw;
- } clearcolor;
-
- /* gcregDestConfigRegAddrs */
- struct gccmdldstate dstconfig_ldst;
-
- /* gcregDestConfigRegAddrs */
- union {
- struct gcregdstconfig reg;
- unsigned int raw;
- } dstconfig;
-
- /* gcregRopRegAddrs */
- struct gccmdldstate rop_ldst;
-
- /* gcregRopRegAddrs */
- union {
- struct gcregrop reg;
- unsigned int raw;
- } rop;
-
- /* Start DE command. */
- struct gccmdstartde startde;
- struct gccmdstartderect rect;
-};
-
-/*******************************************************************************
-** Modular operations: filterkernel
-*/
-
-static const struct gccmdldstate gcmofilterkernel_shared_ldst =
- GCLDSTATE(gcregFilterKernelRegAddrs, 77);
-
-static const struct gccmdldstate gcmofilterkernel_horizontal_ldst =
- GCLDSTATE(gcregHoriFilterKernelRegAddrs, 77);
-
-static const struct gccmdldstate gcmofilterkernel_vertical_ldst =
- GCLDSTATE(gcregVertiFilterKernelRegAddrs, 77);
-
-struct gcmofilterkernel {
- /* Kernel array block. */
- struct gccmdldstate kernelarray_ldst;
-
- /* Array of kernel coefficients. */
- struct gcregfilterkernel kernelarray;
-};
-
-/*******************************************************************************
-** Modular operations: vrdst
-*/
-
-static const struct gccmdldstate gcmovrdst_config_ldst =
- GCLDSTATE(gcregDestAddressRegAddrs, 4);
-
-static const struct gccmdldstate gcmovrdst_rotationheight_ldst =
- GCLDSTATE(gcregDstRotationHeightRegAddrs, 1);
-
-struct gcmovrdst {
- /* Configuration block. */
- struct gccmdldstate config_ldst;
-
- /* gcregDestAddressRegAddrs */
- unsigned int address;
-
- /* gcregDestStrideRegAddrs */
- unsigned int stride;
-
- /* gcregDestRotationConfigRegAddrs */
- union {
- struct gcregdstrotationconfig reg;
- unsigned int raw;
- } rotation;
-
- /* gcregDestConfigRegAddrs */
- union {
- struct gcregdstconfig reg;
- unsigned int raw;
- } config;
-
- /* Alignment filler. */
- unsigned int _filler;
-
- /* gcregDstRotationHeightRegAddrs */
- struct gccmdldstate rotationheight_ldst;
-
- /* gcregDstRotationHeightRegAddrs */
- union {
- struct gcregdstrotationheight reg;
- unsigned int raw;
- } rotationheight;
-};
-
-/*******************************************************************************
-** Modular operations: vrconfigex
-*/
-
-static const struct gccmdldstate gcmovrconfigex_config_ldst =
- GCLDSTATE(gcregVRConfigExRegAddrs, 1);
-
-struct gcmovrconfigex {
- /* gcregVRConfigExRegAddrs */
- struct gccmdldstate config_ldst;
-
- /* gcregVRConfigExRegAddrs */
- union {
- struct gcregvrconfigex reg;
- unsigned int raw;
- } config;
-};
-
-/*******************************************************************************
-** Modular operations: startvr
-*/
-
-static const struct gccmdldstate gcmostartvr_scale_ldst =
- GCLDSTATE(gcregStretchFactorLowRegAddrs, 2);
-
-static const struct gccmdldstate gcmostartvr_rect_ldst =
- GCLDSTATE(gcregVRTargetWindowLowRegAddrs, 2);
-
-static const struct gccmdldstate gcmostartvr_config_ldst =
- GCLDSTATE(gcregVRConfigRegAddrs, 1);
-
-struct gcmostartvr {
- /* Scale factor block. */
- struct gccmdldstate scale_ldst;
-
- /* gcregStretchFactorLowRegAddrs */
- unsigned int scalex;
-
- /* gcregStretchFactorHighRegAddrs */
- unsigned int scaley;
-
- /* Alignment filler. */
- unsigned int _filler1;
-
- /* Target rectangle. */
- struct gccmdldstate rect_ldst;
-
- /* gcregVRTargetWindowLowRegAddrs */
- struct gcregvrtargetwindowlow lt;
-
- /* gcregVRTargetWindowHighRegAddrs */
- struct gcregvrtargetwindowhigh rb;
-
- /* Alignment filler. */
- unsigned int _filler2;
-
- /* Start video raster commad. */
- struct gccmdldstate config_ldst;
-
- /* gcregVRConfigRegAddrs */
- struct gcregvrconfig config;
-};
-
-#endif
diff --git a/bltsville/gcbv/mirror/include/gcx.h b/bltsville/gcbv/mirror/include/gcx.h
deleted file mode 100644
index 285762f..0000000
--- a/bltsville/gcbv/mirror/include/gcx.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright(c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Vivante Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCX_H
-#define GCX_H
-
-#include <pthread.h>
-#include "gcerror.h"
-#include "gcreg.h"
-#include "gcdbglog.h"
-
-#ifndef countof
-#define countof(a) \
-( \
- sizeof(a) / sizeof(a[0]) \
-)
-#endif
-
-#define GC_PTR2INT(p) \
-( \
- (unsigned int) (p) \
-)
-
-#define GC_ALIGN(n, align) \
-( \
- ((n) + ((align) - 1)) & ~((align) - 1) \
-)
-
-#define GCLOCK_TIMEOUT_SEC 10
-#define GCLOCK_TIMEOUT_JIF (msecs_to_jiffies(GCLOCK_TIMEOUT_SEC * 1000))
-
-#define GCLOCK_TYPE \
- pthread_mutex_t
-
-#define GCDEFINE_LOCK(name) \
- pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
-
-#define GCLOCK_INIT(lock) \
- if (pthread_mutex_init(lock, NULL)) { \
- GCERR("failed to init mutex.\n"); \
- }
-
-#define GCLOCK_DESTROY(lock) \
- if (pthread_mutex_destroy(lock)) { \
- GCERR("failed to destroy mutex.\n"); \
- }
-
-#define GCLOCK(lock) \
- if (pthread_mutex_lock(lock)) { \
- GCERR("failed to lock mutex.\n"); \
- }
-
-#define GCUNLOCK(lock) \
- if (pthread_mutex_unlock(lock)) { \
- GCERR("failed to unlock mutex.\n"); \
- }
-
-#endif
diff --git a/bltsville/gcbv/version.h b/bltsville/gcbv/version.h
deleted file mode 100644
index 431cb96..0000000
--- a/bltsville/gcbv/version.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2012,
- * Texas Instruments, Inc. and Vivante Corporation
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Texas Instruments, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL TEXAS INSTRUMENTS, INC. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#define VER_FILEVERSION 2,2,2,0
-#define VER_FILEVERSION_STR "2.2.2.0\0"
-#define VER_PRODUCTVERSION 2,2,2,0
-#define VER_PRODUCTVERSION_STR "2.2\0"
diff --git a/bltsville/ocd/README b/bltsville/ocd/README
deleted file mode 100644
index 20a1485..0000000
--- a/bltsville/ocd/README
+++ /dev/null
@@ -1 +0,0 @@
-git://github.com/graphics/ocd.git
diff --git a/bltsville/ocd/include/ocd.h b/bltsville/ocd/include/ocd.h
deleted file mode 100755
index 14e6fc6..0000000
--- a/bltsville/ocd/include/ocd.h
+++ /dev/null
@@ -1,801 +0,0 @@
-/*
- * ocd.h
- *
- * Open Color format Definitions
- *
- * Copyright (C) 2011 Texas Instruments, Inc.
- *
- * This file defines the Open Color format Definitions (OCD), an open,
- * extensible, color format definition.
- *
- * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0
- * Unported License. To view a copy of this license, visit
- * http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to
- * Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
- * 94041, USA.
- */
-
-#ifndef OCD_H
-#define OCD_H
-
-/*
- * ocdformat - specifies one of the supported color formats
- *
- * ocdformat consists of 8 bits indicating the vendor ID, followed by 24 bits
- * specified by the vendor.
- *
- * VENDOR_ALL is a common ID with formats defined below.
- */
-
-/****** Bits 31-24 are the vendor ID. The other 24 are vendor defined. ******/
-#define OCDFMTDEF_VENDOR_SHIFT 24
-#define OCDFMTDEF_VENDOR_MASK (0xFF << OCDFMTDEF_VENDOR_SHIFT)
-
-#define OCDFMTDEF_VENDOR_ALL \
- (0x00 << OCDFMTDEF_VENDOR_SHIFT) /* Common format */
-#define OCDFMTDEF_VENDOR_TI \
- (0x01 << OCDFMTDEF_VENDOR_SHIFT) /* Texas Instruments, Inc. */
-/* 0xF0-0xFF reserved */
-
-/***** OCDFMTDEF_VENDOR_ALL *****/
-/* The formats in this group are created using combinations of the values
- listed below. */
-
-/*
- * 33222222 222 21 1 1 1 11 111 1
- * 10987654 321 09 8 7 6 54 321 0 9 876 543210
- * [------] [-] [] | | | [] [-] | | [-] [----]
- * | | | | | | | | | | | |
- * | | | | | | | | | | | color bits minus 1
- * | | | | | | | | | | |
- * | | | | | | | | | | container
- * | | | | | | | | | |
- * | | | | | | | | | left justified
- * | | | | | | | | |
- * | | | | | | | | reversed
- * | | | | | | | |
- * | | | | | | | layout
- * | | | | | | |
- * | | | | | | subsampling
- * | | | | | |
- * | | | | | subsample position \
- * | | | | | |
- * | | | | non-premult/fill empty 0 > alpha components
- * | | | | |
- * | | | alpha /
- * | | |
- * | | standard
- * | |
- * | color space
- * |
- * vendor ID (VENDOR_ALL = 0x00)
- */
-
-/**** Bits 23-21 define the color space. ****/
-#define OCDFMTDEF_CS_SHIFT 21
-#define OCDFMTDEF_CS_MASK (7 << OCDFMTDEF_CS_SHIFT)
-
-#define OCDFMTDEF_CS_MONO \
- (0 << OCDFMTDEF_CS_SHIFT) /* Monochrome (luma only) */
-#define OCDFMTDEF_CS_LUT \
- (1 << OCDFMTDEF_CS_SHIFT) /* Look-up table (using palette) */
-#define OCDFMTDEF_CS_RGB \
- (2 << OCDFMTDEF_CS_SHIFT) /* Red, green, blue */
-#define OCDFMTDEF_CS_YCbCr \
- (3 << OCDFMTDEF_CS_SHIFT) /* YCbCr (YUV) (luma & chroma) */
-#define OCDFMTDEF_CS_ALPHA \
- (4 << OCDFMTDEF_CS_SHIFT) /* Alpha only (transparency) */
-/* 5 reserved */
-/* 6 reserved */
-/* 7 reserved */
-
-/**** Bits 20-19 define the standard ****/
-#define OCDFMTDEF_STD_SHIFT 19
-#define OCDFMTDEF_STD_MASK (3 << OCDFMTDEF_STD_SHIFT)
-
-#define OCDFMTDEF_STD_ITUR_601_YCbCr \
- (0 << OCDFMTDEF_STD_SHIFT) /* ITU-R BT.601 - YCbCr only */
-/* 0 default for non-YCbCr */
-#define OCDFMTDEF_STD_ITUR_709_YCbCr \
- (1 << OCDFMTDEF_STD_SHIFT) /* ITU-R BT.709 - YCbCr only */
-/* 1 reserved for non-YCbCr */
-/* 2 reserved */
-#define OCDFMTDEF_FULLSCALE_YCbCr \
- (3 << OCDFMTDEF_STD_SHIFT) /* RGB 0 to 255 =>
- YCbCr 0 to 255, -128 to 127 */
-/* 3 reserved for non-YCbCr */
-
-/**** Bits 18-16 are component modifiers for non-alpha c/s only ****/
-#define OCDFMTDEF_ALPHA_SHIFT 18
-#define OCDFMTDEF_ALPHA \
- (1 << OCDFMTDEF_ALPHA_SHIFT) /* An alpha component is added to the
- format */
-#define OCDFMTDEF_NON_PREMULT_SHIFT 17
-#define OCDFMTDEF_NON_PREMULT \
- (1 << OCDFMTDEF_NON_PREMULT_SHIFT) /* Component(s) is(are) not
- premultiplied by the alpha
- (default is
- premultiplied) */
-#define OCDFMTDEF_FILL_EMPTY_0_SHIFT \
- OCDFMTDEF_NON_PREMULT_SHIFT
-#define OCDFMTDEF_FILL_EMPTY_0 \
- OCDFMTDEF_NON_PREMULT /* Empty bits are hard-wired to 0
- (default is 1) */
-#define OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNMENT_SHIFT 16
-#define OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED \
- (0 << OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNMENT_SHIFT) /* Subsamples aligned
- w/1st non-subsample
- (e.g. MPEG-2) */
-#define OCDFMTDEF_SUBSAMPLE_HORZ_CENTERED \
- (1 << OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNMENT_SHIFT) /* Subsamples are
- between
- non-subsamples
- (e.g. MPEG-1) */
-
-/*** Bits 18-16 are used differently for alpha c/s ***/
-/* Bit 18 is reserved */
-/*** Bits 17-16 define the number of alpha components for alpha c/s ***/
-#define OCDFMTDEF_ALPHA_COMPONENTS_SHIFT 16
-#define OCDFMTDEF_ALPHA_COMPONENTS_MASK \
- (3 << OCDFMTDEF_ALPHA_COMPONENTS_SHIFT)
-
-#define OCDFMTDEF_ALPHA_COMPONENTS_1 (0 << OCDFMTDEF_ALPHA_COMPONENTS_SHIFT)
-#define OCDFMTDEF_ALPHA_COMPONENTS_2 (1 << OCDFMTDEF_ALPHA_COMPONENTS_SHIFT)
-#define OCDFMTDEF_ALPHA_COMPONENTS_3 (2 << OCDFMTDEF_ALPHA_COMPONENTS_SHIFT)
-#define OCDFMTDEF_ALPHA_COMPONENTS_4 (3 << OCDFMTDEF_ALPHA_COMPONENTS_SHIFT)
-
-/**** Bits 15-14 define subsampling ****/
-#define OCDFMTDEF_SUBSAMPLE_SHIFT 14
-#define OCDFMTDEF_SUBSAMPLE_MASK (3 << OCDFMTDEF_SUBSAMPLE_SHIFT)
-
-#define OCDFMTDEF_SUBSAMPLE_NONE \
- (0 << OCDFMTDEF_SUBSAMPLE_SHIFT) /* No subsampling;
- each pixel has each component */
-#define OCDFMTDEF_SUBSAMPLE_422_YCbCr \
- (1 << OCDFMTDEF_SUBSAMPLE_SHIFT) /* 4:2:2 subsampling;
- each horizontal pair of pixels
- has one Y (luma) component each,
- but shares one Cb and Cr (chroma)
- component. */
-/* 1 reserved for non-YCbCr */
-#define OCDFMTDEF_SUBSAMPLE_420_YCbCr \
- (2 << OCDFMTDEF_SUBSAMPLE_SHIFT) /* 4:2:0 subsampling;
- each square of four pixels has
- one Y (luma) component each, but
- shares one Cb and Cr (chroma)
- component. */
-/* 2 reserved for non-YCbCr */
-#define OCDFMTDEF_SUBSAMPLE_411_YCbCr \
- (3 << OCDFMTDEF_SUBSAMPLE_SHIFT) /* 4:1:1 subsampling;
- each horizontal four pixels have
- one Y (luma) component each, but
- shares one Cb and Cr (chroma)
- component. */
-/* 3 reserved for non-YCbCr */
-
-/**** Bits 13-11 define the memory layout
- (combined with _REVERSED and _LEFT_JUSTIFIED) ****/
-#define OCDFMTDEF_LAYOUT_SHIFT 11
-#define OCDFMTDEF_LAYOUT_MASK (7 << OCDFMTDEF_LAYOUT_SHIFT)
-
-#define OCDFMTDEF_PACKED \
- (0 << OCDFMTDEF_LAYOUT_SHIFT) /* Components interleaved together */
-#define OCDFMTDEF_DISTRIBUTED \
- (1 << OCDFMTDEF_LAYOUT_SHIFT) /* Components are distributed evenly
- across the container; e.g. a 64-bit
- container with four 8-bit components
- are distributed with 8 bits between
- them: __C0__C1__C2__C3 */
-#define OCDFMTDEF_2_PLANE_YCbCr \
- (2 << OCDFMTDEF_LAYOUT_SHIFT) /* Y component is separated from Cb & Cr
- components. After the Y plane, an
- interleaved CbCr plane follows. */
-/* 2 reserved for non-YCbCr */
-#define OCDFMTDEF_3_PLANE_STACKED \
- (3 << OCDFMTDEF_LAYOUT_SHIFT) /* Y, Cb, and Cr components are
- separated. After the Y plane is a Cb
- plane, and then a Cr plane. */
-/* 3 reserved for non-YCbCr and non-RGB */
-/* 4 reserved */
-/* 5 reserved */
-/* 6 reserved */
-#define OCDFMTDEF_3_PLANE_SIDE_BY_SIDE_YCbCr \
- (7 << OCDFMTDEF_LAYOUT_SHIFT) /* Y, Cb, and Cr components are
- separated. After the Y plane the Cb
- and Cr planes are separated but
- side-by-side in memory (interleaved
- on a line-by-line basis). */
-/* 7 reserved for non-YCbCr */
-
-/**** Bits 10-9 are layout modifiers. ****/
-#define OCDFMTDEF_REVERSED_SHIFT 10
-#define OCDFMTDEF_REVERSED \
- (1 << OCDFMTDEF_REVERSED_SHIFT) /* Order of components reversed
- (default is RGB or CbCr) */
-#define OCDFMTDEF_LEFT_JUSTIFIED_SHIFT 9
-#define OCDFMTDEF_LEFT_JUSTIFIED \
- (1 << OCDFMTDEF_LEFT_JUSTIFIED_SHIFT) /* Components are shifted
- left (default is shifted
- right); for 3-plane YCbCr,
- this indicates wasted space
- to the right of the Cb & Cr
- planes (stride matches Y
- plane). */
-
-/**** Bits 6-8 specify the container type. ****/
-#define OCDFMTDEF_CONTAINER_SHIFT 6
-#define OCDFMTDEF_CONTAINER_MASK (7 << OCDFMTDEF_CONTAINER_SHIFT)
-
-#define OCDFMTDEF_CONTAINER_8BIT (0 << OCDFMTDEF_CONTAINER_SHIFT)
-#define OCDFMTDEF_CONTAINER_16BIT (1 << OCDFMTDEF_CONTAINER_SHIFT)
-#define OCDFMTDEF_CONTAINER_24BIT (2 << OCDFMTDEF_CONTAINER_SHIFT)
-#define OCDFMTDEF_CONTAINER_32BIT (3 << OCDFMTDEF_CONTAINER_SHIFT)
-/* 4 (0x008000) reserved */
-#define OCDFMTDEF_CONTAINER_48BIT (5 << OCDFMTDEF_CONTAINER_SHIFT)
-/* 6 (0x00C000) reserved */
-#define OCDFMTDEF_CONTAINER_64BIT (7 << OCDFMTDEF_CONTAINER_SHIFT)
-
-/**** Bits 0-5 contain the total number of component bits minus one. ****/
-/* To calculate the number of bits for each RGBA component, use the following
- * formula:
- *
- * green bits = int((color bits + 2) / 3)
- * blue bits = int((color bits - green bits) / 2)
- * red bits = color bits - green bits - blue bits
- * alpha bits (when present) = container size - color bits
- *
- * Ex. 1: RGB16 -> 16 bits
- * green bits = int((16 + 2) / 3) = 6
- * blue bits = int((16 - 6) / 2) = 5
- * red bits = 16 - 6 - 5 = 5
- * alpha bits = n/a
- * Ex. 2: ARGB16 -> 16 bits
- * green bits = int((16 + 2) / 3) = 6
- * blue bits = int((16 - 6) / 2) = 5
- * red bits = 16 - 6 - 5 = 5
- * alpha bits = 24 - 16 = 8
- * Ex. 3: RGB32 -> 32 bits
- * green bits = int((32 + 2) / 3) = 11
- * blue bits = int((32 - 11) / 2) = 10
- * red bits = 32 - 11 - 10 = 11
- * alpha bits = n/a
- *
- * For planar formats, the container indicates the total number of bits on the
- * subsampled boundary, while the component bits are the average number of
- * bits per pixel.
- *
- * Ex. 1: YV12 -> YCbCr 4:2:0 w/8-bit samples -> 4x8 + 2x8 = 48 bit container
- * 48 bits / 4 pixels = 12 bpp
- * Ex. 2: NV16 -> YCbCr 4:2:2 w/8-bit samples -> 2x8 + 2x8 = 32 bit container
- * 24 bits / 2 pixels = 16 bpp
- */
-#define OCDFMTDEF_COMPONENTSIZEMINUS1_SHIFT 0
-#define OCDFMTDEF_COMPONENTSIZEMINUS1_MASK \
- (0x3F << OCDFMTDEF_COMPONENTSIZEMINUS1_SHIFT)
-
-
-/*
- * The formats below are constructed from the definitions above. However, not
- * all formats possible are specified (and named) below. The other formats
- * which can be uniquely formed using the above definitions are legitimate
- * formats, and may be used as well.
- */
-enum ocdformat {
- OCDFMT_UNKNOWN = -1,
- OCDFMT_NONE = OCDFMT_UNKNOWN,
-
- /*** Alpha only ***/
- /** Packed **/
- OCDFMT_ALPHA1 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_1 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (1 - 1),
- OCDFMT_ALPHA2 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_1 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (2 - 1),
- OCDFMT_ALPHA4 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_1 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (4 - 1),
- OCDFMT_ALPHA8 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_1 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (8 - 1),
- /* Sub-pixel */
- OCDFMT_ALPHA4x1 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_4 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (4 - 1),
- OCDFMT_ALPHA3x8 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_3 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_24BIT |
- (24 - 1),
- OCDFMT_ALPHA4x8 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_ALPHA |
- OCDFMTDEF_ALPHA_COMPONENTS_4 |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_32BIT |
- (32 - 1),
-
- /*** Monochrome ***/
- /** Packed **/
- OCDFMT_MONO1 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_MONO |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (1 - 1),
- OCDFMT_MONO2 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_MONO |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (2 - 1),
- OCDFMT_MONO4 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_MONO |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (4 - 1),
- OCDFMT_MONO8 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_MONO |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (8 - 1),
-
- /*** Palettized (look-up-table) ***/
- /** Packed **/
- OCDFMT_LUT1 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_LUT |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (1 - 1),
- OCDFMT_LUT2 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_LUT |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (2 - 1),
- OCDFMT_LUT4 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_LUT |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (4 - 1),
- OCDFMT_LUT8 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_LUT |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_8BIT |
- (8 - 1),
-
- /*** RGB ***/
- /** Packed **/
- /* No subsampling */
- OCDFMT_RGB12 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_16BIT |
- (12 - 1), /* (15):4:4:4 */
- OCDFMT_xRGB12 = OCDFMT_RGB12,
- OCDFMT_1RGB12 = OCDFMT_xRGB12,
- OCDFMT_0RGB12 = OCDFMT_xRGB12 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):4:4:4 */
-
- OCDFMT_BGR12 = OCDFMT_RGB12 |
- OCDFMTDEF_REVERSED, /* (15):4:4:4 */
- OCDFMT_xBGR12 = OCDFMT_BGR12,
- OCDFMT_1BGR12 = OCDFMT_xBGR12,
- OCDFMT_0BGR12 = OCDFMT_xBGR12 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):4:4:4 */
-
- OCDFMT_RGBx12 = OCDFMT_xRGB12 |
- OCDFMTDEF_LEFT_JUSTIFIED, /* 4:4:4:(15) */
- OCDFMT_RGB112 = OCDFMT_RGBx12,
- OCDFMT_RGB012 = OCDFMT_RGBx12 |
- OCDFMTDEF_FILL_EMPTY_0, /* 4:4:4:(0) */
-
- OCDFMT_BGRx12 = OCDFMT_xRGB12 |
- OCDFMTDEF_LEFT_JUSTIFIED |
- OCDFMTDEF_REVERSED, /* 4:4:4:(15) */
- OCDFMT_BGR112 = OCDFMT_BGRx12,
- OCDFMT_BGR012 = OCDFMT_BGRx12 |
- OCDFMTDEF_FILL_EMPTY_0, /* 4:4:4:(0) */
-
- OCDFMT_RGB15 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_16BIT |
- (15 - 1), /* (1):5:5:5 */
- OCDFMT_xRGB15 = OCDFMT_RGB15,
- OCDFMT_1RGB15 = OCDFMT_xRGB15,
- OCDFMT_0RGB15 = OCDFMT_xRGB15 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):5:5:5 */
-
- OCDFMT_BGR15 = OCDFMT_RGB15 |
- OCDFMTDEF_REVERSED, /* (1):5:5:5 */
- OCDFMT_xBGR15 = OCDFMT_BGR15,
- OCDFMT_1BGR15 = OCDFMT_xBGR15,
- OCDFMT_0BGR15 = OCDFMT_xBGR15 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):5:5:5 */
-
- OCDFMT_RGBx15 = OCDFMT_RGB15 |
- OCDFMTDEF_LEFT_JUSTIFIED, /* 5:5:5:(1) */
- OCDFMT_RGB115 = OCDFMT_RGBx15,
- OCDFMT_RGB015 = OCDFMT_RGBx15 |
- OCDFMTDEF_FILL_EMPTY_0, /* 5:5:5:(0) */
-
- OCDFMT_BGRx15 = OCDFMT_RGB15 |
- OCDFMTDEF_LEFT_JUSTIFIED |
- OCDFMTDEF_REVERSED, /* 5:5:5:(1) */
- OCDFMT_BGR115 = OCDFMT_BGRx15,
- OCDFMT_BGR015 = OCDFMT_BGRx15 |
- OCDFMTDEF_FILL_EMPTY_0, /* 5:5:5:(0) */
-
- OCDFMT_RGB16 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_16BIT |
- (16 - 1), /* 5:6:5 */
- OCDFMT_BGR16 = OCDFMT_RGB16 |
- OCDFMTDEF_REVERSED, /* 5:6:5 */
-
- OCDFMT_RGB24 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_24BIT |
- (24 - 1), /* 8:8:8 */
- OCDFMT_BGR24 = OCDFMT_RGB24 |
- OCDFMTDEF_REVERSED, /* 8:8:8 */
-
- OCDFMT_xRGB16 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_24BIT |
- (16 - 1), /* (255):5:6:5 */
- OCDFMT_1RGB16 = OCDFMT_xRGB16,
- OCDFMT_0RGB16 = OCDFMT_xRGB16 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):5:6:5 */
-
- OCDFMT_xBGR16 = OCDFMT_xRGB16 |
- OCDFMTDEF_REVERSED, /* (255):5:6:5 */
- OCDFMT_1BGR16 = OCDFMT_xBGR16,
- OCDFMT_0BGR16 = OCDFMT_xBGR16 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):5:6:5 */
-
- OCDFMT_RGBx16 = OCDFMT_xRGB16 |
- OCDFMTDEF_LEFT_JUSTIFIED, /* 5:6:5:(255) */
- OCDFMT_RGB116 = OCDFMT_RGBx16,
- OCDFMT_RGB016 = OCDFMT_RGBx16 |
- OCDFMTDEF_FILL_EMPTY_0, /* 5:6:5:(0) */
-
- OCDFMT_BGRx16 = OCDFMT_xRGB16 |
- OCDFMTDEF_LEFT_JUSTIFIED |
- OCDFMTDEF_REVERSED, /* 5:6:5:(255) */
- OCDFMT_BGR116 = OCDFMT_BGRx16,
- OCDFMT_BGR016 = OCDFMT_BGRx16 |
- OCDFMTDEF_FILL_EMPTY_0, /* 5:6:5:(0) */
-
- OCDFMT_xRGB24 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_32BIT |
- (24 - 1), /* (255):8:8:8 */
- OCDFMT_1RGB24 = OCDFMT_xRGB24,
- OCDFMT_0RGB24 = OCDFMT_xRGB24 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):8:8:8 */
-
- OCDFMT_xBGR24 = OCDFMT_xRGB24 |
- OCDFMTDEF_REVERSED, /* (255):8:8:8 */
- OCDFMT_1BGR24 = OCDFMT_xBGR24,
- OCDFMT_0BGR24 = OCDFMT_xBGR24 |
- OCDFMTDEF_FILL_EMPTY_0, /* (0):8:8:8 */
-
- OCDFMT_RGBx24 = OCDFMT_xRGB24 |
- OCDFMTDEF_LEFT_JUSTIFIED, /* 8:8:8:(255) */
- OCDFMT_RGB124 = OCDFMT_RGBx24,
- OCDFMT_RGB024 = OCDFMT_RGBx24 |
- OCDFMTDEF_FILL_EMPTY_0, /* 8:8:8:(0) */
-
- OCDFMT_BGRx24 = OCDFMT_xRGB24 |
- OCDFMTDEF_LEFT_JUSTIFIED |
- OCDFMTDEF_REVERSED, /* 8:8:8:(255) */
- OCDFMT_BGR124 = OCDFMT_BGRx24,
- OCDFMT_BGR024 = OCDFMT_BGRx24 |
- OCDFMTDEF_FILL_EMPTY_0, /* 8:8:8:(0) */
-
- /* Premultiplied ARGB */
- OCDFMT_ARGB12 = OCDFMT_xRGB12 |
- OCDFMTDEF_ALPHA, /* 4:4:4:4 */
- OCDFMT_ABGR12 = OCDFMT_xBGR12 |
- OCDFMTDEF_ALPHA, /* 4:4:4:4 */
- OCDFMT_RGBA12 = OCDFMT_RGBx12 |
- OCDFMTDEF_ALPHA, /* 4:4:4:4 */
- OCDFMT_BGRA12 = OCDFMT_BGRx12 |
- OCDFMTDEF_ALPHA, /* 4:4:4:4 */
-
- OCDFMT_ARGB16 = OCDFMT_xRGB16 |
- OCDFMTDEF_ALPHA, /* 8:5:6:5 */
- OCDFMT_ABGR16 = OCDFMT_ARGB16 |
- OCDFMTDEF_REVERSED, /* 8:5:6:5 */
- OCDFMT_RGBA16 = OCDFMT_ARGB16 |
- OCDFMTDEF_LEFT_JUSTIFIED, /* 5:6:5:8 */
- OCDFMT_BGRA16 = OCDFMT_ARGB16 |
- OCDFMTDEF_LEFT_JUSTIFIED |
- OCDFMTDEF_REVERSED, /* 5:6:5:8 */
-
- OCDFMT_ARGB24 = OCDFMT_xRGB24 |
- OCDFMTDEF_ALPHA, /* 8:8:8:8 */
- OCDFMT_ABGR24 = OCDFMT_xBGR24 |
- OCDFMTDEF_ALPHA, /* 8:8:8:8 */
- OCDFMT_RGBA24 = OCDFMT_RGBx24 |
- OCDFMTDEF_ALPHA, /* 8:8:8:8 */
- OCDFMT_BGRA24 = OCDFMT_BGRx24 |
- OCDFMTDEF_ALPHA, /* 8:8:8:8 */
-
- /* Non-premultiplied ARGB */
- OCDFMT_nARGB12 = OCDFMT_ARGB12 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_ARGB12_NON_PREMULT = OCDFMT_nARGB12,
-
- OCDFMT_nABGR12 = OCDFMT_ABGR12 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_ABGR12_NON_PREMULT = OCDFMT_nABGR12,
-
- OCDFMT_nRGBA12 = OCDFMT_RGBA12 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_RGBA12_NON_PREMULT = OCDFMT_nRGBA12,
-
- OCDFMT_nBGRA12 = OCDFMT_BGRA12 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_BGRA12_NON_PREMULT = OCDFMT_nBGRA12,
-
- OCDFMT_ARGB15 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_RGB |
- OCDFMTDEF_ALPHA |
- OCDFMTDEF_NON_PREMULT |
- OCDFMTDEF_SUBSAMPLE_NONE |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_16BIT |
- (15 - 1), /* 1:5:5:5 - "normal"
- format is not
- premultiplied */
- OCDFMT_nARGB15 = OCDFMT_ARGB15,
- OCDFMT_ARGB15_NON_PREMULT = OCDFMT_nARGB15,
-
- OCDFMT_ABGR15 = OCDFMT_ARGB15 |
- OCDFMTDEF_REVERSED, /* 1:5:5:5 - "normal"
- format is not
- premultiplied */
- OCDFMT_nABGR15 = OCDFMT_ABGR15,
- OCDFMT_ABGR15_NON_PREMULT = OCDFMT_nABGR15,
-
- OCDFMT_RGBA15 = OCDFMT_ARGB15 |
- OCDFMTDEF_LEFT_JUSTIFIED, /* 5:5:5:1 - "normal"
- format is not
- premultiplied */
- OCDFMT_nRGBA15 = OCDFMT_RGBA15,
- OCDFMT_RGBA15_NON_PREMULT = OCDFMT_nRGBA15,
-
- OCDFMT_BGRA15 = OCDFMT_ARGB15 |
- OCDFMTDEF_LEFT_JUSTIFIED |
- OCDFMTDEF_REVERSED, /* 5:5:5:1 - "normal"
- format is not
- premultiplied */
- OCDFMT_nBGRA15 = OCDFMT_BGRA15,
- OCDFMT_BGRA15_NON_PREMULT = OCDFMT_nRGBA15,
-
- OCDFMT_nARGB16 = OCDFMT_ARGB16 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_ARGB16_NON_PREMULT = OCDFMT_nARGB16,
-
- OCDFMT_nABGR16 = OCDFMT_ABGR16 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_ABGR16_NON_PREMULT = OCDFMT_nABGR16,
-
- OCDFMT_nRGBA16 = OCDFMT_RGBA16 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_RGBA16_NON_PREMULT = OCDFMT_nRGBA16,
-
- OCDFMT_nBGRA16 = OCDFMT_BGRA16 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_BGRA16_NON_PREMULT = OCDFMT_nBGRA16,
-
- OCDFMT_nARGB24 = OCDFMT_ARGB24 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_ARGB24_NON_PREMULT = OCDFMT_nARGB24,
-
- OCDFMT_nABGR24 = OCDFMT_ABGR24 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_ABGR24_NON_PREMULT = OCDFMT_nABGR24,
-
- OCDFMT_nRGBA24 = OCDFMT_RGBA24 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_RGBA24_NON_PREMULT = OCDFMT_nRGBA24,
-
- OCDFMT_nBGRA24 = OCDFMT_BGRA24 |
- OCDFMTDEF_NON_PREMULT,
- OCDFMT_BGRA24_NON_PREMULT = OCDFMT_nBGRA24,
-
- /*** YCbCr ***/
- /** Packed **/
- /* YCbCr 4:2:2 */
- OCDFMT_UYVY = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_SUBSAMPLE_422_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_PACKED |
- OCDFMTDEF_CONTAINER_32BIT |
- (16 - 1),
- OCDFMT_UYVY_601 = OCDFMT_UYVY |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_UYVY_709 = OCDFMT_UYVY |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
- OCDFMT_Y422 = OCDFMT_UYVY,
- OCDFMT_Y422_601 = OCDFMT_UYVY_601,
- OCDFMT_Y422_709 = OCDFMT_UYVY_709,
-
- OCDFMT_VYUY = OCDFMT_UYVY |
- OCDFMTDEF_REVERSED,
- OCDFMT_VYUY_601 = OCDFMT_VYUY |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_VYUY_709 = OCDFMT_VYUY |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_YUYV = OCDFMT_UYVY |
- OCDFMTDEF_LEFT_JUSTIFIED,
- OCDFMT_YUYV_601 = OCDFMT_YUYV |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_YUYV_709 = OCDFMT_YUYV |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
- OCDFMT_YUY2 = OCDFMT_YUYV,
- OCDFMT_YUY2_601 = OCDFMT_YUYV_601,
- OCDFMT_YUY2_709 = OCDFMT_YUYV_709,
-
- OCDFMT_YVYU = OCDFMT_VYUY |
- OCDFMTDEF_LEFT_JUSTIFIED,
- OCDFMT_YVYU_601 = OCDFMT_YVYU |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_YVYU_709 = OCDFMT_YVYU |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- /** 3-plane **/
- /* YCbCr 4:2:2 */
- OCDFMT_YV16 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_SUBSAMPLE_422_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_3_PLANE_STACKED |
- OCDFMTDEF_CONTAINER_32BIT |
- (16 - 1),
- OCDFMT_YV16_601 = OCDFMT_YV16 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_YV16_709 = OCDFMT_YV16 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- /* YCbCr 4:2:0 */
- OCDFMT_IYUV = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_SUBSAMPLE_420_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_3_PLANE_STACKED |
- OCDFMTDEF_CONTAINER_48BIT |
- (12 - 1),
- OCDFMT_IYUV_601 = OCDFMT_IYUV |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_IYUV_709 = OCDFMT_IYUV |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
- OCDFMT_I420 = OCDFMT_IYUV,
- OCDFMT_I420_601 = OCDFMT_IYUV_601,
- OCDFMT_I420_709 = OCDFMT_IYUV_709,
-
- OCDFMT_YV12 = OCDFMT_IYUV |
- OCDFMTDEF_REVERSED,
- OCDFMT_YV12_601 = OCDFMT_YV12 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_YV12_709 = OCDFMT_YV12 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_IMC3 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_SUBSAMPLE_420_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_3_PLANE_STACKED |
- OCDFMTDEF_LEFT_JUSTIFIED | /* Indicates wasted
- space to the
- right */
- OCDFMTDEF_CONTAINER_48BIT |
- (12 - 1),
- OCDFMT_IMC3_601 = OCDFMT_IMC3 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_IMC3_709 = OCDFMT_IMC3 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_IMC1 = OCDFMT_IMC3 |
- OCDFMTDEF_REVERSED,
- OCDFMT_IMC1_601 = OCDFMT_IMC1 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_IMC1_709 = OCDFMT_IMC1 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_IMC4 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_STD_ITUR_601_YCbCr |
- OCDFMTDEF_SUBSAMPLE_420_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_3_PLANE_SIDE_BY_SIDE_YCbCr |
- OCDFMTDEF_CONTAINER_48BIT |
- (12 - 1),
- OCDFMT_IMC4_601 = OCDFMT_IMC4 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_IMC4_709 = OCDFMT_IMC4 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_IMC2 = OCDFMT_IMC4 |
- OCDFMTDEF_REVERSED,
- OCDFMT_IMC2_601 = OCDFMT_IMC2 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_IMC2_709 = OCDFMT_IMC2 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- /** 2-plane **/
- /* YCbCr 4:2:2 */
- OCDFMT_NV16 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_SUBSAMPLE_422_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_2_PLANE_YCbCr |
- OCDFMTDEF_CONTAINER_32BIT |
- (16 - 1),
- OCDFMT_NV16_601 = OCDFMT_NV16 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_NV16_709 = OCDFMT_NV16 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_NV61 = OCDFMT_NV16 |
- OCDFMTDEF_REVERSED,
- OCDFMT_NV61_601 = OCDFMT_NV61 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_NV61_709 = OCDFMT_NV61 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- /* YCbCr 4:2:0 */
- OCDFMT_NV12 = OCDFMTDEF_VENDOR_ALL |
- OCDFMTDEF_CS_YCbCr |
- OCDFMTDEF_STD_ITUR_601_YCbCr |
- OCDFMTDEF_SUBSAMPLE_420_YCbCr |
- OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED |
- OCDFMTDEF_2_PLANE_YCbCr |
- OCDFMTDEF_CONTAINER_48BIT |
- (12 - 1),
- OCDFMT_NV12_601 = OCDFMT_NV12 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_NV12_709 = OCDFMT_NV12 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
- OCDFMT_NV21 = OCDFMT_NV12 |
- OCDFMTDEF_REVERSED,
- OCDFMT_NV21_601 = OCDFMT_NV21 |
- OCDFMTDEF_STD_ITUR_601_YCbCr,
- OCDFMT_NV21_709 = OCDFMT_NV21 |
- OCDFMTDEF_STD_ITUR_709_YCbCr,
-
-#ifdef OCD_EXTERNAL_INCLUDE
-#include OCD_EXTERNAL_INCLUDE
-#endif
-};
-
-#endif /* OCD_H */
diff --git a/bltsville/ocd/index.html b/bltsville/ocd/index.html
deleted file mode 100755
index 52eaa11..0000000
--- a/bltsville/ocd/index.html
+++ /dev/null
@@ -1,617 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
-
-<head>
-<meta http-equiv="Content-Language" content="en-us" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Need OCD?</title>
-<style type="text/css">
-.Header1 {
- margin: 0px 0 0 0;
- font-size: xx-large;
- font-weight: bold;
- text-align: left;
- line-height: normal;
- background-color: #E0E0E0;
-}
-.Header2 {
- font-size: xx-large;
- font-weight: bold;
- margin: 0px;
- line-height: 100%;
-}
-.Header3 {
- font-size: x-large;
- font-weight: bold;
- text-align: left;
- line-height: 100%;
- margin: 0px;
-}
-.note {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- margin-left: 40px;
-}
-.description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
-.download { float: right; }
-.inline_code {
- font-family: "Courier New", Courier, monospace;
- font-size: small;
-}
-.cmd_line {
- background: #000;
- color: #fff;
- padding: 10px;
- font-family: "Courier New", Courier, monospace;
- font-size: small;
-}
-.code_block {
- margin-left: 40px;
- font-family: "Courier New", Courier, monospace;
- font-size: small;
-}
-.filename {
- font-family: Arial, Helvetica, sans-serif;
- font-size: small;
-}
-.Code_Header {
- font-size: xx-large;
- font-weight: bold;
- text-align: left;
- font-family: "Courier New", Courier, monospace;
-}
-.Code_Header_2 {
- font-size: x-large;
- font-weight: bold;
- text-align: left;
- font-family: "Courier New", Courier, monospace;
-}
-.Code_Header_3 {
- font-size: large;
- font-weight: bold;
- text-align: left;
- font-family: "Courier New", Courier, monospace;
-}
-.indent {
- margin-left: 40px;
-}
-.ctr_thinbord {
- text-align: center;
- border: 1px solid #000000;
-}
-.style4 {
- border-width: 0px;
- margin-left: 40px;
-}
-.style5 {
- margin-left: 80px;
- font-family: "Courier New", Courier, monospace;
- font-size: small;
-}
-</style>
-</head>
-
-<body>
-
-<table style="width: 100%; line-height: 100%;">
- <tr>
- <td style="width: 484px">
-<img alt="" src="ocdlogo.jpg"/></td>
- <td>
- <p>OCD is a set of Open Color format Definitions.</p>
-<p>Color formats are used in everything from BLTers to video codecs, and from cameras to displays.&nbsp; But although
-there are plenty of common formats, the definition of the code specifying them is never the same. </p>
- <p>OCD attempts to solve this problem.&nbsp; It provides logical color format codes, and
- is extensible.</p>
-<hr />
- <table style="width: 100%">
- <tr>
- <td>
-<div class="download"><img alt="CC BY-ND" longdesc="Creative Commons Attribution-NoDerivs 3.0 Unported License" src="http://i.creativecommons.org/l/by-nd/3.0/88x31.png" width="88" height="31" /></div>
-<p class="Header2">License</p>
- </td>
- </tr>
- <tr>
- <td>
-<div>
-<p class="style17">The definitions are designed and maintained by Texas Instruments, Inc., but anyone is free to use them with no
-cost or obligation.</p>
-<p>This project is licensed under the <a href="http://creativecommons.org/licenses/by-nd/3.0/">Creative Commons
-Attribution-NoDerivs 3.0 Unported License</a>.</p>
-</div>
- </td>
- </tr>
- </table>
-<hr />
- <table style="width: 100%">
- <tr>
- <td>
- <p class="Header2">Source</p>
- </td>
- </tr>
- <tr>
- <td>
- <div class="download">
- <a href="http://github.com/graphics/ocd/zipball/master">
- <img width="90" alt="download zip" src="http://github.com/images/modules/download/zip.png" border="0"/></a>
- <a href="http://github.com/graphics/ocd/tarball/master">
- <img width="90" alt ="download tar" src="http://github.com/images/modules/download/tar.png" border="0"/></a>
- </div>
-<div>
- Get the source code on GitHub at <a href="http://github.com/graphics/ocd">graphics/ocd</a>, or download this
- project in either
- <a href="http://github.com/graphics/ocd/zipball/master">zip</a> or
- <a href="http://github.com/graphics/ocd/tarball/master">tar</a> formats.</div>
- <p>You can also clone the project with <a href="http://git-scm.com">Git</a> by running:</p>
- <pre><a class="cmd_line">$ git clone git://github.com/graphics/ocd</a></pre>
- </td>
- </tr>
- <tr><td><hr />
- <table style="width: 100%">
- <tr>
- <td class="Header2">Wiki</td>
- </tr>
- <tr>
- <td><a href="https://github.com/graphics/ocd/wiki">https://github.com/graphics/ocd/wiki</a></td>
- </tr>
- </table>
- </td></tr>
- </table>
- </td>
- </tr>
-</table>
-<hr />
-<p class="Header1">Header File</p>
-<p><span class="filename">ocd.h</span> contains the Open Color format Definitions.</p>
-<p class="Header1">How does it work?</p>
-<p>OCD was designed to allow a single 32-bit word (int) to specify the
-color format.&nbsp; The color format is specified as an enumeration.&nbsp; The
-enumeration values are constructed using bitfields.</p>
-<p>OCD breaks off a chunk of those 32 bits to specify a vendor ID.&nbsp; With
-this, OCD can allow vendors with very unique formats to obtain their own vendor
-ID and specify any of 16 million formats of their own.&nbsp; Minimum sharing
-here, but maximum flexibility.</p>
-<p class="Code_Header_2">OCDFMTDEF_VENDOR_ALL</p>
-<p>The power of OCD lies in the shared vendor ID.&nbsp; The
-<span class="inline_code">OCDFMTDEF_VENDOR_ALL</span> vendor ID indicates that the common set of definitions is
-being used.&nbsp; And this set of definitions is designed to specify pretty much
-any reasonably common color format in use today.</p>
-<p>When <span class="inline_code">OCDFMTDEF_VENDOR_ALL</span> is chosen, the remaining 24 bits of the format are
-sub-divided into bitfields used to describe the format.</p>
-<p class="Header2">Predefined Names</p>
-<p>A set of enumeration values are already provided with predefined names.&nbsp;
-It is easiest for clients to use these predefined values.&nbsp; They already cover most of
-the formats likely to be encountered.</p>
-<p class="note">NOTE:&nbsp; The naming conventions of the predefined formats are based on their byte
-ordering, so they are not endian-dependent.&nbsp; The exceptions are the 16-bit
-packed formats, which are little-endian.</p>
-<p>Some examples:</p>
-<p class="indent"><span class="inline_code">OCDFMT_RGB24</span> is a format
-where each pixel consists of 3 bytes (24 bits).&nbsp; The first byte in memory
-(at address A, read as a byte) is the red component.&nbsp; The second byte in
-memory (at address A+1, read as a byte) is the green component.&nbsp; The third
-byte in memory (at address A+2, read as a byte) is the blue component.</p>
-<p class="indent">OCDFMT_xRGB24 is a format where each pixel consists of 4 bytes
-(32 bits), but only 3 of these (24 bits) contain color information.&nbsp; The
-remaining 8 bits are ignored on a read, or filled with 0s on a write.</p>
-<p>If the format of interest is not already specified, it is still likely that
-the format is supported by the VENDOR_ALL design.&nbsp; Using the bitfields below, new combinations can be constructed.&nbsp; These
-combinations are already legal, but they just have not been given names.&nbsp;
-Users of OCD can define their own names in a separate header file and include it
-using the OCD_EXTERNAL_INCLUDE mechanism:</p>
-<p class="indent">file: <span class="filename">myocdfmts.h</span></p>
-<p class="style5">MYOCDFMT_ALPHAMONO8 = OCDFMT_MONO8 |<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-OCDFMTDEF_ALPHA,</p>
-<p class="indent">file:&nbsp; <span class="filename">mysource.c</span></p>
-<p class="style5">#define OCD_EXTERNAL_INCLUDE &quot;myocdfmts.h&quot;<br />
-#include &lt;ocd.h&gt;</p>
-<p class="Header2">VENDOR_ALL Bitfields</p>
-<p>The following bitfields only apply to the <span class="inline_code">
-OCDFMTDEF_VENDOR_ALL</span> color formats. </p>
-<p class="Header3">Color Space</p>
-<p>The first field specifies the color space.&nbsp; Currently there are five
-color spaces defined, but there is room for three more if the need arises:</p>
-<ul>
- <li>Monochrome - <span class="inline_code">OCDFMTDEF_CS_MONO</span></li>
- <li>Look-Up Table - <span class="inline_code">OCDFMTDEF_CS_LUT</span></li>
- <li>RGB -<span class="inline_code"> OCDFMTDEF_CS_RGB</span></li>
- <li>YCbCr (a.k.a. YUV) - <span class="inline_code">
- OCDFMTDEF_CS_YCbCr</span></li>
- <li>Alpha - <span class="inline_code">OCDFMTDEF_CS_ALPHA</span></li>
-</ul>
-<p>Once the color space has been selected, the remaining bits depend on that
-choice:</p>
-<p class="Code_Header_3">OCDFMTDEF_CS_MONO</p>
-<table class="style4">
- <tr>
- <td class="ctr_thinbord">31:24</td>
- <td class="ctr_thinbord">23:21</td>
- <td class="ctr_thinbord">20:19</td>
- <td class="ctr_thinbord">18</td>
- <td class="ctr_thinbord">17</td>
- <td class="ctr_thinbord">16</td>
- <td class="ctr_thinbord">15:14</td>
- <td class="ctr_thinbord">13:11</td>
- <td class="ctr_thinbord">10</td>
- <td class="ctr_thinbord">9</td>
- <td class="ctr_thinbord">8:6</td>
- <td class="ctr_thinbord">5:0</td>
- </tr>
- <tr>
- <td class="ctr_thinbord">00000000</td>
- <td class="ctr_thinbord">000</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">alpha</td>
- <td class="ctr_thinbord">non-premult/<br />
- fill empty 0</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reversed</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">container<br />
- size</td>
- <td class="ctr_thinbord">color<br />
- bits-1</td>
- </tr>
-</table>
-<p class="Code_Header_3">OCDFMTDEF_CS_LUT</p>
-<table class="style4">
- <tr>
- <td class="ctr_thinbord">31:24</td>
- <td class="ctr_thinbord">23:21</td>
- <td class="ctr_thinbord">20:19</td>
- <td class="ctr_thinbord">18</td>
- <td class="ctr_thinbord">17</td>
- <td class="ctr_thinbord">16</td>
- <td class="ctr_thinbord">15:14</td>
- <td class="ctr_thinbord">13:11</td>
- <td class="ctr_thinbord">10</td>
- <td class="ctr_thinbord">9</td>
- <td class="ctr_thinbord">8:6</td>
- <td class="ctr_thinbord">5:0</td>
- </tr>
- <tr>
- <td class="ctr_thinbord">00000000</td>
- <td class="ctr_thinbord">001</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reversed</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">container<br />
- size</td>
- <td class="ctr_thinbord">color<br />
- bits-1</td>
- </tr>
-</table>
-<p class="Code_Header_3">OCDFMTDEF_CS_RGB</p>
-<table class="style4">
- <tr>
- <td class="ctr_thinbord">31:24</td>
- <td class="ctr_thinbord">23:21</td>
- <td class="ctr_thinbord">20:19</td>
- <td class="ctr_thinbord">18</td>
- <td class="ctr_thinbord">17</td>
- <td class="ctr_thinbord">16</td>
- <td class="ctr_thinbord">15:14</td>
- <td class="ctr_thinbord">13:11</td>
- <td class="ctr_thinbord">10</td>
- <td class="ctr_thinbord">9</td>
- <td class="ctr_thinbord">8:6</td>
- <td class="ctr_thinbord">5:0</td>
- </tr>
- <tr>
- <td class="ctr_thinbord">00000000</td>
- <td class="ctr_thinbord">010</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">alpha</td>
- <td class="ctr_thinbord">non-premult/<br />
- fill empty 0</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">layout</td>
- <td class="ctr_thinbord">reversed</td>
- <td class="ctr_thinbord">left<br />
- justified</td>
- <td class="ctr_thinbord">container<br />
- size</td>
- <td class="ctr_thinbord">color<br />
- bits-1</td>
- </tr>
-</table>
-<p class="Code_Header_3">OCDFMTDEF_CS_YCbCr</p>
-<table class="style4">
- <tr>
- <td class="ctr_thinbord">31:24</td>
- <td class="ctr_thinbord">23:21</td>
- <td class="ctr_thinbord">20:19</td>
- <td class="ctr_thinbord">18</td>
- <td class="ctr_thinbord">17</td>
- <td class="ctr_thinbord">16</td>
- <td class="ctr_thinbord">15:14</td>
- <td class="ctr_thinbord">13:11</td>
- <td class="ctr_thinbord">10</td>
- <td class="ctr_thinbord">9</td>
- <td class="ctr_thinbord">8:6</td>
- <td class="ctr_thinbord">5:0</td>
- </tr>
- <tr>
- <td class="ctr_thinbord">00000000</td>
- <td class="ctr_thinbord">011</td>
- <td class="ctr_thinbord">standard</td>
- <td class="ctr_thinbord">alpha</td>
- <td class="ctr_thinbord">non-premult/<br />
- fill empty 0</td>
- <td class="ctr_thinbord">subsample<br />
- position</td>
- <td class="ctr_thinbord">subsampling</td>
- <td class="ctr_thinbord">layout</td>
- <td class="ctr_thinbord">reversed</td>
- <td class="ctr_thinbord">left<br />
- justified</td>
- <td class="ctr_thinbord">container<br />
- size</td>
- <td class="ctr_thinbord">color<br />
- bits-1</td>
- </tr>
-</table>
-<p class="Code_Header_3">OCDFMTDEF_CS_ALPHA</p>
-<table class="style4">
- <tr>
- <td class="ctr_thinbord">31:24</td>
- <td class="ctr_thinbord">23:21</td>
- <td class="ctr_thinbord">20:19</td>
- <td class="ctr_thinbord">18</td>
- <td class="ctr_thinbord">17</td>
- <td class="ctr_thinbord">16</td>
- <td class="ctr_thinbord">15:14</td>
- <td class="ctr_thinbord">13:11</td>
- <td class="ctr_thinbord">10</td>
- <td class="ctr_thinbord">9</td>
- <td class="ctr_thinbord">8:6</td>
- <td class="ctr_thinbord">5:0</td>
- </tr>
- <tr>
- <td class="ctr_thinbord">00000000</td>
- <td class="ctr_thinbord">100</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">reserved<br />
- (00)</td>
- <td class="ctr_thinbord">reversed</td>
- <td class="ctr_thinbord">reserved<br />
- (0)</td>
- <td class="ctr_thinbord">container<br />
- size</td>
- <td class="ctr_thinbord">alpha<br />
- bits-1</td>
- </tr>
-</table>
-<p>&nbsp;</p>
-<p class="Header3">Standard (YCbCr)</p>
-<p>This field specifies the standard being used for this color space.</p>
-<p>Currently, this field is only defined for the YCbCr color space:</p>
-<ul>
- <li><a href="http://www.itu.int/rec/R-REC-BT.601/en">ITU-R BT.601</a> - <span class="inline_code">
- OCDFMTDEF_STD_ITUR_601_YCbCr</span></li>
- <li><a href="http://www.itu.int/rec/R-REC-BT.709/en">ITU-R BT.709</a> - <span class="inline_code">
- OCDFMTDEF_STD_ITUR_709_YCbCr</span></li>
- <li><a href="http://www.w3.org/Graphics/JPEG/jfif3.pdf">Full Scale</a> - <span class="inline_code">
- OCDFMTDEF_FULLSCALE_YCbCr</span></li>
-</ul>
-<p>We believe that this field will be used to add linear format support in the
-very near future.</p>
-<p class="Header3">Fill Empty 0 (Mono, RGB, YCbCr)</p>
-<p>When there is no alpha included with a format, but the color components don&#39;t
-fill up the container, the remainder of the bits must be filled with something
-when written.&nbsp; When the <span class="inline_code">OCDFMTDEF_FILL_EMPTY_0</span>
-flag is not set, they are filled with 1.&nbsp; This is done in case they are
-later used as an alpha value, which will already represent an opaque pixel
-(whether the pixel is premultiplied or not).&nbsp; When the flag is set, they are
-filled with 0, to accommodate those environments where they are required to be
-cleared when unused.</p>
-<p class="Header3">Alpha (Mono, RGB, YCbCr)</p>
-<p>The <span class="inline_code">OCDFMTDEF_ALPHA</span> bit indicates that the
-format includes an alpha channel along with the main color components.</p>
-<p class="Header3">Non-Premult (Mono, RGB, YCbCr)</p>
-<p>Formats with alpha can have their color components pre-multiplied by the
-alpha component or not.&nbsp; When the <span class="inline_code">
-OCDFMTDEF_NON_PREMULT</span> bit is set, the color components are not
-premultiplied by the accompanying alpha.&nbsp; When the bit is not set, the
-color components are already multiplied by the alpha.</p>
-<p class="Header3">Subsampling (YCbCr)</p>
-<p>Some formats can be subsampled.&nbsp; At this point, only subsampled YCbCr is
-supported.</p>
-<ul>
- <li>No subsampling - <span class="inline_code">
- OCDFMTDEF_SUBSAMPLE_NONE</span></li>
- <li>4:2:2 subsampling - <span class="inline_code">
- OCDFMTDEF_SUBSAMPLE_422_YCbCr</span></li>
- <li>4:2:0 subsampling - <span class="inline_code">
- OCDFMTDEF_SUBSAMPLE_420_YCbCr</span></li>
- <li>4:1:1 subsampling - <span class="inline_code">
- OCDFMTDEF_SUBSAMPLE_411_YCbCr</span></li>
-</ul>
-<p class="Header3">Subsample Position (YCbCr)</p>
-<p>Subsampling can have different equivalent positions relative to the pixels.&nbsp;
-Vertical subsampling positions are consistent, so the following are supported to
-control the horizontal subsampling position:</p>
-<ul>
- <li><span class="inline_code">OCDFMTDEF_SUBSAMPLE_HORZ_ALIGNED </span>- subsamples are aligned with first pixel (e.g. MPEG-2
- spec)</li>
- <li><span class="inline_code">OCDFMTDEF_SUBSAMPLE_HORZ_CENTERED
- </span>- subsamples are centered between the pixels (e.g. MPEG-1
- spec)</li>
-</ul>
-<p>NOTE:&nbsp; It is encouraged that users of OCD be generous when handling
-subsampling positions.&nbsp; Allowing misaligned subsampling is preferable to
-complete failure.</p>
-<p class="Header3">Alpha Components (Alpha)</p>
-<p>To support applying alpha values to the individual components of other color
-spaces, the alpha color space can have more than one alpha value per pixel.&nbsp;
-This field specifies how many:</p>
-<ul>
- <li><span class="inline_code">OCDFMTDEF_ALPHA_COMPONENTS_1 </span>- pixel contains 1 alpha value (default)</li>
- <li><span class="inline_code">OCDFMTDEF_ALPHA_COMPONENTS_2
- </span>- pixel contains 2 alpha values</li>
- <li><span class="inline_code">OCDFMTDEF_ALPHA_COMPONENTS_3
- </span>- pixel contains 3 alpha values; suitable for RGB
- manipulation (e.g. FreeType/ClearType)</li>
- <li><span class="inline_code">OCDFMTDEF_ALPHA_COMPONENTS_4
- </span>-- pixel contains 4 alpha values</li>
-</ul>
-<p class="Header3">Layout (RGB, YCbCr)</p>
-<p>The layout values, in conjunction with the reversed and left-justified
-modifiers, specify how the pixel components are placed into memory.&nbsp; All
-non-RGB/YCbCr formats are packed.</p>
-<ul>
- <li><span class="inline_code">OCDFMTDEF_PACKED </span>- pixel
- components are sequential in memory, defaulting to RGB or CbCr
- order, right justified</li>
- <li><span class="inline_code">OCDFMTDEF_DISTRIBUTED </span>-
- pixel components that don&#39;t fill the container are evenly
- distributed within the container (e.g. 32 bits of ARGB in a
- 64-bit container is distributed 8 bits every 16 bits: xAxRxGxB)</li>
- <li><span class="inline_code">OCDFMTDEF_2_PLANE_YCbCr </span>-
- for subsampled formats only, Y plane is followed by subsampled
- interleaved CbCr plane</li>
- <li><span class="inline_code">OCDFMTDEF_3_PLANE_STACKED </span>-
- pixel components are divided into planes that are sequential in
- memory</li>
- <li><span class="inline_code">
- OCDFMTDEF_3_PLANE_SIDE_BY_SIDE_YCbCr </span>- for subsampled
- formats only pixel components are divided into planes, with the
- non-subsampled component followed by the subsampled components
- stored side-by-side (lines interleaved) </li>
-</ul>
-<p class="Header3">Reversed (RGB, YCbCr)</p>
-<p><span class="inline_code">OCDFMTDEF_REVERSED</span> indicates that the order
-of the color components is the opposite of the defaults.&nbsp; For RGB formats,
-this means BGR.&nbsp; For YCbCr formats, this means CrCb.</p>
-<p class="Header3">Left-Justified (RGB, YCbCr)</p>
-<p><span class="inline_code">OCDFMTDEF_LEFT_JUSTIFIED</span> indicates that the
-color components are shifted to the left, as opposed to the default of shifting
-to the right.</p>
-<p>Some examples for <span class="inline_code">OCDFMTDEF_REVERSED</span> and
-<span class="inline_code">OCDFMTDEF_LEFT_JUSTIFIED</span>:</p>
-<ul>
- <li>Packed RGB:&nbsp; x,R,G,B is the default byte order<ul>
- <li>x,B,G,R is the format if
- <span class="inline_code">OCDFMTDEF_REVERSED</span>
- is set</li>
- <li>R,G,B,x is the format if
- <span class="inline_code">
- OCDFMTDEF_LEFT_JUSTIFIED</span> is set</li>
- <li>B,G,R,x is the format if
- <span class="inline_code">OCDFMTDEF_REVERSED</span>
- and <span class="inline_code">
- OCDFMTDEF_LEFT_JUSTIFIED</span> are set</li>
- </ul>
- </li>
- <li>Packed YCbCr 4:2:2:&nbsp; U,Y,V,Y is the default byte order<ul>
- <li>V,Y,U,Y is the format if
- <span class="inline_code">OCDFMTDEF_REVERSED</span>
- is set</li>
- <li>Y,U,Y,V is the format if
- <span class="inline_code">
- OCDFMTDEF_LEFT_JUSTIFIED</span> is set</li>
- <li>Y,V,Y,U is the format if
- <span class="inline_code">OCDFMTDEF_REVERSED</span>
- and <span class="inline_code">
- OCDFMTDEF_LEFT_JUSTIFIED</span> are set</li>
- </ul>
- </li>
- <li>3-Plane YCbCr 4:2:2 or 4:2:0:&nbsp; The default is the Y
- plane, followed by the Cb plane and then the Cr plane.&nbsp; The
- Cb and Cr planes have half of the stride of the Y plane.<ul>
- <li>If <span class="inline_code">
- OCDFMTDEF_REVERSED</span> is set, the Cb and Cr
- planes are reversed.</li>
- <li><span class="inline_code">
- OCDFMTDEF_LEFT_JUSTIFIED</span> has a special
- case for this layout.&nbsp; When set, it
- indicates that the Cb and Cr planes have the
- same stride as the Y plane, and the Cb and Cr
- data is shifted to the left.</li>
- <li>If both <span class="inline_code">
- OCDFMTDEF_LEFT_REVERSED</span> and
- <span class="inline_code">
- OCDFMTDEF_LEFT_JUSTIFIED</span> are set, the Cb
- and Cr planes are reversed and double width.</li>
- </ul>
- </li>
- <li>2-Plane YCbCr 4:2:2 or 4:2:0:&nbsp; The default is the Y
- plane, followed by the CbCr interleaved plane, with the same
- stride as the Y plane.<ul>
- <li><span class="inline_code">OCDFMTDEF_REVERSED</span>
- swaps the Cb and Cr components.</li>
- </ul>
- </li>
-</ul>
-<p class="Header3">Container (All)</p>
-<p>The container field indicates the total size of all the bits of the color
-components of a color format.&nbsp; This does not include the alpha component,
-if it is present.</p>
-<ul>
- <li><span class="inline_code">OCDFMTDEF_CONTAINER_8BIT</span> -
- Indicates the container is 8 bits.&nbsp; When the pixel
- component size is 4 bits or less, multiple pixels are stored in
- the container.</li>
- <li><span class="inline_code">OCDFMTDEF_CONTAINER_16BIT</span> -
- Indicates the container is 16 bits.&nbsp; When the pixel
- component size is less than 16 bits, the remaining bits are
- available to be used as an alpha channel.</li>
- <li><span class="inline_code">OCDFMTDEF_CONTAINER_24BIT</span> -
- Indicates the container is 24 bits.&nbsp; When the pixel
- component size is less than 24 bits, the remaining bits are
- available to be used as an alpha channel.</li>
- <li><span class="inline_code">OCDFMTDEF_CONTAINER_32BIT</span> -
- Indicates the container is 32 bits.&nbsp; When the pixel
- component size is less than 32 bits, the remaining bits are
- available to be used as an alpha channel.</li>
- <li><span class="inline_code">OCDFMTDEF_CONTAINER_48BIT</span> -
- Indicates the container is 48 bits.&nbsp; When the pixel
- component size is less than 48 bits, the remaining bits are
- available to be used as an alpha channel.</li>
- <li><span class="inline_code">OCDFMTDEF_CONTAINER_64BIT</span> -
- Indicates the container is 64 bits.&nbsp; When the pixel
- component size is less than 64 bits, the remaining bits are
- available to be used as an alpha channel.</li>
-</ul>
-<p class="Header3">Component Size (All)</p>
-<p>The component size field specifies the total number of bits in the color
-components, not including the alpha component.&nbsp; (It is specified in the
-code with one subtracted.)</p>
-<p class="note">NOTE:&nbsp; The alpha only color space uses this to specify the total number
-of alpha bits.</p>
-</body>
-
-</html>
diff --git a/bltsville/ocd/ocdlogo.jpg b/bltsville/ocd/ocdlogo.jpg
deleted file mode 100755
index 0537386..0000000
--- a/bltsville/ocd/ocdlogo.jpg
+++ /dev/null
Binary files differ