amdgpu_mode.h 16 KB

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