aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2017-09-12 15:58:20 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:01:32 -0400
commit4562236b3bc0a28aeb6ee93b2d8a849a4c4e1c7c (patch)
tree84301c04dcaaa05c3318a8fe62cf62ab52ecc162 /drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
parent9c5b2b0d409304c2e3c1f4d1c9bb4958e1d46f8f (diff)
drm/amd/dc: Add dc display driver (v2)
Supported DCE versions: 8.0, 10.0, 11.0, 11.2 v2: rebase against 4.11 Signed-off-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h85
1 files changed, 82 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
index 109a3833c3a8..3a3adfa16ada 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
@@ -38,11 +38,15 @@
38#include <drm/drm_crtc_helper.h> 38#include <drm/drm_crtc_helper.h>
39#include <drm/drm_fb_helper.h> 39#include <drm/drm_fb_helper.h>
40#include <drm/drm_plane_helper.h> 40#include <drm/drm_plane_helper.h>
41#include <drm/drm_fb_helper.h>
41#include <linux/i2c.h> 42#include <linux/i2c.h>
42#include <linux/i2c-algo-bit.h> 43#include <linux/i2c-algo-bit.h>
43#include <linux/hrtimer.h> 44#include <linux/hrtimer.h>
44#include "amdgpu_irq.h" 45#include "amdgpu_irq.h"
45 46
47#include <drm/drm_dp_mst_helper.h>
48#include "modules/inc/mod_freesync.h"
49
46struct amdgpu_bo; 50struct amdgpu_bo;
47struct amdgpu_device; 51struct amdgpu_device;
48struct amdgpu_encoder; 52struct amdgpu_encoder;
@@ -292,6 +296,27 @@ struct amdgpu_display_funcs {
292 uint16_t connector_object_id, 296 uint16_t connector_object_id,
293 struct amdgpu_hpd *hpd, 297 struct amdgpu_hpd *hpd,
294 struct amdgpu_router *router); 298 struct amdgpu_router *router);
299 /* it is used to enter or exit into free sync mode */
300 int (*notify_freesync)(struct drm_device *dev, void *data,
301 struct drm_file *filp);
302 /* it is used to allow enablement of freesync mode */
303 int (*set_freesync_property)(struct drm_connector *connector,
304 struct drm_property *property,
305 uint64_t val);
306
307
308};
309
310struct amdgpu_framebuffer {
311 struct drm_framebuffer base;
312 struct drm_gem_object *obj;
313};
314
315struct amdgpu_fbdev {
316 struct drm_fb_helper helper;
317 struct amdgpu_framebuffer rfb;
318 struct list_head fbdev_list;
319 struct amdgpu_device *adev;
295}; 320};
296 321
297struct amdgpu_mode_info { 322struct amdgpu_mode_info {
@@ -400,6 +425,11 @@ struct amdgpu_crtc {
400 /* for virtual dce */ 425 /* for virtual dce */
401 struct hrtimer vblank_timer; 426 struct hrtimer vblank_timer;
402 enum amdgpu_interrupt_state vsync_timer_enabled; 427 enum amdgpu_interrupt_state vsync_timer_enabled;
428
429 int otg_inst;
430 uint32_t flip_flags;
431 /* After Set Mode target will be non-NULL */
432 struct dc_target *target;
403}; 433};
404 434
405struct amdgpu_encoder_atom_dig { 435struct amdgpu_encoder_atom_dig {
@@ -489,6 +519,19 @@ enum amdgpu_connector_dither {
489 AMDGPU_FMT_DITHER_ENABLE = 1, 519 AMDGPU_FMT_DITHER_ENABLE = 1,
490}; 520};
491 521
522struct amdgpu_dm_dp_aux {
523 struct drm_dp_aux aux;
524 uint32_t link_index;
525};
526
527struct amdgpu_i2c_adapter {
528 struct i2c_adapter base;
529 struct amdgpu_display_manager *dm;
530 uint32_t link_index;
531};
532
533#define TO_DM_AUX(x) container_of((x), struct amdgpu_dm_dp_aux, aux)
534
492struct amdgpu_connector { 535struct amdgpu_connector {
493 struct drm_connector base; 536 struct drm_connector base;
494 uint32_t connector_id; 537 uint32_t connector_id;
@@ -500,6 +543,14 @@ struct amdgpu_connector {
500 /* we need to mind the EDID between detect 543 /* we need to mind the EDID between detect
501 and get modes due to analog/digital/tvencoder */ 544 and get modes due to analog/digital/tvencoder */
502 struct edid *edid; 545 struct edid *edid;
546 /* number of modes generated from EDID at 'dc_sink' */
547 int num_modes;
548 /* The 'old' sink - before an HPD.
549 * The 'current' sink is in dc_link->sink. */
550 const struct dc_sink *dc_sink;
551 const struct dc_link *dc_link;
552 const struct dc_sink *dc_em_sink;
553 const struct dc_target *target;
503 void *con_priv; 554 void *con_priv;
504 bool dac_load_detect; 555 bool dac_load_detect;
505 bool detected_by_load; /* if the connection status was determined by load */ 556 bool detected_by_load; /* if the connection status was determined by load */
@@ -510,11 +561,39 @@ struct amdgpu_connector {
510 enum amdgpu_connector_audio audio; 561 enum amdgpu_connector_audio audio;
511 enum amdgpu_connector_dither dither; 562 enum amdgpu_connector_dither dither;
512 unsigned pixelclock_for_modeset; 563 unsigned pixelclock_for_modeset;
564
565 struct drm_dp_mst_topology_mgr mst_mgr;
566 struct amdgpu_dm_dp_aux dm_dp_aux;
567 struct drm_dp_mst_port *port;
568 struct amdgpu_connector *mst_port;
569 struct amdgpu_encoder *mst_encoder;
570 struct semaphore mst_sem;
571
572 /* TODO see if we can merge with ddc_bus or make a dm_connector */
573 struct amdgpu_i2c_adapter *i2c;
574
575 /* Monitor range limits */
576 int min_vfreq ;
577 int max_vfreq ;
578 int pixel_clock_mhz;
579
580 /*freesync caps*/
581 struct mod_freesync_caps caps;
582
583 struct mutex hpd_lock;
584
513}; 585};
514 586
515struct amdgpu_framebuffer { 587/* TODO: start to use this struct and remove same field from base one */
516 struct drm_framebuffer base; 588struct amdgpu_mst_connector {
517 struct drm_gem_object *obj; 589 struct amdgpu_connector base;
590
591 struct drm_dp_mst_topology_mgr mst_mgr;
592 struct amdgpu_dm_dp_aux dm_dp_aux;
593 struct drm_dp_mst_port *port;
594 struct amdgpu_connector *mst_port;
595 bool is_mst_connector;
596 struct amdgpu_encoder *mst_encoder;
518}; 597};
519 598
520#define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \ 599#define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \