1494N/A/* BEGIN CSTYLED */
1494N/A
1494N/A/*
1494N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1494N/A */
1494N/A
1494N/A/*
1494N/A * Copyright © 2006 Keith Packard
1494N/A * Copyright © 2007-2008 Dave Airlie
1494N/A * Copyright (c) 2007-2008, 2013, Intel Corporation
1494N/A * Jesse Barnes <jesse.barnes@intel.com>
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 shall be included in
1494N/A * all copies or substantial portions of the 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1494N/A * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1494N/A * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1494N/A * OTHER DEALINGS IN THE SOFTWARE.
1494N/A */
1494N/A#ifndef __DRM_CRTC_H__
1494N/A#define __DRM_CRTC_H__
1494N/A
1494N/A#include <sys/ksynch.h>
1494N/A#include "drm.h"
1494N/A#include "drmP.h"
1494N/A#include "drm_sun_idr.h"
1494N/A#include "drm_sun_i2c.h"
1494N/A#include "drm_fourcc.h"
1494N/A
1494N/Astruct drm_device;
1494N/Astruct drm_mode_set;
1494N/Astruct drm_framebuffer;
1494N/Astruct drm_object_properties;
1494N/A
1494N/A
1494N/A#define DRM_MODE_OBJECT_CRTC 0xcccccccc
1494N/A#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
1494N/A#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
1494N/A#define DRM_MODE_OBJECT_MODE 0xdededede
1494N/A#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
1494N/A#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
1494N/A#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
1494N/A#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
1494N/A
1494N/Astruct drm_mode_object {
1494N/A uint32_t id;
1494N/A uint32_t type;
1494N/A struct drm_object_properties *properties;
1494N/A};
1494N/A
1494N/A#define DRM_OBJECT_MAX_PROPERTY 24
1494N/Astruct drm_object_properties {
1494N/A int count;
1494N/A uint32_t ids[DRM_OBJECT_MAX_PROPERTY];
1494N/A uint64_t values[DRM_OBJECT_MAX_PROPERTY];
1494N/A};
1494N/A
1494N/A/*
1494N/A * Note on terminology: here, for brevity and convenience, we refer to connector
1494N/A * control chips as 'CRTCs'. They can control any type of connector, VGA, LVDS,
1494N/A * DVI, etc. And 'screen' refers to the whole of the visible display, which
1494N/A * may span multiple monitors (and therefore multiple CRTC and connector
1494N/A * structures).
1494N/A */
1494N/A
1494N/Aenum drm_mode_status {
1494N/A MODE_OK = 0, /* Mode OK */
1494N/A MODE_HSYNC, /* hsync out of range */
1494N/A MODE_VSYNC, /* vsync out of range */
1494N/A MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
1494N/A MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
1494N/A MODE_BAD_WIDTH, /* requires an unsupported linepitch */
1494N/A MODE_NOMODE, /* no mode with a maching name */
1494N/A MODE_NO_INTERLACE, /* interlaced mode not supported */
1494N/A MODE_NO_DBLESCAN, /* doublescan mode not supported */
1494N/A MODE_NO_VSCAN, /* multiscan mode not supported */
1494N/A MODE_MEM, /* insufficient video memory */
1494N/A MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
1494N/A MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
1494N/A MODE_MEM_VIRT, /* insufficient video memory given virtual size */
1494N/A MODE_NOCLOCK, /* no fixed clock available */
1494N/A MODE_CLOCK_HIGH, /* clock required is too high */
1494N/A MODE_CLOCK_LOW, /* clock required is too low */
1494N/A MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
1494N/A MODE_BAD_HVALUE, /* horizontal timing was out of range */
1494N/A MODE_BAD_VVALUE, /* vertical timing was out of range */
1494N/A MODE_BAD_VSCAN, /* VScan value out of range */
1494N/A MODE_HSYNC_NARROW, /* horizontal sync too narrow */
1494N/A MODE_HSYNC_WIDE, /* horizontal sync too wide */
1494N/A MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
1494N/A MODE_HBLANK_WIDE, /* horizontal blanking too wide */
1494N/A MODE_VSYNC_NARROW, /* vertical sync too narrow */
1494N/A MODE_VSYNC_WIDE, /* vertical sync too wide */
1494N/A MODE_VBLANK_NARROW, /* vertical blanking too narrow */
1494N/A MODE_VBLANK_WIDE, /* vertical blanking too wide */
1494N/A MODE_PANEL, /* exceeds panel dimensions */
1494N/A MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
1494N/A MODE_ONE_WIDTH, /* only one width is supported */
1494N/A MODE_ONE_HEIGHT, /* only one height is supported */
1494N/A MODE_ONE_SIZE, /* only one resolution is supported */
1494N/A MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
1494N/A MODE_UNVERIFIED = -3, /* mode needs to reverified */
1494N/A MODE_BAD = -2, /* unspecified reason */
1494N/A MODE_ERROR = -1 /* error condition */
1494N/A};
1494N/A
1494N/A#define DRM_MODE_TYPE_CLOCK_CRTC_C (DRM_MODE_TYPE_CLOCK_C | \
1494N/A DRM_MODE_TYPE_CRTC_C)
1494N/A
1494N/A#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
1494N/A .name = nm, .status = 0, .type = (t), .clock = (c), \
1494N/A .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
1494N/A .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
1494N/A .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
1494N/A .vscan = (vs), .flags = (f), \
1494N/A .base.type = DRM_MODE_OBJECT_MODE
1494N/A
1494N/A#define CRTC_INTERLACE_HALVE_V 0x1 /* halve V values for interlacing */
1494N/A
1494N/Astruct drm_display_mode {
1494N/A /* Header */
1494N/A struct list_head head;
1494N/A struct drm_mode_object base;
1494N/A
1494N/A char name[DRM_DISPLAY_MODE_LEN];
1494N/A
1494N/A enum drm_mode_status status;
1494N/A unsigned int type;
1494N/A
1494N/A /* Proposed mode values */
1494N/A int clock; /* in kHz */
1494N/A int hdisplay;
1494N/A int hsync_start;
1494N/A int hsync_end;
1494N/A int htotal;
1494N/A int hskew;
1494N/A int vdisplay;
1494N/A int vsync_start;
1494N/A int vsync_end;
1494N/A int vtotal;
1494N/A int vscan;
1494N/A unsigned int flags;
1494N/A
1494N/A /* Addressable image size (may be 0 for projectors, etc.) */
1494N/A int width_mm;
1494N/A int height_mm;
1494N/A
1494N/A /* Actual mode we give to hw */
1494N/A int clock_index;
1494N/A int synth_clock;
1494N/A int crtc_hdisplay;
1494N/A int crtc_hblank_start;
1494N/A int crtc_hblank_end;
1494N/A int crtc_hsync_start;
1494N/A int crtc_hsync_end;
1494N/A int crtc_htotal;
1494N/A int crtc_hskew;
1494N/A int crtc_vdisplay;
1494N/A int crtc_vblank_start;
1494N/A int crtc_vblank_end;
1494N/A int crtc_vsync_start;
1494N/A int crtc_vsync_end;
1494N/A int crtc_vtotal;
1494N/A
1494N/A /* Driver private mode info */
1494N/A int private_size;
1494N/A int *private;
1494N/A int private_flags;
1494N/A
1494N/A int vrefresh; /* in Hz */
1494N/A int hsync; /* in kHz */
1494N/A};
1494N/A
1494N/Aenum drm_connector_status {
1494N/A connector_status_connected = 1,
1494N/A connector_status_disconnected = 2,
1494N/A connector_status_unknown = 3,
1494N/A};
1494N/A
1494N/Aenum subpixel_order {
1494N/A SubPixelUnknown = 0,
1494N/A SubPixelHorizontalRGB,
1494N/A SubPixelHorizontalBGR,
1494N/A SubPixelVerticalRGB,
1494N/A SubPixelVerticalBGR,
1494N/A SubPixelNone,
1494N/A};
1494N/A
1494N/A#define DRM_COLOR_FORMAT_RGB444 (1<<0)
1494N/A#define DRM_COLOR_FORMAT_YCRCB444 (1<<1)
1494N/A#define DRM_COLOR_FORMAT_YCRCB422 (1<<2)
1494N/A/*
1494N/A * Describes a given display (e.g. CRT or flat panel) and its limitations.
1494N/A */
1494N/Astruct drm_display_info {
1494N/A char name[DRM_DISPLAY_INFO_LEN];
1494N/A
1494N/A /* Physical size */
1494N/A unsigned int width_mm;
1494N/A unsigned int height_mm;
1494N/A
1494N/A /* Clock limits FIXME: storage format */
1494N/A unsigned int min_vfreq, max_vfreq;
1494N/A unsigned int min_hfreq, max_hfreq;
1494N/A unsigned int pixel_clock;
1494N/A unsigned int bpc;
1494N/A
1494N/A enum subpixel_order subpixel_order;
1494N/A u32 color_formats;
1494N/A
1494N/A u8 cea_rev;
1494N/A};
1494N/A
1494N/Astruct drm_framebuffer_funcs {
1494N/A /* note: use drm_framebuffer_remove() */
1494N/A void (*destroy)(struct drm_framebuffer *framebuffer);
1494N/A int (*create_handle)(struct drm_framebuffer *fb,
1494N/A struct drm_file *file_priv,
1494N/A unsigned int *handle);
1494N/A /**
1494N/A * Optinal callback for the dirty fb ioctl.
1494N/A *
1494N/A * Userspace can notify the driver via this callback
1494N/A * that a area of the framebuffer has changed and should
1494N/A * be flushed to the display hardware.
1494N/A *
1494N/A * See documentation in drm_mode.h for the struct
1494N/A * drm_mode_fb_dirty_cmd for more information as all
1494N/A * the semantics and arguments have a one to one mapping
1494N/A * on this function.
1494N/A */
1494N/A int (*dirty)(struct drm_framebuffer *framebuffer,
1494N/A struct drm_file *file_priv, unsigned flags,
1494N/A unsigned color, struct drm_clip_rect *clips,
1494N/A unsigned num_clips);
1494N/A};
1494N/A
1494N/Astruct drm_framebuffer {
1494N/A struct drm_device *dev;
1494N/A /*
1494N/A * Note that the fb is refcounted for the benefit of driver internals,
1494N/A * for example some hw, disabling a CRTC/plane is asynchronous, and
1494N/A * scanout does not actually complete until the next vblank. So some
1494N/A * cleanup (like releasing the reference(s) on the backing GEM bo(s))
1494N/A * should be deferred. In cases like this, the driver would like to
1494N/A * hold a ref to the fb even though it has already been removed from
1494N/A * userspace perspective.
1494N/A */
1494N/A struct kref refcount;
1494N/A /*
1494N/A * Place on the dev->mode_config.fb_list, access protected by
1494N/A * dev->mode_config.fb_lock.
1494N/A */
1494N/A struct list_head head;
1494N/A struct drm_mode_object base;
1494N/A const struct drm_framebuffer_funcs *funcs;
1494N/A unsigned int pitches[4];
1494N/A unsigned int offsets[4];
1494N/A unsigned int width;
1494N/A unsigned int height;
1494N/A /* depth can be 15 or 16 */
1494N/A unsigned int depth;
1494N/A int bits_per_pixel;
1494N/A int flags;
1494N/A uint32_t pixel_format; /* fourcc format */
1494N/A struct list_head filp_head;
1494N/A /* if you are using the helper */
1494N/A void *helper_private;
1494N/A};
1494N/A
1494N/Astruct drm_property_blob {
1494N/A struct drm_mode_object base;
1494N/A struct list_head head;
1494N/A unsigned int length;
1494N/A unsigned char data[];
1494N/A};
1494N/A
1494N/Astruct drm_property_enum {
1494N/A uint64_t value;
1494N/A struct list_head head;
1494N/A char name[DRM_PROP_NAME_LEN];
1494N/A};
1494N/A
1494N/Astruct drm_property {
1494N/A struct list_head head;
1494N/A struct drm_mode_object base;
1494N/A uint32_t flags;
1494N/A char name[DRM_PROP_NAME_LEN];
1494N/A uint32_t num_values;
1494N/A uint64_t *values;
1494N/A
1494N/A struct list_head enum_blob_list;
1494N/A};
1494N/A
1494N/Astruct drm_crtc;
1494N/Astruct drm_connector;
1494N/Astruct drm_encoder;
1494N/Astruct drm_pending_vblank_event;
1494N/Astruct drm_plane;
1494N/A
1494N/A/**
1494N/A * drm_crtc_funcs - control CRTCs for a given device
1494N/A * @save: save CRTC state
1494N/A * @restore: restore CRTC state
1494N/A * @reset: reset CRTC after state has been invalidate (e.g. resume)
1494N/A * @cursor_set: setup the cursor
1494N/A * @cursor_move: move the cursor
1494N/A * @gamma_set: specify color ramp for CRTC
1494N/A * @destroy: deinit and free object
1494N/A * @set_property: called when a property is changed
1494N/A * @set_config: apply a new CRTC configuration
1494N/A * @page_flip: initiate a page flip
1494N/A *
1494N/A * The drm_crtc_funcs structure is the central CRTC management structure
1494N/A * in the DRM. Each CRTC controls one or more connectors (note that the name
1494N/A * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc.
1494N/A * connectors, not just CRTs).
1494N/A *
1494N/A * Each driver is responsible for filling out this structure at startup time,
1494N/A * in addition to providing other modesetting features, like i2c and DDC
1494N/A * bus accessors.
1494N/A */
1494N/Astruct drm_crtc_funcs {
1494N/A /* Save CRTC state */
1494N/A void (*save)(struct drm_crtc *crtc); /* suspend? */
1494N/A /* Restore CRTC state */
1494N/A void (*restore)(struct drm_crtc *crtc); /* resume? */
1494N/A /* Reset CRTC state */
1494N/A void (*reset)(struct drm_crtc *crtc);
1494N/A
1494N/A /* cursor controls */
1494N/A int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv,
1494N/A uint32_t handle, uint32_t width, uint32_t height);
1494N/A int (*cursor_set2)(struct drm_crtc *crtc, struct drm_file *file_priv,
1494N/A uint32_t handle, uint32_t width, uint32_t height,
1494N/A int32_t hot_x, int32_t hot_y);
1494N/A int (*cursor_move)(struct drm_crtc *crtc, int x, int y);
1494N/A
1494N/A /* Set gamma on the CRTC */
1494N/A void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
1494N/A uint32_t start, uint32_t size);
1494N/A /* Object destroy routine */
1494N/A void (*destroy)(struct drm_crtc *crtc);
1494N/A
1494N/A int (*set_config)(struct drm_mode_set *set);
1494N/A
1494N/A /*
1494N/A * Flip to the given framebuffer. This implements the page
1494N/A * flip ioctl descibed in drm_mode.h, specifically, the
1494N/A * implementation must return immediately and block all
1494N/A * rendering to the current fb until the flip has completed.
1494N/A * If userspace set the event flag in the ioctl, the event
1494N/A * argument will point to an event to send back when the flip
1494N/A * completes, otherwise it will be NULL.
1494N/A */
1494N/A int (*page_flip)(struct drm_crtc *crtc,
1494N/A struct drm_framebuffer *fb,
1494N/A struct drm_pending_vblank_event *event);
1494N/A
1494N/A int (*set_property)(struct drm_crtc *crtc,
1494N/A struct drm_property *property, uint64_t val);
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_crtc - central CRTC control structure
1494N/A * @dev: parent DRM device
1494N/A * @head: list management
1494N/A * @base: base KMS object for ID tracking etc.
1494N/A * @enabled: is this CRTC enabled?
1494N/A * @mode: current mode timings
1494N/A * @hwmode: mode timings as programmed to hw regs
1494N/A * @invert_dimensions: for purposes of error checking crtc vs fb sizes,
1494N/A * invert the width/height of the crtc. This is used if the driver
1494N/A * is performing 90 or 270 degree rotated scanout
1494N/A * @x: x position on screen
1494N/A * @y: y position on screen
1494N/A * @funcs: CRTC control functions
1494N/A * @gamma_size: size of gamma ramp
1494N/A * @gamma_store: gamma ramp values
1494N/A * @framedur_ns: precise frame timing
1494N/A * @framedur_ns: precise line timing
1494N/A * @pixeldur_ns: precise pixel timing
1494N/A * @helper_private: mid-layer private data
1494N/A * @properties: property tracking for this CRTC
1494N/A *
1494N/A * Each CRTC may have one or more connectors associated with it. This structure
1494N/A * allows the CRTC to be controlled.
1494N/A */
1494N/Astruct drm_crtc {
1494N/A struct drm_device *dev;
1494N/A struct list_head head;
1494N/A
1494N/A /**
1494N/A * crtc mutex
1494N/A *
1494N/A * This provides a read lock for the overall crtc state (mode, dpms
1494N/A * state, ...) and a write lock for everything which can be update
1494N/A * without a full modeset (fb, cursor data, ...)
1494N/A */
1494N/A struct mutex mutex;
1494N/A
1494N/A struct drm_mode_object base;
1494N/A
1494N/A /* framebuffer the connector is currently bound to */
1494N/A struct drm_framebuffer *fb;
1494N/A
1494N/A /* Temporary tracking of the old fb while a modeset is ongoing. Used
1494N/A * by drm_mode_set_config_internal to implement correct refcounting. */
1494N/A struct drm_framebuffer *old_fb;
1494N/A
1494N/A bool enabled;
1494N/A
1494N/A /* Requested mode from modesetting. */
1494N/A struct drm_display_mode mode;
1494N/A
1494N/A /* Programmed mode in hw, after adjustments for encoders,
1494N/A * crtc, panel scaling etc. Needed for timestamping etc.
1494N/A */
1494N/A struct drm_display_mode hwmode;
1494N/A
1494N/A bool invert_dimensions;
1494N/A
1494N/A int x, y;
1494N/A const struct drm_crtc_funcs *funcs;
1494N/A
1494N/A /* CRTC gamma size for reporting to userspace */
1494N/A uint32_t gamma_size;
1494N/A uint16_t *gamma_store;
1494N/A
1494N/A /* Constants needed for precise vblank and swap timestamping. */
1494N/A s64 framedur_ns, linedur_ns, pixeldur_ns;
1494N/A
1494N/A /* if you are using the helper */
1494N/A void *helper_private;
1494N/A
1494N/A struct drm_object_properties properties;
1494N/A};
1494N/A
1494N/A
1494N/A/**
1494N/A * drm_connector_funcs - control connectors on a given device
1494N/A * @dpms: set power state (see drm_crtc_funcs above)
1494N/A * @save: save connector state
1494N/A * @restore: restore connector state
1494N/A * @reset: reset connector after state has been invalidate (e.g. resume)
1494N/A * @detect: is this connector active?
1494N/A * @get_modes: get mode list for this connector
1494N/A * @set_property: property for this connector may need update
1494N/A * @destroy: make object go away
1494N/A * @force: notify the driver the connector is forced on
1494N/A *
1494N/A * Each CRTC may have one or more connectors attached to it. The functions
1494N/A * below allow the core DRM code to control connectors, enumerate available modes,
1494N/A * etc.
1494N/A */
1494N/Astruct drm_connector_funcs {
1494N/A void (*dpms)(struct drm_connector *connector, int mode);
1494N/A void (*save)(struct drm_connector *connector);
1494N/A void (*restore)(struct drm_connector *connector);
1494N/A void (*reset)(struct drm_connector *connector);
1494N/A
1494N/A /* Check to see if anything is attached to the connector.
1494N/A * @force is set to false whilst polling, true when checking the
1494N/A * connector due to user request. @force can be used by the driver
1494N/A * to avoid expensive, destructive operations during automated
1494N/A * probing.
1494N/A */
1494N/A enum drm_connector_status (*detect)(struct drm_connector *connector,
1494N/A bool force);
1494N/A int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
1494N/A int (*set_property)(struct drm_connector *connector, struct drm_property *property,
1494N/A uint64_t val);
1494N/A void (*destroy)(struct drm_connector *connector);
1494N/A void (*force)(struct drm_connector *connector);
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_encoder_funcs - encoder controls
1494N/A * @reset: reset state (e.g. at init or resume time)
1494N/A * @destroy: cleanup and free associated data
1494N/A *
1494N/A * Encoders sit between CRTCs and connectors.
1494N/A */
1494N/Astruct drm_encoder_funcs {
1494N/A void (*reset)(struct drm_encoder *encoder);
1494N/A void (*destroy)(struct drm_encoder *encoder);
1494N/A};
1494N/A
1494N/A#define DRM_CONNECTOR_MAX_UMODES 16
1494N/A#define DRM_CONNECTOR_LEN 32
1494N/A#define DRM_CONNECTOR_MAX_ENCODER 3
1494N/A
1494N/A/**
1494N/A * drm_encoder - central DRM encoder structure
1494N/A * @dev: parent DRM device
1494N/A * @head: list management
1494N/A * @base: base KMS object
1494N/A * @encoder_type: one of the %DRM_MODE_ENCODER_<foo> types in drm_mode.h
1494N/A * @possible_crtcs: bitmask of potential CRTC bindings
1494N/A * @possible_clones: bitmask of potential sibling encoders for cloning
1494N/A * @crtc: currently bound CRTC
1494N/A * @funcs: control functions
1494N/A * @helper_private: mid-layer private data
1494N/A *
1494N/A * CRTCs drive pixels to encoders, which convert them into signals
1494N/A * appropriate for a given connector or set of connectors.
1494N/A */
1494N/Astruct drm_encoder {
1494N/A struct drm_device *dev;
1494N/A struct list_head head;
1494N/A
1494N/A struct drm_mode_object base;
1494N/A int encoder_type;
1494N/A uint32_t possible_crtcs;
1494N/A uint32_t possible_clones;
1494N/A
1494N/A struct drm_crtc *crtc;
1494N/A const struct drm_encoder_funcs *funcs;
1494N/A void *helper_private;
1494N/A};
1494N/A
1494N/Aenum drm_connector_force {
1494N/A DRM_FORCE_UNSPECIFIED,
1494N/A DRM_FORCE_OFF,
1494N/A DRM_FORCE_ON, /* force on analog part normally */
1494N/A DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */
1494N/A};
1494N/A
1494N/A/* should we poll this connector for connects and disconnects */
1494N/A/* hot plug detectable */
1494N/A#define DRM_CONNECTOR_POLL_HPD (1 << 0)
1494N/A/* poll for connections */
1494N/A#define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
1494N/A/* can cleanly poll for disconnections without flickering the screen */
1494N/A/* DACs should rarely do this without a lot of testing */
1494N/A#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
1494N/A
1494N/A#define MAX_ELD_BYTES 128
1494N/A
1494N/A/**
1494N/A * drm_connector - central DRM connector control structure
1494N/A * @dev: parent DRM device
1494N/A * @kdev: kernel device for sysfs attributes
1494N/A * @attr: sysfs attributes
1494N/A * @head: list management
1494N/A * @base: base KMS object
1494N/A * @connector_type: one of the %DRM_MODE_CONNECTOR_<foo> types from drm_mode.h
1494N/A * @connector_type_id: index into connector type enum
1494N/A * @interlace_allowed: can this connector handle interlaced modes?
1494N/A * @doublescan_allowed: can this connector handle doublescan?
1494N/A * @modes: modes available on this connector (from fill_modes() + user)
1494N/A * @status: one of the drm_connector_status enums (connected, not, or unknown)
1494N/A * @probed_modes: list of modes derived directly from the display
1494N/A * @display_info: information about attached display (e.g. from EDID)
1494N/A * @funcs: connector control functions
1494N/A * @edid_blob_ptr: DRM property containing EDID if present
1494N/A * @property_ids: property tracking for this connector
1494N/A * @polled: a %DRM_CONNECTOR_POLL_<foo> value for core driven polling
1494N/A * @dpms: current dpms state
1494N/A * @helper_private: mid-layer private data
1494N/A * @force: a %DRM_FORCE_<foo> state for forced mode sets
1494N/A * @encoder_ids: valid encoders for this connector
1494N/A * @encoder: encoder driving this connector, if any
1494N/A * @eld: EDID-like data, if present
1494N/A * @dvi_dual: dual link DVI, if found
1494N/A * @max_tmds_clock: max clock rate, if found
1494N/A * @latency_present: AV delay info from ELD, if found
1494N/A * @video_latency: video latency info from ELD, if found
1494N/A * @audio_latency: audio latency info from ELD, if found
1494N/A * @null_edid_counter: track sinks that give us all zeros for the EDID
1494N/A *
1494N/A * Each connector may be connected to one or more CRTCs, or may be clonable by
1494N/A * another connector if they can share a CRTC. Each connector also has a specific
1494N/A * position in the broader display (referred to as a 'screen' though it could
1494N/A * span multiple monitors).
1494N/A */
1494N/Astruct drm_connector {
1494N/A struct drm_device *dev;
1494N/A //struct device kdev;
1494N/A struct device_attribute *attr;
1494N/A struct list_head head;
1494N/A
1494N/A struct drm_mode_object base;
1494N/A
1494N/A int connector_type;
1494N/A int connector_type_id;
1494N/A bool interlace_allowed;
1494N/A bool doublescan_allowed;
1494N/A struct list_head modes; /* list of modes on this connector */
1494N/A
1494N/A enum drm_connector_status status;
1494N/A
1494N/A /* these are modes added by probing with DDC or the BIOS */
1494N/A struct list_head probed_modes;
1494N/A
1494N/A struct drm_display_info display_info;
1494N/A const struct drm_connector_funcs *funcs;
1494N/A
1494N/A struct drm_property_blob *edid_blob_ptr;
1494N/A struct drm_object_properties properties;
1494N/A
1494N/A uint8_t polled; /* DRM_CONNECTOR_POLL_* */
1494N/A
1494N/A /* requested DPMS state */
1494N/A int dpms;
1494N/A
1494N/A void *helper_private;
1494N/A
1494N/A /* forced on connector */
1494N/A enum drm_connector_force force;
1494N/A uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
1494N/A struct drm_encoder *encoder; /* currently active encoder */
1494N/A
1494N/A /* EDID bits */
1494N/A uint8_t eld[MAX_ELD_BYTES];
1494N/A bool dvi_dual;
1494N/A int max_tmds_clock; /* in MHz */
1494N/A bool latency_present[2];
1494N/A int video_latency[2]; /* [0]: progressive, [1]: interlaced */
1494N/A int audio_latency[2];
1494N/A int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
1494N/A unsigned bad_edid_counter;
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_plane_funcs - driver plane control functions
1494N/A * @update_plane: update the plane configuration
1494N/A * @disable_plane: shut down the plane
1494N/A * @destroy: clean up plane resources
1494N/A * @set_property: called when a property is changed
1494N/A */
1494N/Astruct drm_plane_funcs {
1494N/A int (*update_plane)(struct drm_plane *plane,
1494N/A struct drm_crtc *crtc, struct drm_framebuffer *fb,
1494N/A int crtc_x, int crtc_y,
1494N/A unsigned int crtc_w, unsigned int crtc_h,
1494N/A uint32_t src_x, uint32_t src_y,
1494N/A uint32_t src_w, uint32_t src_h);
1494N/A int (*disable_plane)(struct drm_plane *plane);
1494N/A void (*destroy)(struct drm_plane *plane);
1494N/A
1494N/A int (*set_property)(struct drm_plane *plane,
1494N/A struct drm_property *property, uint64_t val);
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_plane - central DRM plane control structure
1494N/A * @dev: DRM device this plane belongs to
1494N/A * @head: for list management
1494N/A * @base: base mode object
1494N/A * @possible_crtcs: pipes this plane can be bound to
1494N/A * @format_types: array of formats supported by this plane
1494N/A * @format_count: number of formats supported
1494N/A * @crtc: currently bound CRTC
1494N/A * @fb: currently bound fb
1494N/A * @funcs: helper functions
1494N/A * @properties: property tracking for this plane
1494N/A */
1494N/Astruct drm_plane {
1494N/A struct drm_device *dev;
1494N/A struct list_head head;
1494N/A
1494N/A struct drm_mode_object base;
1494N/A
1494N/A uint32_t possible_crtcs;
1494N/A uint32_t *format_types;
1494N/A uint32_t format_count;
1494N/A
1494N/A struct drm_crtc *crtc;
1494N/A struct drm_framebuffer *fb;
1494N/A
1494N/A const struct drm_plane_funcs *funcs;
1494N/A
1494N/A struct drm_object_properties properties;
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_mode_set - new values for a CRTC config change
1494N/A * @head: list management
1494N/A * @fb: framebuffer to use for new config
1494N/A * @crtc: CRTC whose configuration we're about to change
1494N/A * @mode: mode timings to use
1494N/A * @x: position of this CRTC relative to @fb
1494N/A * @y: position of this CRTC relative to @fb
1494N/A * @connectors: array of connectors to drive with this CRTC if possible
1494N/A * @num_connectors: size of @connectors array
1494N/A *
1494N/A * Represents a single crtc the connectors that it drives with what mode
1494N/A * and from which framebuffer it scans out from.
1494N/A *
1494N/A * This is used to set modes.
1494N/A */
1494N/Astruct drm_mode_set {
1494N/A struct drm_framebuffer *fb;
1494N/A struct drm_crtc *crtc;
1494N/A struct drm_display_mode *mode;
1494N/A
1494N/A uint32_t x;
1494N/A uint32_t y;
1494N/A
1494N/A struct drm_connector **connectors;
1494N/A size_t num_connectors;
1494N/A};
1494N/A
1494N/A/**
1494N/A * struct drm_mode_config_funcs - basic driver provided mode setting functions
1494N/A * @fb_create: create a new framebuffer object
1494N/A * @output_poll_changed: function to handle output configuration changes
1494N/A *
1494N/A * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
1494N/A * involve drivers.
1494N/A */
1494N/Astruct drm_mode_config_funcs {
1494N/A struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
1494N/A struct drm_file *file_priv,
1494N/A struct drm_mode_fb_cmd2 *mode_cmd);
1494N/A void (*output_poll_changed)(struct drm_device *dev);
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_mode_group - group of mode setting resources for potential sub-grouping
1494N/A * @num_crtcs: CRTC count
1494N/A * @num_encoders: encoder count
1494N/A * @num_connectors: connector count
1494N/A * @id_list: list of KMS object IDs in this group
1494N/A *
1494N/A * Currently this simply tracks the global mode setting state. But in the
1494N/A * future it could allow groups of objects to be set aside into independent
1494N/A * control groups for use by different user level processes (e.g. two X servers
1494N/A * running simultaneously on different heads, each with their own mode
1494N/A * configuration and freedom of mode setting).
1494N/A */
1494N/Astruct drm_mode_group {
1494N/A uint32_t num_crtcs;
1494N/A uint32_t num_encoders;
1494N/A uint32_t num_connectors;
1494N/A
1494N/A /* list of object IDs for this group */
1494N/A uint32_t *id_list;
1494N/A};
1494N/A
1494N/A/**
1494N/A * drm_mode_config - Mode configuration control structure
1494N/A * @mutex: mutex protecting KMS related lists and structures
1494N/A * @idr_mutex: mutex for KMS ID allocation and management
1494N/A * @crtc_idr: main KMS ID tracking object
1494N/A * @num_fb: number of fbs available
1494N/A * @fb_list: list of framebuffers available
1494N/A * @num_connector: number of connectors on this device
1494N/A * @connector_list: list of connector objects
1494N/A * @num_encoder: number of encoders on this device
1494N/A * @encoder_list: list of encoder objects
1494N/A * @num_crtc: number of CRTCs on this device
1494N/A * @crtc_list: list of CRTC objects
1494N/A * @min_width: minimum pixel width on this device
1494N/A * @min_height: minimum pixel height on this device
1494N/A * @max_width: maximum pixel width on this device
1494N/A * @max_height: maximum pixel height on this device
1494N/A * @funcs: core driver provided mode setting functions
1494N/A * @fb_base: base address of the framebuffer
1494N/A * @poll_enabled: track polling status for this device
1494N/A * @output_poll_work: delayed work for polling in process context
1494N/A * @*_property: core property tracking
1494N/A *
1494N/A * Core mode resource tracking structure. All CRTC, encoders, and connectors
1494N/A * enumerated by the driver are added here, as are global properties. Some
1494N/A * global restrictions are also here, e.g. dimension restrictions.
1494N/A */
1494N/Astruct drm_mode_config {
1494N/A kmutex_t mutex; /* protects configuration (mode lists etc.) */
1494N/A kmutex_t idr_mutex; /* for IDR management */
1494N/A struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
1494N/A /**
1494N/A * fb_lock - mutex to protect fb state
1494N/A *
1494N/A * Besides the global fb list his also protects the fbs list in the
1494N/A * file_priv
1494N/A */
1494N/A struct mutex fb_lock;
1494N/A /* this is limited to one for now */
1494N/A int num_fb;
1494N/A struct list_head fb_list;
1494N/A int num_connector;
1494N/A struct list_head connector_list;
1494N/A int num_encoder;
1494N/A struct list_head encoder_list;
1494N/A int num_plane;
1494N/A struct list_head plane_list;
1494N/A
1494N/A int num_crtc;
1494N/A struct list_head crtc_list;
1494N/A
1494N/A struct list_head property_list;
1494N/A
1494N/A int min_width, min_height;
1494N/A int max_width, max_height;
1494N/A const struct drm_mode_config_funcs *funcs;
1494N/A resource_size_t fb_base;
1494N/A
1494N/A /* output poll support */
1494N/A bool poll_enabled;
1494N/A bool poll_running;
1494N/A
1494N/A /* pointers to standard properties */
1494N/A struct list_head property_blob_list;
1494N/A struct drm_property *edid_property;
1494N/A struct drm_property *dpms_property;
1494N/A
1494N/A /* DVI-I properties */
1494N/A struct drm_property *dvi_i_subconnector_property;
1494N/A struct drm_property *dvi_i_select_subconnector_property;
1494N/A
1494N/A /* TV properties */
1494N/A struct drm_property *tv_subconnector_property;
1494N/A struct drm_property *tv_select_subconnector_property;
1494N/A struct drm_property *tv_mode_property;
1494N/A struct drm_property *tv_left_margin_property;
1494N/A struct drm_property *tv_right_margin_property;
1494N/A struct drm_property *tv_top_margin_property;
1494N/A struct drm_property *tv_bottom_margin_property;
1494N/A struct drm_property *tv_brightness_property;
1494N/A struct drm_property *tv_contrast_property;
1494N/A struct drm_property *tv_flicker_reduction_property;
1494N/A struct drm_property *tv_overscan_property;
1494N/A struct drm_property *tv_saturation_property;
1494N/A struct drm_property *tv_hue_property;
1494N/A
1494N/A /* Optional properties */
1494N/A struct drm_property *scaling_mode_property;
1494N/A struct drm_property *dithering_mode_property;
1494N/A struct drm_property *dirty_info_property;
1494N/A
1494N/A /* dumb ioctl parameters */
1494N/A uint32_t preferred_depth, prefer_shadow;
1494N/A};
1494N/A
1494N/A#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
1494N/A#define obj_to_connector(x) container_of(x, struct drm_connector, base)
1494N/A#define obj_to_encoder(x) container_of(x, struct drm_encoder, base)
1494N/A#define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
1494N/A#define obj_to_fb(x) container_of(x, struct drm_framebuffer, base)
1494N/A#define obj_to_property(x) container_of(x, struct drm_property, base)
1494N/A#define obj_to_blob(x) container_of(x, struct drm_property_blob, base)
1494N/A#define obj_to_plane(x) container_of(x, struct drm_plane, base)
1494N/A
1494N/Astruct drm_prop_enum_list {
1494N/A int type;
1494N/A char *name;
1494N/A};
1494N/A
1494N/Aextern void drm_modeset_lock_all(struct drm_device *dev);
1494N/Aextern void drm_modeset_unlock_all(struct drm_device *dev);
1494N/A
1494N/Aextern int drm_crtc_init(struct drm_device *dev,
1494N/A struct drm_crtc *crtc,
1494N/A const struct drm_crtc_funcs *funcs);
1494N/Aextern void drm_crtc_cleanup(struct drm_crtc *crtc);
1494N/A
1494N/Aextern int drm_connector_init(struct drm_device *dev,
1494N/A struct drm_connector *connector,
1494N/A const struct drm_connector_funcs *funcs,
1494N/A int connector_type);
1494N/A
1494N/Aextern void drm_connector_cleanup(struct drm_connector *connector);
1494N/A/* helper to unplug all connectors from sysfs for device */
1494N/Aextern void drm_connector_unplug_all(struct drm_device *dev);
1494N/A
1494N/Aextern int drm_encoder_init(struct drm_device *dev,
1494N/A struct drm_encoder *encoder,
1494N/A const struct drm_encoder_funcs *funcs,
1494N/A int encoder_type);
1494N/A
1494N/Aextern int drm_plane_init(struct drm_device *dev,
1494N/A struct drm_plane *plane,
1494N/A unsigned long possible_crtcs,
1494N/A const struct drm_plane_funcs *funcs,
1494N/A const uint32_t *formats, uint32_t format_count,
1494N/A bool priv);
1494N/Aextern void drm_plane_cleanup(struct drm_plane *plane);
1494N/Aextern void drm_plane_force_disable(struct drm_plane *plane);
1494N/A
1494N/Aextern void drm_encoder_cleanup(struct drm_encoder *encoder);
1494N/A
1494N/Aextern const char *drm_get_connector_name(const struct drm_connector *connector);
1494N/Aextern const char *drm_get_connector_status_name(enum drm_connector_status status);
1494N/Aextern const char *drm_get_dpms_name(int val);
1494N/Aextern const char *drm_get_dvi_i_subconnector_name(int val);
1494N/Aextern const char *drm_get_dvi_i_select_name(int val);
1494N/Aextern const char *drm_get_tv_subconnector_name(int val);
1494N/Aextern const char *drm_get_tv_select_name(int val);
1494N/Aextern void drm_fb_release(struct drm_file *file_priv);
1494N/Aextern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
1494N/Aextern bool drm_probe_ddc(struct i2c_adapter *adapter);
1494N/Aextern struct edid *drm_get_edid(struct drm_connector *connector,
1494N/A struct i2c_adapter *adapter);
1494N/Aextern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
1494N/Aextern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
1494N/Aextern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
1494N/Aextern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
1494N/Aextern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
1494N/A const struct drm_display_mode *mode);
1494N/Aextern void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
1494N/Aextern void drm_mode_config_init(struct drm_device *dev);
1494N/Aextern void drm_mode_config_reset(struct drm_device *dev);
1494N/Aextern void drm_mode_config_cleanup(struct drm_device *dev);
1494N/Aextern void drm_mode_set_name(struct drm_display_mode *mode);
1494N/Aextern bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
1494N/Aextern bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
1494N/Aextern int drm_mode_width(const struct drm_display_mode *mode);
1494N/Aextern int drm_mode_height(const struct drm_display_mode *mode);
1494N/A
1494N/A/* for us by fb module */
1494N/Aextern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
1494N/Aextern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
1494N/Aextern void drm_mode_list_concat(struct list_head *head,
1494N/A struct list_head *new);
1494N/Aextern void drm_mode_validate_size(struct drm_device *dev,
1494N/A struct list_head *mode_list,
1494N/A int maxX, int maxY, int maxPitch);
1494N/Aextern void drm_mode_validate_clocks(struct drm_device *dev,
1494N/A struct list_head *mode_list,
1494N/A int *min, int *max, int n_ranges);
1494N/Aextern void drm_mode_prune_invalid(struct drm_device *dev,
1494N/A struct list_head *mode_list, bool verbose);
1494N/Aextern void drm_mode_sort(struct list_head *mode_list);
1494N/Aextern int drm_mode_hsync(const struct drm_display_mode *mode);
1494N/Aextern int drm_mode_vrefresh(const struct drm_display_mode *mode);
1494N/Aextern void drm_mode_set_crtcinfo(struct drm_display_mode *p,
1494N/A int adjust_flags);
1494N/Aextern void drm_mode_connector_list_update(struct drm_connector *connector);
1494N/Aextern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
1494N/A struct edid *edid);
1494N/Aextern int drm_object_property_set_value(struct drm_mode_object *obj,
1494N/A struct drm_property *property,
1494N/A uint64_t val);
1494N/Aextern int drm_object_property_get_value(struct drm_mode_object *obj,
1494N/A struct drm_property *property,
1494N/A uint64_t *value);
1494N/Aextern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
1494N/Aextern void drm_framebuffer_set_object(struct drm_device *dev,
1494N/A unsigned long handle);
1494N/Aextern int drm_framebuffer_init(struct drm_device *dev,
1494N/A struct drm_framebuffer *fb,
1494N/A const struct drm_framebuffer_funcs *funcs);
1494N/Aextern struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev,
1494N/A uint32_t id);
1494N/Aextern void drm_framebuffer_unreference(struct drm_framebuffer *fb);
1494N/Aextern void drm_framebuffer_reference(struct drm_framebuffer *fb);
1494N/Aextern void drm_framebuffer_remove(struct drm_framebuffer *fb);
1494N/Aextern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
1494N/Aextern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
1494N/Aextern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
1494N/Aextern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
1494N/Aextern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
1494N/Aextern bool drm_crtc_in_use(struct drm_crtc *crtc);
1494N/A
1494N/Aextern void drm_object_attach_property(struct drm_mode_object *obj,
1494N/A struct drm_property *property,
1494N/A uint64_t init_val);
1494N/Aextern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
1494N/A const char *name, int num_values);
1494N/Aextern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags,
1494N/A const char *name,
1494N/A const struct drm_prop_enum_list *props,
1494N/A int num_values);
1494N/Astruct drm_property *drm_property_create_bitmask(struct drm_device *dev,
1494N/A int flags, const char *name,
1494N/A const struct drm_prop_enum_list *props,
1494N/A int num_values);
1494N/Astruct drm_property *drm_property_create_range(struct drm_device *dev, int flags,
1494N/A const char *name,
1494N/A uint64_t min, uint64_t max);
1494N/Aextern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
1494N/Aextern int drm_property_add_enum(struct drm_property *property, int index,
1494N/A uint64_t value, const char *name);
1494N/Aextern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
1494N/Aextern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats,
1494N/A char *formats[]);
1494N/Aextern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
1494N/Aextern int drm_mode_create_dithering_property(struct drm_device *dev);
1494N/Aextern int drm_mode_create_dirty_info_property(struct drm_device *dev);
1494N/Aextern const char *drm_get_encoder_name(const struct drm_encoder *encoder);
1494N/A
1494N/Aextern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
1494N/A struct drm_encoder *encoder);
1494N/Aextern void drm_mode_connector_detach_encoder(struct drm_connector *connector,
1494N/A struct drm_encoder *encoder);
1494N/Aextern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
1494N/A int gamma_size);
1494N/Aextern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
1494N/A uint32_t id, uint32_t type);
1494N/Aextern int drm_mode_set_config_internal(struct drm_mode_set *set);
1494N/A/* IOCTLs */
1494N/Aextern int drm_mode_getresources(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getplane_res(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getcrtc(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getconnector(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_setcrtc(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getplane(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_setplane(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_cursor_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_cursor2_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_addfb(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_addfb2(DRM_IOCTL_ARGS);
1494N/Aextern uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth);
1494N/Aextern int drm_mode_rmfb(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getfb(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_dirtyfb_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getproperty_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getblob_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_connector_property_set_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_hotplug_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_replacefb(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_getencoder(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_gamma_get_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_gamma_set_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern u8 *drm_find_cea_extension(struct edid *edid);
1494N/Aextern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1494N/Aextern bool drm_detect_hdmi_monitor(struct edid *edid);
1494N/Aextern bool drm_detect_monitor_audio(struct edid *edid);
1494N/Aextern bool drm_rgb_quant_range_selectable(struct edid *edid);
1494N/Aextern int drm_mode_page_flip_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
1494N/A int hdisplay, int vdisplay, int vrefresh,
1494N/A bool reduced, bool interlaced, bool margins);
1494N/Aextern struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,
1494N/A int hdisplay, int vdisplay, int vrefresh,
1494N/A bool interlaced, int margins);
1494N/Aextern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
1494N/A int hdisplay, int vdisplay, int vrefresh,
1494N/A bool interlaced, int margins, int GTF_M,
1494N/A int GTF_2C, int GTF_K, int GTF_2J);
1494N/Aextern int drm_add_modes_noedid(struct drm_connector *connector,
1494N/A int hdisplay, int vdisplay);
1494N/A
1494N/Aextern int drm_edid_header_is_valid(const u8 *raw_edid);
1494N/Aextern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
1494N/Aextern bool drm_edid_is_valid(struct edid *edid);
1494N/Astruct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
1494N/A int hsize, int vsize, int fresh,
1494N/A bool rb);
1494N/A
1494N/Aextern int drm_mode_create_dumb_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_mmap_dumb_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_destroy_dumb_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_obj_get_properties_ioctl(DRM_IOCTL_ARGS);
1494N/Aextern int drm_mode_obj_set_property_ioctl(DRM_IOCTL_ARGS);
1494N/A
1494N/Aextern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
1494N/A int *bpp);
1494N/Aextern int drm_format_num_planes(uint32_t format);
1494N/Aextern int drm_format_plane_cpp(uint32_t format, int plane);
1494N/Aextern int drm_format_horz_chroma_subsampling(uint32_t format);
1494N/Aextern int drm_format_vert_chroma_subsampling(uint32_t format);
1494N/Aextern const char *drm_get_format_name(uint32_t format);
1494N/A
1494N/A#endif /* __DRM_CRTC_H__ */