Path: blob/master/drivers/gpu/drm/nouveau/nouveau_encoder.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_ENCODER_H__27#define __NOUVEAU_ENCODER_H__2829#include "drm_encoder_slave.h"30#include "nouveau_drv.h"3132#define NV_DPMS_CLEARED 0x803334struct nouveau_encoder {35struct drm_encoder_slave base;3637struct dcb_entry *dcb;38int or;3940/* different to drm_encoder.crtc, this reflects what's41* actually programmed on the hw, not the proposed crtc */42struct drm_crtc *crtc;4344struct drm_display_mode mode;45int last_dpms;4647struct nv04_output_reg restore;4849union {50struct {51int mc_unknown;52uint32_t unk0;53uint32_t unk1;54int dpcd_version;55int link_nr;56int link_bw;57bool enhanced_frame;58} dp;59};60};6162static inline struct nouveau_encoder *nouveau_encoder(struct drm_encoder *enc)63{64struct drm_encoder_slave *slave = to_encoder_slave(enc);6566return container_of(slave, struct nouveau_encoder, base);67}6869static inline struct drm_encoder *to_drm_encoder(struct nouveau_encoder *enc)70{71return &enc->base.base;72}7374static inline struct drm_encoder_slave_funcs *75get_slave_funcs(struct drm_encoder *enc)76{77return to_encoder_slave(enc)->slave_funcs;78}7980struct nouveau_connector *81nouveau_encoder_connector_get(struct nouveau_encoder *encoder);82int nv50_sor_create(struct drm_connector *, struct dcb_entry *);83int nv50_dac_create(struct drm_connector *, struct dcb_entry *);8485struct bit_displayport_encoder_table {86uint32_t match;87uint8_t record_nr;88uint8_t unknown;89uint16_t script0;90uint16_t script1;91uint16_t unknown_table;92} __attribute__ ((packed));9394struct bit_displayport_encoder_table_entry {95uint8_t vs_level;96uint8_t pre_level;97uint8_t reg0;98uint8_t reg1;99uint8_t reg2;100} __attribute__ ((packed));101102#endif /* __NOUVEAU_ENCODER_H__ */103104105