/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#if sparc
/* #define DGA_DEBUG */
#ifdef DGA_DEBUG
#else
#define DEBUG_PRINT(x)
#endif
#include <unistd.h> /* ioctl */
#include <stdlib.h>
#include <sys/visual_io.h>
#include <string.h>
/* X11 */
#include "jni.h"
#include "jvm_md.h"
#include "jdga.h"
#include "jdgadevice.h"
#include <dlfcn.h>
#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
struct _SolarisDgaLibInfo {
/* The general (non-device specific) information */
unsigned long count;
/* The device specific memory mapping information */
};
return drawable;
}
if (IsXineramaOn == NULL) {
if (sym != 0) {
}
} else {
}
}
}
}
void *handle = 0;
int fd;
int i;
/* check in the devices list */
i++, curDevInfo++) {
/* we already have such a device, return it */
return curDevInfo;
}
}
if (i == MAX_FB_TYPES) {
/* we're out of slots, return NULL */
return NULL;
}
/* we use RTLD_NOW because of bug 4032715 */
if (handle != 0) {
if (sym != 0) {
}
if (ret == JDGA_SUCCESS) {
return curDevInfo;
}
}
}
return NULL;
}
static int
{
return JDGA_FAILED;
}
}
}
static void
{
DEBUG_PRINT(("winclose() called\n"));
}
static jboolean
{
int screen;
/* return true if any screen supports DGA and we
have a library for this type of framebuffer */
if (dgaDrawable != 0) {
return JNI_TRUE;
}
}
}
return JNI_FALSE;
}
static int firstInitDone = 0;
static JDgaStatus
{
/* Note: DGA_INIT can be called multiple times according to docs */
DEBUG_PRINT(("DGA_INIT called\n"));
DGA_INIT();
return JDGA_FAILED;
}
return JDGA_SUCCESS;
}
static JDgaStatus
{
int vis;
int i;
unsigned long k;
if (*dgaDev) {
*dgaDev = 0;
}
}
if (*dgaDev == 0) {
i++, pCachedInfo++) {
*dgaDev = pCachedInfo;
break;
}
}
if (*dgaDev == 0) {
if (i < MAX_CACHED_INFO) { /* slot can be used for new info */
*dgaDev = pCachedInfo;
} else {
/* find the least used slot but does not handle an overflow of
the counter */
for (i = 0, k = 0xffffffff; i < MAX_CACHED_INFO ;
i++, pCachedInfo++) {
if (k > pCachedInfo->count) {
k = pCachedInfo->count;
*dgaDev = pCachedInfo;
}
}
pCachedInfo = *dgaDev;
}
/* the slot might be used for another device */
pCachedInfo->devInfo = 0;
}
}
}
/* this usually means that the drawable is spanned across
screens in xinerama mode - we can't handle this for now */
return JDGA_FAILED;
} else {
/* check if the drawable has been moved to another screen
since last time */
}
}
return JDGA_UNAVAILABLE;
}
if (type != DGA_DRAW_PIXMAP &&
DEBUG_PRINT(("memory map failed for 0x%08x (depth = %d)\n",
return JDGA_UNAVAILABLE;
}
} else {
}
if (needsSync) {
}
if (type == DGA_DRAW_PIXMAP) {
if (site == DGA_SITE_SYSTEM) {
} else {
}
} else {
return JDGA_UNAVAILABLE;
}
} else {
if (site == DGA_SITE_NULL) {
return JDGA_UNAVAILABLE;
}
}
/* get the screen address of the drawable */
/* translate rendering coordinates relative to device bbox */
switch (vis) {
case DGA_VIS_UNOBSCURED:
DEBUG_PRINT(("unobscured vis at (%d, %d) => (%d, %d)\n",
break;
case DGA_VIS_PARTIALLY_OBSCURED: {
/*
* fix for #4305271
* the dga_draw_clipinfo call returns the clipping bounds
* in short ints, but use only full size ints for all comparisons.
*/
short *ptr;
/*
* iterate to find out whether the clipped blit draws to a
* single clipping rectangle
*/
}
}
}
}
/* First rectangle intersection */
} else {
/* Can we merge this rect with previous? */
{
/* X ranges match, Y ranges touch */
/* => absorb the Y ranges together */
{
/* Y ranges match, X ranges touch */
/* => Absorb the X ranges together */
} else {
/* Assertion: any other combination */
/* means non-rectangular intersect */
return JDGA_FAILED;
}
}
}
}
ptr++; /* advance past DGA_X_EOL */
}
DEBUG_PRINT(("DGA drawable fits\n"));
break;
}
case DGA_VIS_FULLY_OBSCURED:
DEBUG_PRINT(("fully obscured vis\n"));
break;
default:
return JDGA_FAILED;
}
return JDGA_SUCCESS;
}
static JDgaStatus
{
}
return JDGA_SUCCESS;
}
static void
{
}
static void
{
int i;
i++, pCachedInfo++) {
}
}
}
i++, curDevInfo++) {
}
}
#endif