1494N/A/*
1494N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1494N/A *
1494N/A * Permission is hereby granted, free of charge, to any person obtaining a
1494N/A * copy of this software and associated documentation files (the "Software"),
1494N/A * to deal in the Software without restriction, including without limitation
1494N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1494N/A * and/or sell copies of the Software, and to permit persons to whom the
1494N/A * Software is furnished to do so, subject to the following conditions:
1494N/A *
1494N/A * The above copyright notice and this permission notice (including the next
1494N/A * paragraph) shall be included in all copies or substantial portions of the
1494N/A * Software.
1494N/A *
1494N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1494N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1494N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1494N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1494N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1494N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1494N/A * DEALINGS IN THE SOFTWARE.
1494N/A */
1494N/A
1494N/A/*
1494N/A * Copyright (c) 2012 Intel Corporation. All rights reserved.
1494N/A */
1494N/A
1494N/A/*
1494N/A * Common misc module interfaces of DRM under Solaris
1494N/A */
1494N/A
1494N/A/*
1494N/A * I915 DRM Driver for Solaris
1494N/A *
1494N/A * This driver provides the hardware 3D acceleration support for Intel
1494N/A * integrated video devices (e.g. i8xx/i915/i945 series chipsets), under the
1494N/A * DRI (Direct Rendering Infrastructure). DRM (Direct Rendering Manager) here
1494N/A * means the kernel device driver in DRI.
1494N/A *
1494N/A * I915 driver is a device dependent driver only, it depends on a misc module
1494N/A * named drm for generic DRM operations.
1494N/A *
1494N/A * This driver also calls into gfx and agpmaster misc modules respectively for
1494N/A * generic graphics operations and AGP master device support.
1494N/A */
1494N/A
1494N/A#ifndef _SYS_DRM_SUNMOD_H_
1494N/A#define _SYS_DRM_SUNMOD_H_
1494N/A
1494N/A#ifdef __cplusplus
1494N/Aextern "C" {
1494N/A#endif
1494N/A
1494N/A#include <sys/types.h>
1494N/A#include <sys/errno.h>
1494N/A#include <sys/conf.h>
1494N/A#include <sys/kmem.h>
1494N/A#include <sys/visual_io.h>
1494N/A#include <sys/fbio.h>
1494N/A#include <sys/ddi.h>
1494N/A#include <sys/sunddi.h>
1494N/A#include <sys/stat.h>
1494N/A#include <sys/file.h>
1494N/A#include <sys/open.h>
1494N/A#include <sys/modctl.h>
1494N/A#include <sys/pci.h>
1494N/A#include <sys/kd.h>
1494N/A#include <sys/ddi_impldefs.h>
1494N/A#include <sys/sunldi.h>
1494N/A#include <sys/mkdev.h>
1494N/A#include <sys/gfx_private.h>
1494N/A#include <sys/agpgart.h>
1494N/A#include <sys/agp/agpdefs.h>
1494N/A#include <sys/agp/agpmaster_io.h>
1494N/A#include "drmP.h"
1494N/A#include <sys/modctl.h>
1494N/A
1494N/A
1494N/A/* graphics name for the common graphics minor node */
1494N/A#define GFX_NAME "gfx"
1494N/A
1494N/A/*
1494N/A * softstate for DRM module
1494N/A */
1494N/Atypedef struct drm_instance_state {
1494N/A kmutex_t mis_lock;
1494N/A kmutex_t dis_ctxlock;
1494N/A major_t mis_major;
1494N/A dev_info_t *mis_dip;
1494N/A drm_device_t *mis_devp;
1494N/A ddi_acc_handle_t mis_cfg_hdl;
1494N/A agp_master_softc_t *mis_agpm; /* agpmaster softstate ptr */
1494N/A gfxp_vgatext_softc_ptr_t mis_gfxp; /* gfx softstate */
1494N/A} drm_inst_state_t;
1494N/A
1494N/A
1494N/Astruct drm_inst_state_list {
1494N/A drm_inst_state_t disl_state;
1494N/A struct drm_inst_state_list *disl_next;
1494N/A
1494N/A};
1494N/Atypedef struct drm_inst_state_list drm_inst_list_t;
1494N/A
1494N/Aextern struct list_head drm_iomem_list;
1494N/A
1494N/Astatic int drm_sun_open(dev_t *, int, int, cred_t *);
1494N/Astatic int drm_sun_close(dev_t, int, int, cred_t *);
1494N/Astatic int drm_sun_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
1494N/Astatic int drm_sun_devmap(dev_t, devmap_cookie_t,
1494N/A offset_t, size_t, size_t *, uint_t);
1494N/Astatic int drm_sun_chpoll(dev_t, short, int, short *, struct pollhead **);
1494N/Astatic int drm_sun_read(dev_t, struct uio *, cred_t *);
1494N/A
1494N/A#ifdef __cplusplus
1494N/A}
1494N/A#endif
1494N/A
1494N/A#endif /* _SYS_DRM_SUNMOD_H_ */