aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drmP.h1
-rw-r--r--include/drm/drm_connector.h20
-rw-r--r--include/drm/drm_dp_helper.h95
-rw-r--r--include/drm/drm_global.h53
-rw-r--r--include/drm/drm_hdcp.h212
-rw-r--r--include/drm/gpu_scheduler.h5
-rw-r--r--include/drm/i915_pciids.h21
-rw-r--r--include/drm/ttm/ttm_bo_driver.h23
-rw-r--r--include/drm/ttm/ttm_memory.h4
9 files changed, 352 insertions, 82 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 514beb2d483a..bdb0d5548f39 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -68,7 +68,6 @@
68#include <drm/drm_agpsupport.h> 68#include <drm/drm_agpsupport.h>
69#include <drm/drm_crtc.h> 69#include <drm/drm_crtc.h>
70#include <drm/drm_fourcc.h> 70#include <drm/drm_fourcc.h>
71#include <drm/drm_global.h>
72#include <drm/drm_hashtab.h> 71#include <drm/drm_hashtab.h>
73#include <drm/drm_mm.h> 72#include <drm/drm_mm.h>
74#include <drm/drm_os_linux.h> 73#include <drm/drm_os_linux.h>
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 2f38d3598eb4..665b9cae7f43 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -508,6 +508,18 @@ struct drm_connector_state {
508 * drm_writeback_signal_completion() 508 * drm_writeback_signal_completion()
509 */ 509 */
510 struct drm_writeback_job *writeback_job; 510 struct drm_writeback_job *writeback_job;
511
512 /**
513 * @max_requested_bpc: Connector property to limit the maximum bit
514 * depth of the pixels.
515 */
516 u8 max_requested_bpc;
517
518 /**
519 * @max_bpc: Connector max_bpc based on the requested max_bpc property
520 * and the connector bpc limitations obtained from edid.
521 */
522 u8 max_bpc;
511}; 523};
512 524
513/** 525/**
@@ -973,6 +985,12 @@ struct drm_connector {
973 */ 985 */
974 struct drm_property_blob *path_blob_ptr; 986 struct drm_property_blob *path_blob_ptr;
975 987
988 /**
989 * @max_bpc_property: Default connector property for the max bpc to be
990 * driven out of the connector.
991 */
992 struct drm_property *max_bpc_property;
993
976#define DRM_CONNECTOR_POLL_HPD (1 << 0) 994#define DRM_CONNECTOR_POLL_HPD (1 << 0)
977#define DRM_CONNECTOR_POLL_CONNECT (1 << 1) 995#define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
978#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) 996#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
@@ -1245,6 +1263,8 @@ void drm_connector_set_link_status_property(struct drm_connector *connector,
1245 uint64_t link_status); 1263 uint64_t link_status);
1246int drm_connector_init_panel_orientation_property( 1264int drm_connector_init_panel_orientation_property(
1247 struct drm_connector *connector, int width, int height); 1265 struct drm_connector *connector, int width, int height);
1266int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
1267 int min, int max);
1248 1268
1249/** 1269/**
1250 * struct drm_tile_group - Tile group metadata 1270 * struct drm_tile_group - Tile group metadata
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 9ad98e8d9ede..3314e91f6eb3 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -231,6 +231,8 @@
231#define DP_DSC_MAX_BITS_PER_PIXEL_LOW 0x067 /* eDP 1.4 */ 231#define DP_DSC_MAX_BITS_PER_PIXEL_LOW 0x067 /* eDP 1.4 */
232 232
233#define DP_DSC_MAX_BITS_PER_PIXEL_HI 0x068 /* eDP 1.4 */ 233#define DP_DSC_MAX_BITS_PER_PIXEL_HI 0x068 /* eDP 1.4 */
234# define DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK (0x3 << 0)
235# define DP_DSC_MAX_BITS_PER_PIXEL_HI_SHIFT 8
234 236
235#define DP_DSC_DEC_COLOR_FORMAT_CAP 0x069 237#define DP_DSC_DEC_COLOR_FORMAT_CAP 0x069
236# define DP_DSC_RGB (1 << 0) 238# define DP_DSC_RGB (1 << 0)
@@ -279,6 +281,8 @@
279# define DP_DSC_THROUGHPUT_MODE_1_1000 (14 << 4) 281# define DP_DSC_THROUGHPUT_MODE_1_1000 (14 << 4)
280 282
281#define DP_DSC_MAX_SLICE_WIDTH 0x06C 283#define DP_DSC_MAX_SLICE_WIDTH 0x06C
284#define DP_DSC_MIN_SLICE_WIDTH_VALUE 2560
285#define DP_DSC_SLICE_WIDTH_MULTIPLIER 320
282 286
283#define DP_DSC_SLICE_CAP_2 0x06D 287#define DP_DSC_SLICE_CAP_2 0x06D
284# define DP_DSC_16_PER_DP_DSC_SINK (1 << 0) 288# define DP_DSC_16_PER_DP_DSC_SINK (1 << 0)
@@ -477,6 +481,7 @@
477# define DP_AUX_FRAME_SYNC_VALID (1 << 0) 481# define DP_AUX_FRAME_SYNC_VALID (1 << 0)
478 482
479#define DP_DSC_ENABLE 0x160 /* DP 1.4 */ 483#define DP_DSC_ENABLE 0x160 /* DP 1.4 */
484# define DP_DECOMPRESSION_EN (1 << 0)
480 485
481#define DP_PSR_EN_CFG 0x170 /* XXX 1.2? */ 486#define DP_PSR_EN_CFG 0x170 /* XXX 1.2? */
482# define DP_PSR_ENABLE (1 << 0) 487# define DP_PSR_ENABLE (1 << 0)
@@ -907,6 +912,57 @@
907#define DP_AUX_HDCP_KSV_FIFO 0x6802C 912#define DP_AUX_HDCP_KSV_FIFO 0x6802C
908#define DP_AUX_HDCP_AINFO 0x6803B 913#define DP_AUX_HDCP_AINFO 0x6803B
909 914
915/* DP HDCP2.2 parameter offsets in DPCD address space */
916#define DP_HDCP_2_2_REG_RTX_OFFSET 0x69000
917#define DP_HDCP_2_2_REG_TXCAPS_OFFSET 0x69008
918#define DP_HDCP_2_2_REG_CERT_RX_OFFSET 0x6900B
919#define DP_HDCP_2_2_REG_RRX_OFFSET 0x69215
920#define DP_HDCP_2_2_REG_RX_CAPS_OFFSET 0x6921D
921#define DP_HDCP_2_2_REG_EKPUB_KM_OFFSET 0x69220
922#define DP_HDCP_2_2_REG_EKH_KM_WR_OFFSET 0x692A0
923#define DP_HDCP_2_2_REG_M_OFFSET 0x692B0
924#define DP_HDCP_2_2_REG_HPRIME_OFFSET 0x692C0
925#define DP_HDCP_2_2_REG_EKH_KM_RD_OFFSET 0x692E0
926#define DP_HDCP_2_2_REG_RN_OFFSET 0x692F0
927#define DP_HDCP_2_2_REG_LPRIME_OFFSET 0x692F8
928#define DP_HDCP_2_2_REG_EDKEY_KS_OFFSET 0x69318
929#define DP_HDCP_2_2_REG_RIV_OFFSET 0x69328
930#define DP_HDCP_2_2_REG_RXINFO_OFFSET 0x69330
931#define DP_HDCP_2_2_REG_SEQ_NUM_V_OFFSET 0x69332
932#define DP_HDCP_2_2_REG_VPRIME_OFFSET 0x69335
933#define DP_HDCP_2_2_REG_RECV_ID_LIST_OFFSET 0x69345
934#define DP_HDCP_2_2_REG_V_OFFSET 0x693E0
935#define DP_HDCP_2_2_REG_SEQ_NUM_M_OFFSET 0x693F0
936#define DP_HDCP_2_2_REG_K_OFFSET 0x693F3
937#define DP_HDCP_2_2_REG_STREAM_ID_TYPE_OFFSET 0x693F5
938#define DP_HDCP_2_2_REG_MPRIME_OFFSET 0x69473
939#define DP_HDCP_2_2_REG_RXSTATUS_OFFSET 0x69493
940#define DP_HDCP_2_2_REG_STREAM_TYPE_OFFSET 0x69494
941#define DP_HDCP_2_2_REG_DBG_OFFSET 0x69518
942
943/* DP HDCP message start offsets in DPCD address space */
944#define DP_HDCP_2_2_AKE_INIT_OFFSET DP_HDCP_2_2_REG_RTX_OFFSET
945#define DP_HDCP_2_2_AKE_SEND_CERT_OFFSET DP_HDCP_2_2_REG_CERT_RX_OFFSET
946#define DP_HDCP_2_2_AKE_NO_STORED_KM_OFFSET DP_HDCP_2_2_REG_EKPUB_KM_OFFSET
947#define DP_HDCP_2_2_AKE_STORED_KM_OFFSET DP_HDCP_2_2_REG_EKH_KM_WR_OFFSET
948#define DP_HDCP_2_2_AKE_SEND_HPRIME_OFFSET DP_HDCP_2_2_REG_HPRIME_OFFSET
949#define DP_HDCP_2_2_AKE_SEND_PAIRING_INFO_OFFSET \
950 DP_HDCP_2_2_REG_EKH_KM_RD_OFFSET
951#define DP_HDCP_2_2_LC_INIT_OFFSET DP_HDCP_2_2_REG_RN_OFFSET
952#define DP_HDCP_2_2_LC_SEND_LPRIME_OFFSET DP_HDCP_2_2_REG_LPRIME_OFFSET
953#define DP_HDCP_2_2_SKE_SEND_EKS_OFFSET DP_HDCP_2_2_REG_EDKEY_KS_OFFSET
954#define DP_HDCP_2_2_REP_SEND_RECVID_LIST_OFFSET DP_HDCP_2_2_REG_RXINFO_OFFSET
955#define DP_HDCP_2_2_REP_SEND_ACK_OFFSET DP_HDCP_2_2_REG_V_OFFSET
956#define DP_HDCP_2_2_REP_STREAM_MANAGE_OFFSET DP_HDCP_2_2_REG_SEQ_NUM_M_OFFSET
957#define DP_HDCP_2_2_REP_STREAM_READY_OFFSET DP_HDCP_2_2_REG_MPRIME_OFFSET
958
959#define HDCP_2_2_DP_RXSTATUS_LEN 1
960#define HDCP_2_2_DP_RXSTATUS_READY(x) ((x) & BIT(0))
961#define HDCP_2_2_DP_RXSTATUS_H_PRIME(x) ((x) & BIT(1))
962#define HDCP_2_2_DP_RXSTATUS_PAIRING(x) ((x) & BIT(2))
963#define HDCP_2_2_DP_RXSTATUS_REAUTH_REQ(x) ((x) & BIT(3))
964#define HDCP_2_2_DP_RXSTATUS_LINK_FAILED(x) ((x) & BIT(4))
965
910/* DP 1.2 Sideband message defines */ 966/* DP 1.2 Sideband message defines */
911/* peer device type - DP 1.2a Table 2-92 */ 967/* peer device type - DP 1.2a Table 2-92 */
912#define DP_PEER_DEVICE_NONE 0x0 968#define DP_PEER_DEVICE_NONE 0x0
@@ -965,6 +1021,7 @@ u8 drm_dp_get_adjust_request_pre_emphasis(const u8 link_status[DP_LINK_STATUS_SI
965 1021
966#define DP_BRANCH_OUI_HEADER_SIZE 0xc 1022#define DP_BRANCH_OUI_HEADER_SIZE 0xc
967#define DP_RECEIVER_CAP_SIZE 0xf 1023#define DP_RECEIVER_CAP_SIZE 0xf
1024#define DP_DSC_RECEIVER_CAP_SIZE 0xf
968#define EDP_PSR_RECEIVER_CAP_SIZE 2 1025#define EDP_PSR_RECEIVER_CAP_SIZE 2
969#define EDP_DISPLAY_CTL_CAP_SIZE 3 1026#define EDP_DISPLAY_CTL_CAP_SIZE 3
970 1027
@@ -995,6 +1052,7 @@ struct dp_sdp_header {
995 1052
996#define EDP_SDP_HEADER_REVISION_MASK 0x1F 1053#define EDP_SDP_HEADER_REVISION_MASK 0x1F
997#define EDP_SDP_HEADER_VALID_PAYLOAD_BYTES 0x1F 1054#define EDP_SDP_HEADER_VALID_PAYLOAD_BYTES 0x1F
1055#define DP_SDP_PPS_HEADER_PAYLOAD_BYTES_MINUS_1 0x7F
998 1056
999struct edp_vsc_psr { 1057struct edp_vsc_psr {
1000 struct dp_sdp_header sdp_header; 1058 struct dp_sdp_header sdp_header;
@@ -1061,6 +1119,43 @@ drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
1061 return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT; 1119 return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT;
1062} 1120}
1063 1121
1122/* DP/eDP DSC support */
1123u8 drm_dp_dsc_sink_max_slice_count(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE],
1124 bool is_edp);
1125u8 drm_dp_dsc_sink_line_buf_depth(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE]);
1126u8 drm_dp_dsc_sink_max_color_depth(const u8 dsc_dpc[DP_DSC_RECEIVER_CAP_SIZE]);
1127
1128static inline bool
1129drm_dp_sink_supports_dsc(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
1130{
1131 return dsc_dpcd[DP_DSC_SUPPORT - DP_DSC_SUPPORT] &
1132 DP_DSC_DECOMPRESSION_IS_SUPPORTED;
1133}
1134
1135static inline u16
1136drm_edp_dsc_sink_output_bpp(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
1137{
1138 return dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_LOW - DP_DSC_SUPPORT] |
1139 (dsc_dpcd[DP_DSC_MAX_BITS_PER_PIXEL_HI - DP_DSC_SUPPORT] &
1140 DP_DSC_MAX_BITS_PER_PIXEL_HI_MASK <<
1141 DP_DSC_MAX_BITS_PER_PIXEL_HI_SHIFT);
1142}
1143
1144static inline u32
1145drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
1146{
1147 /* Max Slicewidth = Number of Pixels * 320 */
1148 return dsc_dpcd[DP_DSC_MAX_SLICE_WIDTH - DP_DSC_SUPPORT] *
1149 DP_DSC_SLICE_WIDTH_MULTIPLIER;
1150}
1151
1152/* Forward Error Correction Support on DP 1.4 */
1153static inline bool
1154drm_dp_sink_supports_fec(const u8 fec_capable)
1155{
1156 return fec_capable & DP_FEC_CAPABLE;
1157}
1158
1064/* 1159/*
1065 * DisplayPort AUX channel 1160 * DisplayPort AUX channel
1066 */ 1161 */
diff --git a/include/drm/drm_global.h b/include/drm/drm_global.h
deleted file mode 100644
index 3a830602a2e4..000000000000
--- a/include/drm/drm_global.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/**************************************************************************
2 *
3 * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27/*
28 * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
29 */
30
31#ifndef _DRM_GLOBAL_H_
32#define _DRM_GLOBAL_H_
33enum drm_global_types {
34 DRM_GLOBAL_TTM_MEM = 0,
35 DRM_GLOBAL_TTM_BO,
36 DRM_GLOBAL_TTM_OBJECT,
37 DRM_GLOBAL_NUM
38};
39
40struct drm_global_reference {
41 enum drm_global_types global_type;
42 size_t size;
43 void *object;
44 int (*init) (struct drm_global_reference *);
45 void (*release) (struct drm_global_reference *);
46};
47
48void drm_global_init(void);
49void drm_global_release(void);
50int drm_global_item_ref(struct drm_global_reference *ref);
51void drm_global_item_unref(struct drm_global_reference *ref);
52
53#endif
diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index 98e63d870139..a6de09c5e47f 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -38,4 +38,216 @@
38#define DRM_HDCP_DDC_BSTATUS 0x41 38#define DRM_HDCP_DDC_BSTATUS 0x41
39#define DRM_HDCP_DDC_KSV_FIFO 0x43 39#define DRM_HDCP_DDC_KSV_FIFO 0x43
40 40
41#define DRM_HDCP_1_4_SRM_ID 0x8
42#define DRM_HDCP_1_4_VRL_LENGTH_SIZE 3
43#define DRM_HDCP_1_4_DCP_SIG_SIZE 40
44
45/* Protocol message definition for HDCP2.2 specification */
46/*
47 * Protected content streams are classified into 2 types:
48 * - Type0: Can be transmitted with HDCP 1.4+
49 * - Type1: Can be transmitted with HDCP 2.2+
50 */
51#define HDCP_STREAM_TYPE0 0x00
52#define HDCP_STREAM_TYPE1 0x01
53
54/* HDCP2.2 Msg IDs */
55#define HDCP_2_2_NULL_MSG 1
56#define HDCP_2_2_AKE_INIT 2
57#define HDCP_2_2_AKE_SEND_CERT 3
58#define HDCP_2_2_AKE_NO_STORED_KM 4
59#define HDCP_2_2_AKE_STORED_KM 5
60#define HDCP_2_2_AKE_SEND_HPRIME 7
61#define HDCP_2_2_AKE_SEND_PAIRING_INFO 8
62#define HDCP_2_2_LC_INIT 9
63#define HDCP_2_2_LC_SEND_LPRIME 10
64#define HDCP_2_2_SKE_SEND_EKS 11
65#define HDCP_2_2_REP_SEND_RECVID_LIST 12
66#define HDCP_2_2_REP_SEND_ACK 15
67#define HDCP_2_2_REP_STREAM_MANAGE 16
68#define HDCP_2_2_REP_STREAM_READY 17
69#define HDCP_2_2_ERRATA_DP_STREAM_TYPE 50
70
71#define HDCP_2_2_RTX_LEN 8
72#define HDCP_2_2_RRX_LEN 8
73
74#define HDCP_2_2_K_PUB_RX_MOD_N_LEN 128
75#define HDCP_2_2_K_PUB_RX_EXP_E_LEN 3
76#define HDCP_2_2_K_PUB_RX_LEN (HDCP_2_2_K_PUB_RX_MOD_N_LEN + \
77 HDCP_2_2_K_PUB_RX_EXP_E_LEN)
78
79#define HDCP_2_2_DCP_LLC_SIG_LEN 384
80
81#define HDCP_2_2_E_KPUB_KM_LEN 128
82#define HDCP_2_2_E_KH_KM_M_LEN (16 + 16)
83#define HDCP_2_2_H_PRIME_LEN 32
84#define HDCP_2_2_E_KH_KM_LEN 16
85#define HDCP_2_2_RN_LEN 8
86#define HDCP_2_2_L_PRIME_LEN 32
87#define HDCP_2_2_E_DKEY_KS_LEN 16
88#define HDCP_2_2_RIV_LEN 8
89#define HDCP_2_2_SEQ_NUM_LEN 3
90#define HDCP_2_2_V_PRIME_HALF_LEN (HDCP_2_2_L_PRIME_LEN / 2)
91#define HDCP_2_2_RECEIVER_ID_LEN DRM_HDCP_KSV_LEN
92#define HDCP_2_2_MAX_DEVICE_COUNT 31
93#define HDCP_2_2_RECEIVER_IDS_MAX_LEN (HDCP_2_2_RECEIVER_ID_LEN * \
94 HDCP_2_2_MAX_DEVICE_COUNT)
95#define HDCP_2_2_MPRIME_LEN 32
96
97/* Following Macros take a byte at a time for bit(s) masking */
98/*
99 * TODO: This has to be changed for DP MST, as multiple stream on
100 * same port is possible.
101 * For HDCP2.2 on HDMI and DP SST this value is always 1.
102 */
103#define HDCP_2_2_MAX_CONTENT_STREAMS_CNT 1
104#define HDCP_2_2_TXCAP_MASK_LEN 2
105#define HDCP_2_2_RXCAPS_LEN 3
106#define HDCP_2_2_RX_REPEATER(x) ((x) & BIT(0))
107#define HDCP_2_2_DP_HDCP_CAPABLE(x) ((x) & BIT(1))
108#define HDCP_2_2_RXINFO_LEN 2
109
110/* HDCP1.x compliant device in downstream */
111#define HDCP_2_2_HDCP1_DEVICE_CONNECTED(x) ((x) & BIT(0))
112
113/* HDCP2.0 Compliant repeater in downstream */
114#define HDCP_2_2_HDCP_2_0_REP_CONNECTED(x) ((x) & BIT(1))
115#define HDCP_2_2_MAX_CASCADE_EXCEEDED(x) ((x) & BIT(2))
116#define HDCP_2_2_MAX_DEVS_EXCEEDED(x) ((x) & BIT(3))
117#define HDCP_2_2_DEV_COUNT_LO(x) (((x) & (0xF << 4)) >> 4)
118#define HDCP_2_2_DEV_COUNT_HI(x) ((x) & BIT(0))
119#define HDCP_2_2_DEPTH(x) (((x) & (0x7 << 1)) >> 1)
120
121struct hdcp2_cert_rx {
122 u8 receiver_id[HDCP_2_2_RECEIVER_ID_LEN];
123 u8 kpub_rx[HDCP_2_2_K_PUB_RX_LEN];
124 u8 reserved[2];
125 u8 dcp_signature[HDCP_2_2_DCP_LLC_SIG_LEN];
126} __packed;
127
128struct hdcp2_streamid_type {
129 u8 stream_id;
130 u8 stream_type;
131} __packed;
132
133/*
134 * The TxCaps field specified in the HDCP HDMI, DP specs
135 * This field is big endian as specified in the errata.
136 */
137struct hdcp2_tx_caps {
138 /* Transmitter must set this to 0x2 */
139 u8 version;
140
141 /* Reserved for HDCP and DP Spec. Read as Zero */
142 u8 tx_cap_mask[HDCP_2_2_TXCAP_MASK_LEN];
143} __packed;
144
145/* Main structures for HDCP2.2 protocol communication */
146struct hdcp2_ake_init {
147 u8 msg_id;
148 u8 r_tx[HDCP_2_2_RTX_LEN];
149 struct hdcp2_tx_caps tx_caps;
150} __packed;
151
152struct hdcp2_ake_send_cert {
153 u8 msg_id;
154 struct hdcp2_cert_rx cert_rx;
155 u8 r_rx[HDCP_2_2_RRX_LEN];
156 u8 rx_caps[HDCP_2_2_RXCAPS_LEN];
157} __packed;
158
159struct hdcp2_ake_no_stored_km {
160 u8 msg_id;
161 u8 e_kpub_km[HDCP_2_2_E_KPUB_KM_LEN];
162} __packed;
163
164struct hdcp2_ake_stored_km {
165 u8 msg_id;
166 u8 e_kh_km_m[HDCP_2_2_E_KH_KM_M_LEN];
167} __packed;
168
169struct hdcp2_ake_send_hprime {
170 u8 msg_id;
171 u8 h_prime[HDCP_2_2_H_PRIME_LEN];
172} __packed;
173
174struct hdcp2_ake_send_pairing_info {
175 u8 msg_id;
176 u8 e_kh_km[HDCP_2_2_E_KH_KM_LEN];
177} __packed;
178
179struct hdcp2_lc_init {
180 u8 msg_id;
181 u8 r_n[HDCP_2_2_RN_LEN];
182} __packed;
183
184struct hdcp2_lc_send_lprime {
185 u8 msg_id;
186 u8 l_prime[HDCP_2_2_L_PRIME_LEN];
187} __packed;
188
189struct hdcp2_ske_send_eks {
190 u8 msg_id;
191 u8 e_dkey_ks[HDCP_2_2_E_DKEY_KS_LEN];
192 u8 riv[HDCP_2_2_RIV_LEN];
193} __packed;
194
195struct hdcp2_rep_send_receiverid_list {
196 u8 msg_id;
197 u8 rx_info[HDCP_2_2_RXINFO_LEN];
198 u8 seq_num_v[HDCP_2_2_SEQ_NUM_LEN];
199 u8 v_prime[HDCP_2_2_V_PRIME_HALF_LEN];
200 u8 receiver_ids[HDCP_2_2_RECEIVER_IDS_MAX_LEN];
201} __packed;
202
203struct hdcp2_rep_send_ack {
204 u8 msg_id;
205 u8 v[HDCP_2_2_V_PRIME_HALF_LEN];
206} __packed;
207
208struct hdcp2_rep_stream_manage {
209 u8 msg_id;
210 u8 seq_num_m[HDCP_2_2_SEQ_NUM_LEN];
211 __be16 k;
212 struct hdcp2_streamid_type streams[HDCP_2_2_MAX_CONTENT_STREAMS_CNT];
213} __packed;
214
215struct hdcp2_rep_stream_ready {
216 u8 msg_id;
217 u8 m_prime[HDCP_2_2_MPRIME_LEN];
218} __packed;
219
220struct hdcp2_dp_errata_stream_type {
221 u8 msg_id;
222 u8 stream_type;
223} __packed;
224
225/* HDCP2.2 TIMEOUTs in mSec */
226#define HDCP_2_2_CERT_TIMEOUT_MS 100
227#define HDCP_2_2_HPRIME_NO_PAIRED_TIMEOUT_MS 1000
228#define HDCP_2_2_HPRIME_PAIRED_TIMEOUT_MS 200
229#define HDCP_2_2_PAIRING_TIMEOUT_MS 200
230#define HDCP_2_2_HDMI_LPRIME_TIMEOUT_MS 20
231#define HDCP_2_2_DP_LPRIME_TIMEOUT_MS 7
232#define HDCP_2_2_RECVID_LIST_TIMEOUT_MS 3000
233#define HDCP_2_2_STREAM_READY_TIMEOUT_MS 100
234
235/* HDMI HDCP2.2 Register Offsets */
236#define HDCP_2_2_HDMI_REG_VER_OFFSET 0x50
237#define HDCP_2_2_HDMI_REG_WR_MSG_OFFSET 0x60
238#define HDCP_2_2_HDMI_REG_RXSTATUS_OFFSET 0x70
239#define HDCP_2_2_HDMI_REG_RD_MSG_OFFSET 0x80
240#define HDCP_2_2_HDMI_REG_DBG_OFFSET 0xC0
241
242#define HDCP_2_2_HDMI_SUPPORT_MASK BIT(2)
243#define HDCP_2_2_RX_CAPS_VERSION_VAL 0x02
244#define HDCP_2_2_SEQ_NUM_MAX 0xFFFFFF
245#define HDCP_2_2_DELAY_BEFORE_ENCRYPTION_EN 200
246
247/* Below macros take a byte at a time and mask the bit(s) */
248#define HDCP_2_2_HDMI_RXSTATUS_LEN 2
249#define HDCP_2_2_HDMI_RXSTATUS_MSG_SZ_HI(x) ((x) & 0x3)
250#define HDCP_2_2_HDMI_RXSTATUS_READY(x) ((x) & BIT(2))
251#define HDCP_2_2_HDMI_RXSTATUS_REAUTH_REQ(x) ((x) & BIT(3))
252
41#endif 253#endif
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index d87b268f1781..926379d53484 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -264,6 +264,7 @@ struct drm_sched_backend_ops {
264 * @hang_limit: once the hangs by a job crosses this limit then it is marked 264 * @hang_limit: once the hangs by a job crosses this limit then it is marked
265 * guilty and it will be considered for scheduling further. 265 * guilty and it will be considered for scheduling further.
266 * @num_jobs: the number of jobs in queue in the scheduler 266 * @num_jobs: the number of jobs in queue in the scheduler
267 * @ready: marks if the underlying HW is ready to work
267 * 268 *
268 * One scheduler is implemented for each hardware ring. 269 * One scheduler is implemented for each hardware ring.
269 */ 270 */
@@ -283,22 +284,26 @@ struct drm_gpu_scheduler {
283 spinlock_t job_list_lock; 284 spinlock_t job_list_lock;
284 int hang_limit; 285 int hang_limit;
285 atomic_t num_jobs; 286 atomic_t num_jobs;
287 bool ready;
286}; 288};
287 289
288int drm_sched_init(struct drm_gpu_scheduler *sched, 290int drm_sched_init(struct drm_gpu_scheduler *sched,
289 const struct drm_sched_backend_ops *ops, 291 const struct drm_sched_backend_ops *ops,
290 uint32_t hw_submission, unsigned hang_limit, long timeout, 292 uint32_t hw_submission, unsigned hang_limit, long timeout,
291 const char *name); 293 const char *name);
294
292void drm_sched_fini(struct drm_gpu_scheduler *sched); 295void drm_sched_fini(struct drm_gpu_scheduler *sched);
293int drm_sched_job_init(struct drm_sched_job *job, 296int drm_sched_job_init(struct drm_sched_job *job,
294 struct drm_sched_entity *entity, 297 struct drm_sched_entity *entity,
295 void *owner); 298 void *owner);
299void drm_sched_job_cleanup(struct drm_sched_job *job);
296void drm_sched_wakeup(struct drm_gpu_scheduler *sched); 300void drm_sched_wakeup(struct drm_gpu_scheduler *sched);
297void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched, 301void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched,
298 struct drm_sched_job *job); 302 struct drm_sched_job *job);
299void drm_sched_job_recovery(struct drm_gpu_scheduler *sched); 303void drm_sched_job_recovery(struct drm_gpu_scheduler *sched);
300bool drm_sched_dependency_optimized(struct dma_fence* fence, 304bool drm_sched_dependency_optimized(struct dma_fence* fence,
301 struct drm_sched_entity *entity); 305 struct drm_sched_entity *entity);
306void drm_sched_fault(struct drm_gpu_scheduler *sched);
302void drm_sched_job_kickout(struct drm_sched_job *s_job); 307void drm_sched_job_kickout(struct drm_sched_job *s_job);
303 308
304void drm_sched_rq_add_entity(struct drm_sched_rq *rq, 309void drm_sched_rq_add_entity(struct drm_sched_rq *rq,
diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
index fd965ffbb92e..192667144693 100644
--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -365,16 +365,20 @@
365 INTEL_VGA_DEVICE(0x593B, info) /* Halo GT4 */ 365 INTEL_VGA_DEVICE(0x593B, info) /* Halo GT4 */
366 366
367/* AML/KBL Y GT2 */ 367/* AML/KBL Y GT2 */
368#define INTEL_AML_GT2_IDS(info) \ 368#define INTEL_AML_KBL_GT2_IDS(info) \
369 INTEL_VGA_DEVICE(0x591C, info), /* ULX GT2 */ \ 369 INTEL_VGA_DEVICE(0x591C, info), /* ULX GT2 */ \
370 INTEL_VGA_DEVICE(0x87C0, info) /* ULX GT2 */ 370 INTEL_VGA_DEVICE(0x87C0, info) /* ULX GT2 */
371 371
372/* AML/CFL Y GT2 */
373#define INTEL_AML_CFL_GT2_IDS(info) \
374 INTEL_VGA_DEVICE(0x87CA, info)
375
372#define INTEL_KBL_IDS(info) \ 376#define INTEL_KBL_IDS(info) \
373 INTEL_KBL_GT1_IDS(info), \ 377 INTEL_KBL_GT1_IDS(info), \
374 INTEL_KBL_GT2_IDS(info), \ 378 INTEL_KBL_GT2_IDS(info), \
375 INTEL_KBL_GT3_IDS(info), \ 379 INTEL_KBL_GT3_IDS(info), \
376 INTEL_KBL_GT4_IDS(info), \ 380 INTEL_KBL_GT4_IDS(info), \
377 INTEL_AML_GT2_IDS(info) 381 INTEL_AML_KBL_GT2_IDS(info)
378 382
379/* CFL S */ 383/* CFL S */
380#define INTEL_CFL_S_GT1_IDS(info) \ 384#define INTEL_CFL_S_GT1_IDS(info) \
@@ -407,17 +411,17 @@
407 411
408/* WHL/CFL U GT1 */ 412/* WHL/CFL U GT1 */
409#define INTEL_WHL_U_GT1_IDS(info) \ 413#define INTEL_WHL_U_GT1_IDS(info) \
410 INTEL_VGA_DEVICE(0x3EA1, info) 414 INTEL_VGA_DEVICE(0x3EA1, info), \
415 INTEL_VGA_DEVICE(0x3EA4, info)
411 416
412/* WHL/CFL U GT2 */ 417/* WHL/CFL U GT2 */
413#define INTEL_WHL_U_GT2_IDS(info) \ 418#define INTEL_WHL_U_GT2_IDS(info) \
414 INTEL_VGA_DEVICE(0x3EA0, info) 419 INTEL_VGA_DEVICE(0x3EA0, info), \
420 INTEL_VGA_DEVICE(0x3EA3, info)
415 421
416/* WHL/CFL U GT3 */ 422/* WHL/CFL U GT3 */
417#define INTEL_WHL_U_GT3_IDS(info) \ 423#define INTEL_WHL_U_GT3_IDS(info) \
418 INTEL_VGA_DEVICE(0x3EA2, info), \ 424 INTEL_VGA_DEVICE(0x3EA2, info)
419 INTEL_VGA_DEVICE(0x3EA3, info), \
420 INTEL_VGA_DEVICE(0x3EA4, info)
421 425
422#define INTEL_CFL_IDS(info) \ 426#define INTEL_CFL_IDS(info) \
423 INTEL_CFL_S_GT1_IDS(info), \ 427 INTEL_CFL_S_GT1_IDS(info), \
@@ -427,7 +431,8 @@
427 INTEL_CFL_U_GT3_IDS(info), \ 431 INTEL_CFL_U_GT3_IDS(info), \
428 INTEL_WHL_U_GT1_IDS(info), \ 432 INTEL_WHL_U_GT1_IDS(info), \
429 INTEL_WHL_U_GT2_IDS(info), \ 433 INTEL_WHL_U_GT2_IDS(info), \
430 INTEL_WHL_U_GT3_IDS(info) 434 INTEL_WHL_U_GT3_IDS(info), \
435 INTEL_AML_CFL_GT2_IDS(info)
431 436
432/* CNL */ 437/* CNL */
433#define INTEL_CNL_IDS(info) \ 438#define INTEL_CNL_IDS(info) \
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index e4fee8e02559..1021106438b2 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -31,7 +31,6 @@
31#define _TTM_BO_DRIVER_H_ 31#define _TTM_BO_DRIVER_H_
32 32
33#include <drm/drm_mm.h> 33#include <drm/drm_mm.h>
34#include <drm/drm_global.h>
35#include <drm/drm_vma_manager.h> 34#include <drm/drm_vma_manager.h>
36#include <linux/workqueue.h> 35#include <linux/workqueue.h>
37#include <linux/fs.h> 36#include <linux/fs.h>
@@ -385,15 +384,6 @@ struct ttm_bo_driver {
385}; 384};
386 385
387/** 386/**
388 * struct ttm_bo_global_ref - Argument to initialize a struct ttm_bo_global.
389 */
390
391struct ttm_bo_global_ref {
392 struct drm_global_reference ref;
393 struct ttm_mem_global *mem_glob;
394};
395
396/**
397 * struct ttm_bo_global - Buffer object driver global data. 387 * struct ttm_bo_global - Buffer object driver global data.
398 * 388 *
399 * @mem_glob: Pointer to a struct ttm_mem_global object for accounting. 389 * @mem_glob: Pointer to a struct ttm_mem_global object for accounting.
@@ -407,7 +397,7 @@ struct ttm_bo_global_ref {
407 * @swap_lru: Lru list of buffer objects used for swapping. 397 * @swap_lru: Lru list of buffer objects used for swapping.
408 */ 398 */
409 399
410struct ttm_bo_global { 400extern struct ttm_bo_global {
411 401
412 /** 402 /**
413 * Constant after init. 403 * Constant after init.
@@ -416,12 +406,12 @@ struct ttm_bo_global {
416 struct kobject kobj; 406 struct kobject kobj;
417 struct ttm_mem_global *mem_glob; 407 struct ttm_mem_global *mem_glob;
418 struct page *dummy_read_page; 408 struct page *dummy_read_page;
419 struct mutex device_list_mutex;
420 spinlock_t lru_lock; 409 spinlock_t lru_lock;
421 410
422 /** 411 /**
423 * Protected by device_list_mutex. 412 * Protected by ttm_global_mutex.
424 */ 413 */
414 unsigned int use_count;
425 struct list_head device_list; 415 struct list_head device_list;
426 416
427 /** 417 /**
@@ -433,7 +423,7 @@ struct ttm_bo_global {
433 * Internal protection. 423 * Internal protection.
434 */ 424 */
435 atomic_t bo_count; 425 atomic_t bo_count;
436}; 426} ttm_bo_glob;
437 427
438 428
439#define TTM_NUM_MEM_TYPES 8 429#define TTM_NUM_MEM_TYPES 8
@@ -578,9 +568,6 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem);
578void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, 568void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
579 struct ttm_mem_reg *mem); 569 struct ttm_mem_reg *mem);
580 570
581void ttm_bo_global_release(struct drm_global_reference *ref);
582int ttm_bo_global_init(struct drm_global_reference *ref);
583
584int ttm_bo_device_release(struct ttm_bo_device *bdev); 571int ttm_bo_device_release(struct ttm_bo_device *bdev);
585 572
586/** 573/**
@@ -598,7 +585,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);
598 * Returns: 585 * Returns:
599 * !0: Failure. 586 * !0: Failure.
600 */ 587 */
601int ttm_bo_device_init(struct ttm_bo_device *bdev, struct ttm_bo_global *glob, 588int ttm_bo_device_init(struct ttm_bo_device *bdev,
602 struct ttm_bo_driver *driver, 589 struct ttm_bo_driver *driver,
603 struct address_space *mapping, 590 struct address_space *mapping,
604 uint64_t file_page_offset, bool need_dma32); 591 uint64_t file_page_offset, bool need_dma32);
diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h
index 737b5fed8003..3ff48a0a2d7b 100644
--- a/include/drm/ttm/ttm_memory.h
+++ b/include/drm/ttm/ttm_memory.h
@@ -63,7 +63,7 @@
63 63
64#define TTM_MEM_MAX_ZONES 2 64#define TTM_MEM_MAX_ZONES 2
65struct ttm_mem_zone; 65struct ttm_mem_zone;
66struct ttm_mem_global { 66extern struct ttm_mem_global {
67 struct kobject kobj; 67 struct kobject kobj;
68 struct ttm_bo_global *bo_glob; 68 struct ttm_bo_global *bo_glob;
69 struct workqueue_struct *swap_queue; 69 struct workqueue_struct *swap_queue;
@@ -78,7 +78,7 @@ struct ttm_mem_global {
78#else 78#else
79 struct ttm_mem_zone *zone_dma32; 79 struct ttm_mem_zone *zone_dma32;
80#endif 80#endif
81}; 81} ttm_mem_glob;
82 82
83extern int ttm_mem_global_init(struct ttm_mem_global *glob); 83extern int ttm_mem_global_init(struct ttm_mem_global *glob);
84extern void ttm_mem_global_release(struct ttm_mem_global *glob); 84extern void ttm_mem_global_release(struct ttm_mem_global *glob);