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