Path: blob/master/drivers/gpu/drm/nouveau/nouveau_crtc.h
15112 views
/*1* Copyright (C) 2008 Maarten Maathuis.2* All Rights Reserved.3*4* Permission is hereby granted, free of charge, to any person obtaining5* a copy of this software and associated documentation files (the6* "Software"), to deal in the Software without restriction, including7* without limitation the rights to use, copy, modify, merge, publish,8* distribute, sublicense, and/or sell copies of the Software, and to9* permit persons to whom the Software is furnished to do so, subject to10* the following conditions:11*12* The above copyright notice and this permission notice (including the13* next paragraph) shall be included in all copies or substantial14* portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.19* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE20* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION21* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION22* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.23*24*/2526#ifndef __NOUVEAU_CRTC_H__27#define __NOUVEAU_CRTC_H__2829struct nouveau_crtc {30struct drm_crtc base;3132int index;3334struct drm_display_mode *mode;3536uint32_t dpms_saved_fp_control;37uint32_t fp_users;38int saturation;39int sharpness;40int last_dpms;4142int cursor_saved_x, cursor_saved_y;4344struct {45int cpp;46bool blanked;47uint32_t offset;48uint32_t tile_flags;49} fb;5051struct {52struct nouveau_bo *nvbo;53bool visible;54uint32_t offset;55void (*set_offset)(struct nouveau_crtc *, uint32_t offset);56void (*set_pos)(struct nouveau_crtc *, int x, int y);57void (*hide)(struct nouveau_crtc *, bool update);58void (*show)(struct nouveau_crtc *, bool update);59} cursor;6061struct {62struct nouveau_bo *nvbo;63uint16_t r[256];64uint16_t g[256];65uint16_t b[256];66int depth;67} lut;6869int (*set_dither)(struct nouveau_crtc *crtc, bool on, bool update);70int (*set_scale)(struct nouveau_crtc *crtc, int mode, bool update);71};7273static inline struct nouveau_crtc *nouveau_crtc(struct drm_crtc *crtc)74{75return container_of(crtc, struct nouveau_crtc, base);76}7778static inline struct drm_crtc *to_drm_crtc(struct nouveau_crtc *crtc)79{80return &crtc->base;81}8283int nv50_crtc_create(struct drm_device *dev, int index);84int nv50_cursor_init(struct nouveau_crtc *);85void nv50_cursor_fini(struct nouveau_crtc *);86int nv50_crtc_cursor_set(struct drm_crtc *drm_crtc, struct drm_file *file_priv,87uint32_t buffer_handle, uint32_t width,88uint32_t height);89int nv50_crtc_cursor_move(struct drm_crtc *drm_crtc, int x, int y);9091int nv04_cursor_init(struct nouveau_crtc *);9293struct nouveau_connector *94nouveau_crtc_connector_get(struct nouveau_crtc *crtc);9596#endif /* __NOUVEAU_CRTC_H__ */979899