amdgpu_mode.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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_mode_mc_save {
  233. u32 vga_render_control;
  234. u32 vga_hdp_control;
  235. bool crtc_enabled[AMDGPU_MAX_CRTCS];
  236. };
  237. struct amdgpu_display_funcs {
  238. /* display watermarks */
  239. void (*bandwidth_update)(struct amdgpu_device *adev);
  240. /* get frame count */
  241. u32 (*vblank_get_counter)(struct amdgpu_device *adev, int crtc);
  242. /* wait for vblank */
  243. void (*vblank_wait)(struct amdgpu_device *adev, int crtc);
  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, bool async);
  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 amdgpu_flip_work *pflip_works;
  356. enum amdgpu_flip_status pflip_status;
  357. int deferred_flip_completion;
  358. /* pll sharing */
  359. struct amdgpu_atom_ss ss;
  360. bool ss_enabled;
  361. u32 adjusted_clock;
  362. int bpc;
  363. u32 pll_reference_div;
  364. u32 pll_post_div;
  365. u32 pll_flags;
  366. struct drm_encoder *encoder;
  367. struct drm_connector *connector;
  368. /* for dpm */
  369. u32 line_time;
  370. u32 wm_low;
  371. u32 wm_high;
  372. u32 lb_vblank_lead_lines;
  373. struct drm_display_mode hw_mode;
  374. /* for virtual dce */
  375. struct hrtimer vblank_timer;
  376. enum amdgpu_interrupt_state vsync_timer_enabled;
  377. };
  378. struct amdgpu_encoder_atom_dig {
  379. bool linkb;
  380. /* atom dig */
  381. bool coherent_mode;
  382. int dig_encoder; /* -1 disabled, 0 DIGA, 1 DIGB, etc. */
  383. /* atom lvds/edp */
  384. uint32_t lcd_misc;
  385. uint16_t panel_pwr_delay;
  386. uint32_t lcd_ss_id;
  387. /* panel mode */
  388. struct drm_display_mode native_mode;
  389. struct backlight_device *bl_dev;
  390. int dpms_mode;
  391. uint8_t backlight_level;
  392. int panel_mode;
  393. struct amdgpu_afmt *afmt;
  394. };
  395. struct amdgpu_encoder {
  396. struct drm_encoder base;
  397. uint32_t encoder_enum;
  398. uint32_t encoder_id;
  399. uint32_t devices;
  400. uint32_t active_device;
  401. uint32_t flags;
  402. uint32_t pixel_clock;
  403. enum amdgpu_rmx_type rmx_type;
  404. enum amdgpu_underscan_type underscan_type;
  405. uint32_t underscan_hborder;
  406. uint32_t underscan_vborder;
  407. struct drm_display_mode native_mode;
  408. void *enc_priv;
  409. int audio_polling_active;
  410. bool is_ext_encoder;
  411. u16 caps;
  412. };
  413. struct amdgpu_connector_atom_dig {
  414. /* displayport */
  415. u8 dpcd[DP_RECEIVER_CAP_SIZE];
  416. u8 dp_sink_type;
  417. int dp_clock;
  418. int dp_lane_count;
  419. bool edp_on;
  420. };
  421. struct amdgpu_gpio_rec {
  422. bool valid;
  423. u8 id;
  424. u32 reg;
  425. u32 mask;
  426. u32 shift;
  427. };
  428. struct amdgpu_hpd {
  429. enum amdgpu_hpd_id hpd;
  430. u8 plugged_state;
  431. struct amdgpu_gpio_rec gpio;
  432. };
  433. struct amdgpu_router {
  434. u32 router_id;
  435. struct amdgpu_i2c_bus_rec i2c_info;
  436. u8 i2c_addr;
  437. /* i2c mux */
  438. bool ddc_valid;
  439. u8 ddc_mux_type;
  440. u8 ddc_mux_control_pin;
  441. u8 ddc_mux_state;
  442. /* clock/data mux */
  443. bool cd_valid;
  444. u8 cd_mux_type;
  445. u8 cd_mux_control_pin;
  446. u8 cd_mux_state;
  447. };
  448. enum amdgpu_connector_audio {
  449. AMDGPU_AUDIO_DISABLE = 0,
  450. AMDGPU_AUDIO_ENABLE = 1,
  451. AMDGPU_AUDIO_AUTO = 2
  452. };
  453. enum amdgpu_connector_dither {
  454. AMDGPU_FMT_DITHER_DISABLE = 0,
  455. AMDGPU_FMT_DITHER_ENABLE = 1,
  456. };
  457. struct amdgpu_connector {
  458. struct drm_connector base;
  459. uint32_t connector_id;
  460. uint32_t devices;
  461. struct amdgpu_i2c_chan *ddc_bus;
  462. /* some systems have an hdmi and vga port with a shared ddc line */
  463. bool shared_ddc;
  464. bool use_digital;
  465. /* we need to mind the EDID between detect
  466. and get modes due to analog/digital/tvencoder */
  467. struct edid *edid;
  468. void *con_priv;
  469. bool dac_load_detect;
  470. bool detected_by_load; /* if the connection status was determined by load */
  471. uint16_t connector_object_id;
  472. struct amdgpu_hpd hpd;
  473. struct amdgpu_router router;
  474. struct amdgpu_i2c_chan *router_bus;
  475. enum amdgpu_connector_audio audio;
  476. enum amdgpu_connector_dither dither;
  477. unsigned pixelclock_for_modeset;
  478. };
  479. struct amdgpu_framebuffer {
  480. struct drm_framebuffer base;
  481. struct drm_gem_object *obj;
  482. };
  483. #define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \
  484. ((em) == ATOM_ENCODER_MODE_DP_MST))
  485. /* Driver internal use only flags of amdgpu_get_crtc_scanoutpos() */
  486. #define DRM_SCANOUTPOS_VALID (1 << 0)
  487. #define DRM_SCANOUTPOS_IN_VBLANK (1 << 1)
  488. #define DRM_SCANOUTPOS_ACCURATE (1 << 2)
  489. #define USE_REAL_VBLANKSTART (1 << 30)
  490. #define GET_DISTANCE_TO_VBLANKSTART (1 << 31)
  491. void amdgpu_link_encoder_connector(struct drm_device *dev);
  492. struct drm_connector *
  493. amdgpu_get_connector_for_encoder(struct drm_encoder *encoder);
  494. struct drm_connector *
  495. amdgpu_get_connector_for_encoder_init(struct drm_encoder *encoder);
  496. bool amdgpu_dig_monitor_is_duallink(struct drm_encoder *encoder,
  497. u32 pixel_clock);
  498. u16 amdgpu_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder);
  499. struct drm_encoder *amdgpu_get_external_encoder(struct drm_encoder *encoder);
  500. bool amdgpu_ddc_probe(struct amdgpu_connector *amdgpu_connector, bool use_aux);
  501. void amdgpu_encoder_set_active_device(struct drm_encoder *encoder);
  502. int amdgpu_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
  503. unsigned int flags, int *vpos, int *hpos,
  504. ktime_t *stime, ktime_t *etime,
  505. const struct drm_display_mode *mode);
  506. int amdgpu_framebuffer_init(struct drm_device *dev,
  507. struct amdgpu_framebuffer *rfb,
  508. const struct drm_mode_fb_cmd2 *mode_cmd,
  509. struct drm_gem_object *obj);
  510. int amdgpufb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
  511. void amdgpu_enc_destroy(struct drm_encoder *encoder);
  512. void amdgpu_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
  513. bool amdgpu_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
  514. const struct drm_display_mode *mode,
  515. struct drm_display_mode *adjusted_mode);
  516. void amdgpu_panel_mode_fixup(struct drm_encoder *encoder,
  517. struct drm_display_mode *adjusted_mode);
  518. int amdgpu_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc);
  519. /* fbdev layer */
  520. int amdgpu_fbdev_init(struct amdgpu_device *adev);
  521. void amdgpu_fbdev_fini(struct amdgpu_device *adev);
  522. void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state);
  523. int amdgpu_fbdev_total_size(struct amdgpu_device *adev);
  524. bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj);
  525. void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev);
  526. void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev);
  527. int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled);
  528. /* amdgpu_display.c */
  529. void amdgpu_print_display_setup(struct drm_device *dev);
  530. int amdgpu_modeset_create_props(struct amdgpu_device *adev);
  531. int amdgpu_crtc_set_config(struct drm_mode_set *set,
  532. struct drm_modeset_acquire_ctx *ctx);
  533. int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc,
  534. struct drm_framebuffer *fb,
  535. struct drm_pending_vblank_event *event,
  536. uint32_t page_flip_flags, uint32_t target,
  537. struct drm_modeset_acquire_ctx *ctx);
  538. extern const struct drm_mode_config_funcs amdgpu_mode_funcs;
  539. #endif