amdgpu_mode.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /*
  2. * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
  3. * VA Linux Systems Inc., Fremont, California.
  4. * Copyright 2008 Red Hat Inc.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  20. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  21. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22. * OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * Original Authors:
  25. * Kevin E. Martin, Rickard E. Faith, Alan Hourihane
  26. *
  27. * Kernel port Author: Dave Airlie
  28. */
  29. #ifndef AMDGPU_MODE_H
  30. #define AMDGPU_MODE_H
  31. #include <drm/drm_crtc.h>
  32. #include <drm/drm_edid.h>
  33. #include <drm/drm_dp_helper.h>
  34. #include <drm/drm_fixed.h>
  35. #include <drm/drm_crtc_helper.h>
  36. #include <drm/drm_plane_helper.h>
  37. #include <linux/i2c.h>
  38. #include <linux/i2c-algo-bit.h>
  39. struct amdgpu_bo;
  40. struct amdgpu_device;
  41. struct amdgpu_encoder;
  42. struct amdgpu_router;
  43. struct amdgpu_hpd;
  44. #define to_amdgpu_crtc(x) container_of(x, struct amdgpu_crtc, base)
  45. #define to_amdgpu_connector(x) container_of(x, struct amdgpu_connector, base)
  46. #define to_amdgpu_encoder(x) container_of(x, struct amdgpu_encoder, base)
  47. #define to_amdgpu_framebuffer(x) container_of(x, struct amdgpu_framebuffer, base)
  48. #define AMDGPU_MAX_HPD_PINS 6
  49. #define AMDGPU_MAX_CRTCS 6
  50. #define AMDGPU_MAX_AFMT_BLOCKS 9
  51. enum amdgpu_rmx_type {
  52. RMX_OFF,
  53. RMX_FULL,
  54. RMX_CENTER,
  55. RMX_ASPECT
  56. };
  57. enum amdgpu_underscan_type {
  58. UNDERSCAN_OFF,
  59. UNDERSCAN_ON,
  60. UNDERSCAN_AUTO,
  61. };
  62. #define AMDGPU_HPD_CONNECT_INT_DELAY_IN_MS 50
  63. #define AMDGPU_HPD_DISCONNECT_INT_DELAY_IN_MS 10
  64. enum amdgpu_hpd_id {
  65. AMDGPU_HPD_1 = 0,
  66. AMDGPU_HPD_2,
  67. AMDGPU_HPD_3,
  68. AMDGPU_HPD_4,
  69. AMDGPU_HPD_5,
  70. AMDGPU_HPD_6,
  71. AMDGPU_HPD_LAST,
  72. AMDGPU_HPD_NONE = 0xff,
  73. };
  74. enum amdgpu_crtc_irq {
  75. AMDGPU_CRTC_IRQ_VBLANK1 = 0,
  76. AMDGPU_CRTC_IRQ_VBLANK2,
  77. AMDGPU_CRTC_IRQ_VBLANK3,
  78. AMDGPU_CRTC_IRQ_VBLANK4,
  79. AMDGPU_CRTC_IRQ_VBLANK5,
  80. AMDGPU_CRTC_IRQ_VBLANK6,
  81. AMDGPU_CRTC_IRQ_VLINE1,
  82. AMDGPU_CRTC_IRQ_VLINE2,
  83. AMDGPU_CRTC_IRQ_VLINE3,
  84. AMDGPU_CRTC_IRQ_VLINE4,
  85. AMDGPU_CRTC_IRQ_VLINE5,
  86. AMDGPU_CRTC_IRQ_VLINE6,
  87. AMDGPU_CRTC_IRQ_LAST,
  88. AMDGPU_CRTC_IRQ_NONE = 0xff
  89. };
  90. enum amdgpu_pageflip_irq {
  91. AMDGPU_PAGEFLIP_IRQ_D1 = 0,
  92. AMDGPU_PAGEFLIP_IRQ_D2,
  93. AMDGPU_PAGEFLIP_IRQ_D3,
  94. AMDGPU_PAGEFLIP_IRQ_D4,
  95. AMDGPU_PAGEFLIP_IRQ_D5,
  96. AMDGPU_PAGEFLIP_IRQ_D6,
  97. AMDGPU_PAGEFLIP_IRQ_LAST,
  98. AMDGPU_PAGEFLIP_IRQ_NONE = 0xff
  99. };
  100. enum amdgpu_flip_status {
  101. AMDGPU_FLIP_NONE,
  102. AMDGPU_FLIP_PENDING,
  103. AMDGPU_FLIP_SUBMITTED
  104. };
  105. #define AMDGPU_MAX_I2C_BUS 16
  106. /* amdgpu gpio-based i2c
  107. * 1. "mask" reg and bits
  108. * grabs the gpio pins for software use
  109. * 0=not held 1=held
  110. * 2. "a" reg and bits
  111. * output pin value
  112. * 0=low 1=high
  113. * 3. "en" reg and bits
  114. * sets the pin direction
  115. * 0=input 1=output
  116. * 4. "y" reg and bits
  117. * input pin value
  118. * 0=low 1=high
  119. */
  120. struct amdgpu_i2c_bus_rec {
  121. bool valid;
  122. /* id used by atom */
  123. uint8_t i2c_id;
  124. /* id used by atom */
  125. enum amdgpu_hpd_id hpd;
  126. /* can be used with hw i2c engine */
  127. bool hw_capable;
  128. /* uses multi-media i2c engine */
  129. bool mm_i2c;
  130. /* regs and bits */
  131. uint32_t mask_clk_reg;
  132. uint32_t mask_data_reg;
  133. uint32_t a_clk_reg;
  134. uint32_t a_data_reg;
  135. uint32_t en_clk_reg;
  136. uint32_t en_data_reg;
  137. uint32_t y_clk_reg;
  138. uint32_t y_data_reg;
  139. uint32_t mask_clk_mask;
  140. uint32_t mask_data_mask;
  141. uint32_t a_clk_mask;
  142. uint32_t a_data_mask;
  143. uint32_t en_clk_mask;
  144. uint32_t en_data_mask;
  145. uint32_t y_clk_mask;
  146. uint32_t y_data_mask;
  147. };
  148. #define AMDGPU_MAX_BIOS_CONNECTOR 16
  149. /* pll flags */
  150. #define AMDGPU_PLL_USE_BIOS_DIVS (1 << 0)
  151. #define AMDGPU_PLL_NO_ODD_POST_DIV (1 << 1)
  152. #define AMDGPU_PLL_USE_REF_DIV (1 << 2)
  153. #define AMDGPU_PLL_LEGACY (1 << 3)
  154. #define AMDGPU_PLL_PREFER_LOW_REF_DIV (1 << 4)
  155. #define AMDGPU_PLL_PREFER_HIGH_REF_DIV (1 << 5)
  156. #define AMDGPU_PLL_PREFER_LOW_FB_DIV (1 << 6)
  157. #define AMDGPU_PLL_PREFER_HIGH_FB_DIV (1 << 7)
  158. #define AMDGPU_PLL_PREFER_LOW_POST_DIV (1 << 8)
  159. #define AMDGPU_PLL_PREFER_HIGH_POST_DIV (1 << 9)
  160. #define AMDGPU_PLL_USE_FRAC_FB_DIV (1 << 10)
  161. #define AMDGPU_PLL_PREFER_CLOSEST_LOWER (1 << 11)
  162. #define AMDGPU_PLL_USE_POST_DIV (1 << 12)
  163. #define AMDGPU_PLL_IS_LCD (1 << 13)
  164. #define AMDGPU_PLL_PREFER_MINM_OVER_MAXP (1 << 14)
  165. struct amdgpu_pll {
  166. /* reference frequency */
  167. uint32_t reference_freq;
  168. /* fixed dividers */
  169. uint32_t reference_div;
  170. uint32_t post_div;
  171. /* pll in/out limits */
  172. uint32_t pll_in_min;
  173. uint32_t pll_in_max;
  174. uint32_t pll_out_min;
  175. uint32_t pll_out_max;
  176. uint32_t lcd_pll_out_min;
  177. uint32_t lcd_pll_out_max;
  178. uint32_t best_vco;
  179. /* divider limits */
  180. uint32_t min_ref_div;
  181. uint32_t max_ref_div;
  182. uint32_t min_post_div;
  183. uint32_t max_post_div;
  184. uint32_t min_feedback_div;
  185. uint32_t max_feedback_div;
  186. uint32_t min_frac_feedback_div;
  187. uint32_t max_frac_feedback_div;
  188. /* flags for the current clock */
  189. uint32_t flags;
  190. /* pll id */
  191. uint32_t id;
  192. };
  193. struct amdgpu_i2c_chan {
  194. struct i2c_adapter adapter;
  195. struct drm_device *dev;
  196. struct i2c_algo_bit_data bit;
  197. struct amdgpu_i2c_bus_rec rec;
  198. struct drm_dp_aux aux;
  199. bool has_aux;
  200. struct mutex mutex;
  201. };
  202. struct amdgpu_fbdev;
  203. struct amdgpu_afmt {
  204. bool enabled;
  205. int offset;
  206. bool last_buffer_filled_status;
  207. int id;
  208. struct amdgpu_audio_pin *pin;
  209. };
  210. /*
  211. * Audio
  212. */
  213. struct amdgpu_audio_pin {
  214. int channels;
  215. int rate;
  216. int bits_per_sample;
  217. u8 status_bits;
  218. u8 category_code;
  219. u32 offset;
  220. bool connected;
  221. u32 id;
  222. };
  223. struct amdgpu_audio {
  224. bool enabled;
  225. struct amdgpu_audio_pin pin[AMDGPU_MAX_AFMT_BLOCKS];
  226. int num_pins;
  227. };
  228. struct amdgpu_mode_mc_save {
  229. u32 vga_render_control;
  230. u32 vga_hdp_control;
  231. bool crtc_enabled[AMDGPU_MAX_CRTCS];
  232. };
  233. struct amdgpu_display_funcs {
  234. /* vga render */
  235. void (*set_vga_render_state)(struct amdgpu_device *adev, bool render);
  236. /* display watermarks */
  237. void (*bandwidth_update)(struct amdgpu_device *adev);
  238. /* get frame count */
  239. u32 (*vblank_get_counter)(struct amdgpu_device *adev, int crtc);
  240. /* wait for vblank */
  241. void (*vblank_wait)(struct amdgpu_device *adev, int crtc);
  242. /* is dce hung */
  243. bool (*is_display_hung)(struct amdgpu_device *adev);
  244. /* set backlight level */
  245. void (*backlight_set_level)(struct amdgpu_encoder *amdgpu_encoder,
  246. u8 level);
  247. /* get backlight level */
  248. u8 (*backlight_get_level)(struct amdgpu_encoder *amdgpu_encoder);
  249. /* hotplug detect */
  250. bool (*hpd_sense)(struct amdgpu_device *adev, enum amdgpu_hpd_id hpd);
  251. void (*hpd_set_polarity)(struct amdgpu_device *adev,
  252. enum amdgpu_hpd_id hpd);
  253. u32 (*hpd_get_gpio_reg)(struct amdgpu_device *adev);
  254. /* pageflipping */
  255. void (*page_flip)(struct amdgpu_device *adev,
  256. int crtc_id, u64 crtc_base);
  257. int (*page_flip_get_scanoutpos)(struct amdgpu_device *adev, int crtc,
  258. u32 *vbl, u32 *position);
  259. /* display topology setup */
  260. void (*add_encoder)(struct amdgpu_device *adev,
  261. uint32_t encoder_enum,
  262. uint32_t supported_device,
  263. u16 caps);
  264. void (*add_connector)(struct amdgpu_device *adev,
  265. uint32_t connector_id,
  266. uint32_t supported_device,
  267. int connector_type,
  268. struct amdgpu_i2c_bus_rec *i2c_bus,
  269. uint16_t connector_object_id,
  270. struct amdgpu_hpd *hpd,
  271. struct amdgpu_router *router);
  272. void (*stop_mc_access)(struct amdgpu_device *adev,
  273. struct amdgpu_mode_mc_save *save);
  274. void (*resume_mc_access)(struct amdgpu_device *adev,
  275. struct amdgpu_mode_mc_save *save);
  276. };
  277. struct amdgpu_mode_info {
  278. struct atom_context *atom_context;
  279. struct card_info *atom_card_info;
  280. bool mode_config_initialized;
  281. struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS];
  282. struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS];
  283. /* DVI-I properties */
  284. struct drm_property *coherent_mode_property;
  285. /* DAC enable load detect */
  286. struct drm_property *load_detect_property;
  287. /* underscan */
  288. struct drm_property *underscan_property;
  289. struct drm_property *underscan_hborder_property;
  290. struct drm_property *underscan_vborder_property;
  291. /* audio */
  292. struct drm_property *audio_property;
  293. /* FMT dithering */
  294. struct drm_property *dither_property;
  295. /* hardcoded DFP edid from BIOS */
  296. struct edid *bios_hardcoded_edid;
  297. int bios_hardcoded_edid_size;
  298. /* pointer to fbdev info structure */
  299. struct amdgpu_fbdev *rfbdev;
  300. /* firmware flags */
  301. u16 firmware_flags;
  302. /* pointer to backlight encoder */
  303. struct amdgpu_encoder *bl_encoder;
  304. struct amdgpu_audio audio; /* audio stuff */
  305. int num_crtc; /* number of crtcs */
  306. int num_hpd; /* number of hpd pins */
  307. int num_dig; /* number of dig blocks */
  308. int disp_priority;
  309. const struct amdgpu_display_funcs *funcs;
  310. };
  311. #define AMDGPU_MAX_BL_LEVEL 0xFF
  312. #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
  313. struct amdgpu_backlight_privdata {
  314. struct amdgpu_encoder *encoder;
  315. uint8_t negative;
  316. };
  317. #endif
  318. struct amdgpu_atom_ss {
  319. uint16_t percentage;
  320. uint16_t percentage_divider;
  321. uint8_t type;
  322. uint16_t step;
  323. uint8_t delay;
  324. uint8_t range;
  325. uint8_t refdiv;
  326. /* asic_ss */
  327. uint16_t rate;
  328. uint16_t amount;
  329. };
  330. struct amdgpu_crtc {
  331. struct drm_crtc base;
  332. int crtc_id;
  333. u16 lut_r[256], lut_g[256], lut_b[256];
  334. bool enabled;
  335. bool can_tile;
  336. uint32_t crtc_offset;
  337. struct drm_gem_object *cursor_bo;
  338. uint64_t cursor_addr;
  339. int cursor_x;
  340. int cursor_y;
  341. int cursor_hot_x;
  342. int cursor_hot_y;
  343. int cursor_width;
  344. int cursor_height;
  345. int max_cursor_width;
  346. int max_cursor_height;
  347. enum amdgpu_rmx_type rmx_type;
  348. u8 h_border;
  349. u8 v_border;
  350. fixed20_12 vsc;
  351. fixed20_12 hsc;
  352. struct drm_display_mode native_mode;
  353. u32 pll_id;
  354. /* page flipping */
  355. struct workqueue_struct *pflip_queue;
  356. struct amdgpu_flip_work *pflip_works;
  357. enum amdgpu_flip_status pflip_status;
  358. int deferred_flip_completion;
  359. /* pll sharing */
  360. struct amdgpu_atom_ss ss;
  361. bool ss_enabled;
  362. u32 adjusted_clock;
  363. int bpc;
  364. u32 pll_reference_div;
  365. u32 pll_post_div;
  366. u32 pll_flags;
  367. struct drm_encoder *encoder;
  368. struct drm_connector *connector;
  369. /* for dpm */
  370. u32 line_time;
  371. u32 wm_low;
  372. u32 wm_high;
  373. u32 lb_vblank_lead_lines;
  374. struct drm_display_mode hw_mode;
  375. };
  376. struct amdgpu_encoder_atom_dig {
  377. bool linkb;
  378. /* atom dig */
  379. bool coherent_mode;
  380. int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB, etc. */
  381. /* atom lvds/edp */
  382. uint32_t lcd_misc;
  383. uint16_t panel_pwr_delay;
  384. uint32_t lcd_ss_id;
  385. /* panel mode */
  386. struct drm_display_mode native_mode;
  387. struct backlight_device *bl_dev;
  388. int dpms_mode;
  389. uint8_t backlight_level;
  390. int panel_mode;
  391. struct amdgpu_afmt *afmt;
  392. };
  393. struct amdgpu_encoder {
  394. struct drm_encoder base;
  395. uint32_t encoder_enum;
  396. uint32_t encoder_id;
  397. uint32_t devices;
  398. uint32_t active_device;
  399. uint32_t flags;
  400. uint32_t pixel_clock;
  401. enum amdgpu_rmx_type rmx_type;
  402. enum amdgpu_underscan_type underscan_type;
  403. uint32_t underscan_hborder;
  404. uint32_t underscan_vborder;
  405. struct drm_display_mode native_mode;
  406. void *enc_priv;
  407. int audio_polling_active;
  408. bool is_ext_encoder;
  409. u16 caps;
  410. };
  411. struct amdgpu_connector_atom_dig {
  412. /* displayport */
  413. u8 dpcd[DP_RECEIVER_CAP_SIZE];
  414. u8 dp_sink_type;
  415. int dp_clock;
  416. int dp_lane_count;
  417. bool edp_on;
  418. };
  419. struct amdgpu_gpio_rec {
  420. bool valid;
  421. u8 id;
  422. u32 reg;
  423. u32 mask;
  424. u32 shift;
  425. };
  426. struct amdgpu_hpd {
  427. enum amdgpu_hpd_id hpd;
  428. u8 plugged_state;
  429. struct amdgpu_gpio_rec gpio;
  430. };
  431. struct amdgpu_router {
  432. u32 router_id;
  433. struct amdgpu_i2c_bus_rec i2c_info;
  434. u8 i2c_addr;
  435. /* i2c mux */
  436. bool ddc_valid;
  437. u8 ddc_mux_type;
  438. u8 ddc_mux_control_pin;
  439. u8 ddc_mux_state;
  440. /* clock/data mux */
  441. bool cd_valid;
  442. u8 cd_mux_type;
  443. u8 cd_mux_control_pin;
  444. u8 cd_mux_state;
  445. };
  446. enum amdgpu_connector_audio {
  447. AMDGPU_AUDIO_DISABLE = 0,
  448. AMDGPU_AUDIO_ENABLE = 1,
  449. AMDGPU_AUDIO_AUTO = 2
  450. };
  451. enum amdgpu_connector_dither {
  452. AMDGPU_FMT_DITHER_DISABLE = 0,
  453. AMDGPU_FMT_DITHER_ENABLE = 1,
  454. };
  455. struct amdgpu_connector {
  456. struct drm_connector base;
  457. uint32_t connector_id;
  458. uint32_t devices;
  459. struct amdgpu_i2c_chan *ddc_bus;
  460. /* some systems have an hdmi and vga port with a shared ddc line */
  461. bool shared_ddc;
  462. bool use_digital;
  463. /* we need to mind the EDID between detect
  464. and get modes due to analog/digital/tvencoder */
  465. struct edid *edid;
  466. void *con_priv;
  467. bool dac_load_detect;
  468. bool detected_by_load; /* if the connection status was determined by load */
  469. uint16_t connector_object_id;
  470. struct amdgpu_hpd hpd;
  471. struct amdgpu_router router;
  472. struct amdgpu_i2c_chan *router_bus;
  473. enum amdgpu_connector_audio audio;
  474. enum amdgpu_connector_dither dither;
  475. unsigned pixelclock_for_modeset;
  476. };
  477. struct amdgpu_framebuffer {
  478. struct drm_framebuffer base;
  479. struct drm_gem_object *obj;
  480. };
  481. #define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \
  482. ((em) == ATOM_ENCODER_MODE_DP_MST))
  483. /* Driver internal use only flags of amdgpu_get_crtc_scanoutpos() */
  484. #define USE_REAL_VBLANKSTART (1 << 30)
  485. #define GET_DISTANCE_TO_VBLANKSTART (1 << 31)
  486. void amdgpu_link_encoder_connector(struct drm_device *dev);
  487. struct drm_connector *
  488. amdgpu_get_connector_for_encoder(struct drm_encoder *encoder);
  489. struct drm_connector *
  490. amdgpu_get_connector_for_encoder_init(struct drm_encoder *encoder);
  491. bool amdgpu_dig_monitor_is_duallink(struct drm_encoder *encoder,
  492. u32 pixel_clock);
  493. u16 amdgpu_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder);
  494. struct drm_encoder *amdgpu_get_external_encoder(struct drm_encoder *encoder);
  495. bool amdgpu_ddc_probe(struct amdgpu_connector *amdgpu_connector, bool use_aux);
  496. void amdgpu_encoder_set_active_device(struct drm_encoder *encoder);
  497. int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
  498. unsigned int flags, int *vpos, int *hpos,
  499. ktime_t *stime, ktime_t *etime,
  500. const struct drm_display_mode *mode);
  501. int amdgpu_framebuffer_init(struct drm_device *dev,
  502. struct amdgpu_framebuffer *rfb,
  503. struct drm_mode_fb_cmd2 *mode_cmd,
  504. struct drm_gem_object *obj);
  505. int amdgpufb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
  506. void amdgpu_enc_destroy(struct drm_encoder *encoder);
  507. void amdgpu_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
  508. bool amdgpu_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
  509. const struct drm_display_mode *mode,
  510. struct drm_display_mode *adjusted_mode);
  511. void amdgpu_panel_mode_fixup(struct drm_encoder *encoder,
  512. struct drm_display_mode *adjusted_mode);
  513. int amdgpu_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc);
  514. /* fbdev layer */
  515. int amdgpu_fbdev_init(struct amdgpu_device *adev);
  516. void amdgpu_fbdev_fini(struct amdgpu_device *adev);
  517. void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state);
  518. int amdgpu_fbdev_total_size(struct amdgpu_device *adev);
  519. bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj);
  520. void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev);
  521. void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev);
  522. int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled);
  523. /* amdgpu_display.c */
  524. void amdgpu_print_display_setup(struct drm_device *dev);
  525. int amdgpu_modeset_create_props(struct amdgpu_device *adev);
  526. int amdgpu_crtc_set_config(struct drm_mode_set *set);
  527. int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
  528. struct drm_framebuffer *fb,
  529. struct drm_pending_vblank_event *event,
  530. uint32_t page_flip_flags);
  531. extern const struct drm_mode_config_funcs amdgpu_mode_funcs;
  532. #endif