Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'topic/drm-misc-2015-03-10' of git://anongit.freedesktop.org/drm-intel into drm-next

Another pile of misc drm patches all over, mostly polish for atomic. Last
minute rebase was to avoid the broken merge.

* tag 'topic/drm-misc-2015-03-10' of git://anongit.freedesktop.org/drm-intel:
drm: Check in setcrtc if the primary plane supports the fb pixel format
drm: Lighten sysfs connector 'status'
drm/plane-helper: unexport drm_primary_helper_create_plane
drm: Share plane pixel format check code between legacy and atomic
drm: Fix trivial typos in comments
drm/dp: add DPCD definitions from eDP 1.4
drm/dp: add DPCD definitions from DP 1.1 and 1.2a
drm: Fixup racy refcounting in plane_force_disable
drm/i915: Rotation property is now handled in DRM core
drm: Complete moving rotation property to core
drm/dp: add DPCD definitions from eDP 1.2
drm/dp: indentation and ordering cleanups
drm/atomic-helper: Fix kerneldoc for prepare_planes
drm: Remove redundant code in the getencoder ioctl

+287 -97
+6 -6
drivers/gpu/drm/drm_atomic.c
··· 450 450 *val = state->src_w; 451 451 } else if (property == config->prop_src_h) { 452 452 *val = state->src_h; 453 + } else if (property == config->rotation_property) { 454 + *val = state->rotation; 453 455 } else if (plane->funcs->atomic_get_property) { 454 456 return plane->funcs->atomic_get_property(plane, state, property, val); 455 457 } else { ··· 475 473 struct drm_plane_state *state) 476 474 { 477 475 unsigned int fb_width, fb_height; 478 - unsigned int i; 476 + int ret; 479 477 480 478 /* either *both* CRTC and FB must be set, or neither */ 481 479 if (WARN_ON(state->crtc && !state->fb)) { ··· 497 495 } 498 496 499 497 /* Check whether this plane supports the fb pixel format. */ 500 - for (i = 0; i < plane->format_count; i++) 501 - if (state->fb->pixel_format == plane->format_types[i]) 502 - break; 503 - if (i == plane->format_count) { 498 + ret = drm_plane_check_pixel_format(plane, state->fb->pixel_format); 499 + if (ret) { 504 500 DRM_DEBUG_ATOMIC("Invalid pixel format %s\n", 505 501 drm_get_format_name(state->fb->pixel_format)); 506 - return -EINVAL; 502 + return ret; 507 503 } 508 504 509 505 /* Give drivers some help against integer overflows */
+2 -2
drivers/gpu/drm/drm_atomic_helper.c
··· 1096 1096 */ 1097 1097 1098 1098 /** 1099 - * drm_atomic_helper_prepare_planes - prepare plane resources after commit 1099 + * drm_atomic_helper_prepare_planes - prepare plane resources before commit 1100 1100 * @dev: DRM device 1101 - * @state: atomic state object with old state structures 1101 + * @state: atomic state object with new state structures 1102 1102 * 1103 1103 * This function prepares plane state, specifically framebuffers, for the new 1104 1104 * configuration. If any failure is encountered this function will call
+41 -20
drivers/gpu/drm/drm_crtc.c
··· 524 524 } 525 525 EXPORT_SYMBOL(drm_framebuffer_reference); 526 526 527 - static void drm_framebuffer_free_bug(struct kref *kref) 528 - { 529 - BUG(); 530 - } 531 - 532 - static void __drm_framebuffer_unreference(struct drm_framebuffer *fb) 533 - { 534 - DRM_DEBUG("%p: FB ID: %d (%d)\n", fb, fb->base.id, atomic_read(&fb->refcount.refcount)); 535 - kref_put(&fb->refcount, drm_framebuffer_free_bug); 536 - } 537 - 538 527 /** 539 528 * drm_framebuffer_unregister_private - unregister a private fb from the lookup idr 540 529 * @fb: fb to unregister ··· 1308 1319 return; 1309 1320 } 1310 1321 /* disconnect the plane from the fb and crtc: */ 1311 - __drm_framebuffer_unreference(plane->old_fb); 1322 + drm_framebuffer_unreference(plane->old_fb); 1312 1323 plane->old_fb = NULL; 1313 1324 plane->fb = NULL; 1314 1325 plane->crtc = NULL; ··· 2274 2285 crtc = drm_encoder_get_crtc(encoder); 2275 2286 if (crtc) 2276 2287 enc_resp->crtc_id = crtc->base.id; 2277 - else if (encoder->crtc) 2278 - enc_resp->crtc_id = encoder->crtc->base.id; 2279 2288 else 2280 2289 enc_resp->crtc_id = 0; 2281 2290 drm_modeset_unlock(&dev->mode_config.connection_mutex); ··· 2408 2421 return 0; 2409 2422 } 2410 2423 2424 + /** 2425 + * drm_plane_check_pixel_format - Check if the plane supports the pixel format 2426 + * @plane: plane to check for format support 2427 + * @format: the pixel format 2428 + * 2429 + * Returns: 2430 + * Zero of @plane has @format in its list of supported pixel formats, -EINVAL 2431 + * otherwise. 2432 + */ 2433 + int drm_plane_check_pixel_format(const struct drm_plane *plane, u32 format) 2434 + { 2435 + unsigned int i; 2436 + 2437 + for (i = 0; i < plane->format_count; i++) { 2438 + if (format == plane->format_types[i]) 2439 + return 0; 2440 + } 2441 + 2442 + return -EINVAL; 2443 + } 2444 + 2411 2445 /* 2412 2446 * setplane_internal - setplane handler for internal callers 2413 2447 * ··· 2449 2441 { 2450 2442 int ret = 0; 2451 2443 unsigned int fb_width, fb_height; 2452 - unsigned int i; 2453 2444 2454 2445 /* No fb means shut it down */ 2455 2446 if (!fb) { ··· 2471 2464 } 2472 2465 2473 2466 /* Check whether this plane supports the fb pixel format. */ 2474 - for (i = 0; i < plane->format_count; i++) 2475 - if (fb->pixel_format == plane->format_types[i]) 2476 - break; 2477 - if (i == plane->format_count) { 2467 + ret = drm_plane_check_pixel_format(plane, fb->pixel_format); 2468 + if (ret) { 2478 2469 DRM_DEBUG_KMS("Invalid pixel format %s\n", 2479 2470 drm_get_format_name(fb->pixel_format)); 2480 - ret = -EINVAL; 2481 2471 goto out; 2482 2472 } 2483 2473 ··· 2797 2793 } 2798 2794 2799 2795 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); 2796 + 2797 + /* 2798 + * Check whether the primary plane supports the fb pixel format. 2799 + * Drivers not implementing the universal planes API use a 2800 + * default formats list provided by the DRM core which doesn't 2801 + * match real hardware capabilities. Skip the check in that 2802 + * case. 2803 + */ 2804 + if (!crtc->primary->format_default) { 2805 + ret = drm_plane_check_pixel_format(crtc->primary, 2806 + fb->pixel_format); 2807 + if (ret) { 2808 + DRM_DEBUG_KMS("Invalid pixel format %s\n", 2809 + drm_get_format_name(fb->pixel_format)); 2810 + goto out; 2811 + } 2812 + } 2800 2813 2801 2814 ret = drm_crtc_check_viewport(crtc, crtc_req->x, crtc_req->y, 2802 2815 mode, fb);
+2 -2
drivers/gpu/drm/drm_modes.c
··· 278 278 hblank = drm_mode->hdisplay * hblank_percentage / 279 279 (100 * HV_FACTOR - hblank_percentage); 280 280 hblank -= hblank % (2 * CVT_H_GRANULARITY); 281 - /* 14. find the total pixes per line */ 281 + /* 14. find the total pixels per line */ 282 282 drm_mode->htotal = drm_mode->hdisplay + hblank; 283 283 drm_mode->hsync_end = drm_mode->hdisplay + hblank / 2; 284 284 drm_mode->hsync_start = drm_mode->hsync_end - ··· 1209 1209 * <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] 1210 1210 * 1211 1211 * The intermediate drm_cmdline_mode structure is required to store additional 1212 - * options from the command line modline like the force-enabel/disable flag. 1212 + * options from the command line modline like the force-enable/disable flag. 1213 1213 * 1214 1214 * Returns: 1215 1215 * True if a valid modeline has been parsed, false otherwise.
+9 -22
drivers/gpu/drm/drm_plane_helper.c
··· 344 344 }; 345 345 EXPORT_SYMBOL(drm_primary_helper_funcs); 346 346 347 - /** 348 - * drm_primary_helper_create_plane() - Create a generic primary plane 349 - * @dev: drm device 350 - * @formats: pixel formats supported, or NULL for a default safe list 351 - * @num_formats: size of @formats; ignored if @formats is NULL 352 - * 353 - * Allocates and initializes a primary plane that can be used with the primary 354 - * plane helpers. Drivers that wish to use driver-specific plane structures or 355 - * provide custom handler functions may perform their own allocation and 356 - * initialization rather than calling this function. 357 - */ 358 - struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, 359 - const uint32_t *formats, 360 - int num_formats) 347 + static struct drm_plane *create_primary_plane(struct drm_device *dev) 361 348 { 362 349 struct drm_plane *primary; 363 350 int ret; ··· 353 366 if (primary == NULL) { 354 367 DRM_DEBUG_KMS("Failed to allocate primary plane\n"); 355 368 return NULL; 356 - } 357 - 358 - if (formats == NULL) { 359 - formats = safe_modeset_formats; 360 - num_formats = ARRAY_SIZE(safe_modeset_formats); 369 + /* 370 + * Remove the format_default field from drm_plane when dropping 371 + * this helper. 372 + */ 373 + primary->format_default = true; 361 374 } 362 375 363 376 /* possible_crtc's will be filled in later by crtc_init */ 364 377 ret = drm_universal_plane_init(dev, primary, 0, 365 378 &drm_primary_helper_funcs, 366 - formats, num_formats, 379 + safe_modeset_formats, 380 + ARRAY_SIZE(safe_modeset_formats), 367 381 DRM_PLANE_TYPE_PRIMARY); 368 382 if (ret) { 369 383 kfree(primary); ··· 373 385 374 386 return primary; 375 387 } 376 - EXPORT_SYMBOL(drm_primary_helper_create_plane); 377 388 378 389 /** 379 390 * drm_crtc_init - Legacy CRTC initialization function ··· 391 404 { 392 405 struct drm_plane *primary; 393 406 394 - primary = drm_primary_helper_create_plane(dev, NULL, 0); 407 + primary = create_primary_plane(dev); 395 408 return drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs); 396 409 } 397 410 EXPORT_SYMBOL(drm_crtc_init);
+56 -11
drivers/gpu/drm/drm_sysfs.c
··· 166 166 /* 167 167 * Connector properties 168 168 */ 169 + static ssize_t status_store(struct device *device, 170 + struct device_attribute *attr, 171 + const char *buf, size_t count) 172 + { 173 + struct drm_connector *connector = to_drm_connector(device); 174 + struct drm_device *dev = connector->dev; 175 + enum drm_connector_status old_status; 176 + int ret; 177 + 178 + ret = mutex_lock_interruptible(&dev->mode_config.mutex); 179 + if (ret) 180 + return ret; 181 + 182 + old_status = connector->status; 183 + 184 + if (sysfs_streq(buf, "detect")) { 185 + connector->force = 0; 186 + connector->status = connector->funcs->detect(connector, true); 187 + } else if (sysfs_streq(buf, "on")) { 188 + connector->force = DRM_FORCE_ON; 189 + } else if (sysfs_streq(buf, "on-digital")) { 190 + connector->force = DRM_FORCE_ON_DIGITAL; 191 + } else if (sysfs_streq(buf, "off")) { 192 + connector->force = DRM_FORCE_OFF; 193 + } else 194 + ret = -EINVAL; 195 + 196 + if (ret == 0 && connector->force) { 197 + if (connector->force == DRM_FORCE_ON || 198 + connector->force == DRM_FORCE_ON_DIGITAL) 199 + connector->status = connector_status_connected; 200 + else 201 + connector->status = connector_status_disconnected; 202 + if (connector->funcs->force) 203 + connector->funcs->force(connector); 204 + } 205 + 206 + if (old_status != connector->status) { 207 + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n", 208 + connector->base.id, 209 + connector->name, 210 + old_status, connector->status); 211 + 212 + dev->mode_config.delayed_event = true; 213 + if (dev->mode_config.poll_enabled) 214 + schedule_delayed_work(&dev->mode_config.output_poll_work, 215 + 0); 216 + } 217 + 218 + mutex_unlock(&dev->mode_config.mutex); 219 + 220 + return ret; 221 + } 222 + 169 223 static ssize_t status_show(struct device *device, 170 224 struct device_attribute *attr, 171 225 char *buf) 172 226 { 173 227 struct drm_connector *connector = to_drm_connector(device); 174 - enum drm_connector_status status; 175 - int ret; 176 - 177 - ret = mutex_lock_interruptible(&connector->dev->mode_config.mutex); 178 - if (ret) 179 - return ret; 180 - 181 - status = connector->funcs->detect(connector, true); 182 - mutex_unlock(&connector->dev->mode_config.mutex); 183 228 184 229 return snprintf(buf, PAGE_SIZE, "%s\n", 185 - drm_get_connector_status_name(status)); 230 + drm_get_connector_status_name(connector->status)); 186 231 } 187 232 188 233 static ssize_t dpms_show(struct device *device, ··· 384 339 drm_get_dvi_i_select_name((int)subconnector)); 385 340 } 386 341 387 - static DEVICE_ATTR_RO(status); 342 + static DEVICE_ATTR_RW(status); 388 343 static DEVICE_ATTR_RO(enabled); 389 344 static DEVICE_ATTR_RO(dpms); 390 345 static DEVICE_ATTR_RO(modes);
+1 -1
drivers/gpu/drm/i2c/adv7511.c
··· 573 573 * goes low the adv7511 is reset and the outputs are disabled 574 574 * which might cause the monitor to go to standby again. To 575 575 * avoid this we ignore the HDP pin for the first few seconds 576 - * after enabeling the output. 576 + * after enabling the output. 577 577 */ 578 578 regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2, 579 579 ADV7511_REG_POWER2_HDP_SRC_MASK,
+4 -20
drivers/gpu/drm/i915/intel_atomic_plane.c
··· 203 203 struct drm_property *property, 204 204 uint64_t *val) 205 205 { 206 - struct drm_mode_config *config = &plane->dev->mode_config; 207 - 208 - if (property == config->rotation_property) { 209 - *val = state->rotation; 210 - } else { 211 - DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name); 212 - return -EINVAL; 213 - } 214 - 215 - return 0; 206 + DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name); 207 + return -EINVAL; 216 208 } 217 209 218 210 /** ··· 225 233 struct drm_property *property, 226 234 uint64_t val) 227 235 { 228 - struct drm_mode_config *config = &plane->dev->mode_config; 229 - 230 - if (property == config->rotation_property) { 231 - state->rotation = val; 232 - } else { 233 - DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name); 234 - return -EINVAL; 235 - } 236 - 237 - return 0; 236 + DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name); 237 + return -EINVAL; 238 238 }
+4
include/drm/drm_crtc.h
··· 830 830 * @possible_crtcs: pipes this plane can be bound to 831 831 * @format_types: array of formats supported by this plane 832 832 * @format_count: number of formats supported 833 + * @format_default: driver hasn't supplied supported formats for the plane 833 834 * @crtc: currently bound CRTC 834 835 * @fb: currently bound fb 835 836 * @old_fb: Temporary tracking of the old fb while a modeset is ongoing. Used by ··· 851 850 uint32_t possible_crtcs; 852 851 uint32_t *format_types; 853 852 uint32_t format_count; 853 + bool format_default; 854 854 855 855 struct drm_crtc *crtc; 856 856 struct drm_framebuffer *fb; ··· 1265 1263 extern void drm_plane_cleanup(struct drm_plane *plane); 1266 1264 extern unsigned int drm_plane_index(struct drm_plane *plane); 1267 1265 extern void drm_plane_force_disable(struct drm_plane *plane); 1266 + extern int drm_plane_check_pixel_format(const struct drm_plane *plane, 1267 + u32 format); 1268 1268 extern void drm_crtc_get_hv_timing(const struct drm_display_mode *mode, 1269 1269 int *hdisplay, int *vdisplay); 1270 1270 extern int drm_crtc_check_viewport(const struct drm_crtc *crtc,
+162 -9
include/drm/drm_dp_helper.h
··· 92 92 # define DP_MSA_TIMING_PAR_IGNORED (1 << 6) /* eDP */ 93 93 # define DP_OUI_SUPPORT (1 << 7) 94 94 95 - #define DP_SUPPORTED_LINK_RATES 0x010 /*eDP 1.4*/ 96 - #define DP_MAX_SUPPORTED_RATES 0x8 95 + #define DP_RECEIVE_PORT_0_CAP_0 0x008 96 + # define DP_LOCAL_EDID_PRESENT (1 << 1) 97 + # define DP_ASSOCIATED_TO_PRECEDING_PORT (1 << 2) 98 + 99 + #define DP_RECEIVE_PORT_0_BUFFER_SIZE 0x009 100 + 101 + #define DP_RECEIVE_PORT_1_CAP_0 0x00a 102 + #define DP_RECEIVE_PORT_1_BUFFER_SIZE 0x00b 97 103 98 104 #define DP_I2C_SPEED_CAP 0x00c /* DPI */ 99 105 # define DP_I2C_SPEED_1K 0x01 ··· 110 104 # define DP_I2C_SPEED_1M 0x20 111 105 112 106 #define DP_EDP_CONFIGURATION_CAP 0x00d /* XXX 1.2? */ 107 + # define DP_ALTERNATE_SCRAMBLER_RESET_CAP (1 << 0) 108 + # define DP_FRAMING_CHANGE_CAP (1 << 1) 113 109 # define DP_DPCD_DISPLAY_CONTROL_CAPABLE (1 << 3) /* edp v1.2 or higher */ 110 + 114 111 #define DP_TRAINING_AUX_RD_INTERVAL 0x00e /* XXX 1.2? */ 112 + 113 + #define DP_ADAPTER_CAP 0x00f /* 1.2 */ 114 + # define DP_FORCE_LOAD_SENSE_CAP (1 << 0) 115 + # define DP_ALTERNATE_I2C_PATTERN_CAP (1 << 1) 116 + 117 + #define DP_SUPPORTED_LINK_RATES 0x010 /* eDP 1.4 */ 118 + # define DP_MAX_SUPPORTED_RATES 8 /* 16-bit little-endian */ 115 119 116 120 /* Multiple stream transport */ 117 121 #define DP_FAUX_CAP 0x020 /* 1.2 */ ··· 130 114 #define DP_MSTM_CAP 0x021 /* 1.2 */ 131 115 # define DP_MST_CAP (1 << 0) 132 116 117 + #define DP_NUMBER_OF_AUDIO_ENDPOINTS 0x022 /* 1.2 */ 118 + 119 + /* AV_SYNC_DATA_BLOCK 1.2 */ 120 + #define DP_AV_GRANULARITY 0x023 121 + # define DP_AG_FACTOR_MASK (0xf << 0) 122 + # define DP_AG_FACTOR_3MS (0 << 0) 123 + # define DP_AG_FACTOR_2MS (1 << 0) 124 + # define DP_AG_FACTOR_1MS (2 << 0) 125 + # define DP_AG_FACTOR_500US (3 << 0) 126 + # define DP_AG_FACTOR_200US (4 << 0) 127 + # define DP_AG_FACTOR_100US (5 << 0) 128 + # define DP_AG_FACTOR_10US (6 << 0) 129 + # define DP_AG_FACTOR_1US (7 << 0) 130 + # define DP_VG_FACTOR_MASK (0xf << 4) 131 + # define DP_VG_FACTOR_3MS (0 << 4) 132 + # define DP_VG_FACTOR_2MS (1 << 4) 133 + # define DP_VG_FACTOR_1MS (2 << 4) 134 + # define DP_VG_FACTOR_500US (3 << 4) 135 + # define DP_VG_FACTOR_200US (4 << 4) 136 + # define DP_VG_FACTOR_100US (5 << 4) 137 + 138 + #define DP_AUD_DEC_LAT0 0x024 139 + #define DP_AUD_DEC_LAT1 0x025 140 + 141 + #define DP_AUD_PP_LAT0 0x026 142 + #define DP_AUD_PP_LAT1 0x027 143 + 144 + #define DP_VID_INTER_LAT 0x028 145 + 146 + #define DP_VID_PROG_LAT 0x029 147 + 148 + #define DP_REP_LAT 0x02a 149 + 150 + #define DP_AUD_DEL_INS0 0x02b 151 + #define DP_AUD_DEL_INS1 0x02c 152 + #define DP_AUD_DEL_INS2 0x02d 153 + /* End of AV_SYNC_DATA_BLOCK */ 154 + 155 + #define DP_RECEIVER_ALPM_CAP 0x02e /* eDP 1.4 */ 156 + # define DP_ALPM_CAP (1 << 0) 157 + 158 + #define DP_SINK_DEVICE_AUX_FRAME_SYNC_CAP 0x02f /* eDP 1.4 */ 159 + # define DP_AUX_FRAME_SYNC_CAP (1 << 0) 160 + 133 161 #define DP_GUID 0x030 /* 1.2 */ 134 162 135 163 #define DP_PSR_SUPPORT 0x070 /* XXX 1.2? */ 136 164 # define DP_PSR_IS_SUPPORTED 1 165 + # define DP_PSR2_IS_SUPPORTED 2 /* eDP 1.4 */ 166 + 137 167 #define DP_PSR_CAPS 0x071 /* XXX 1.2? */ 138 168 # define DP_PSR_NO_TRAIN_ON_EXIT 1 139 169 # define DP_PSR_SETUP_TIME_330 (0 << 1) ··· 219 157 220 158 /* link configuration */ 221 159 #define DP_LINK_BW_SET 0x100 160 + # define DP_LINK_RATE_TABLE 0x00 /* eDP 1.4 */ 222 161 # define DP_LINK_BW_1_62 0x06 223 162 # define DP_LINK_BW_2_7 0x0a 224 163 # define DP_LINK_BW_5_4 0x14 /* 1.2 */ ··· 235 172 # define DP_TRAINING_PATTERN_3 3 /* 1.2 */ 236 173 # define DP_TRAINING_PATTERN_MASK 0x3 237 174 238 - # define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2) 239 - # define DP_LINK_QUAL_PATTERN_D10_2 (1 << 2) 240 - # define DP_LINK_QUAL_PATTERN_ERROR_RATE (2 << 2) 241 - # define DP_LINK_QUAL_PATTERN_PRBS7 (3 << 2) 242 - # define DP_LINK_QUAL_PATTERN_MASK (3 << 2) 175 + /* DPCD 1.1 only. For DPCD >= 1.2 see per-lane DP_LINK_QUAL_LANEn_SET */ 176 + # define DP_LINK_QUAL_PATTERN_11_DISABLE (0 << 2) 177 + # define DP_LINK_QUAL_PATTERN_11_D10_2 (1 << 2) 178 + # define DP_LINK_QUAL_PATTERN_11_ERROR_RATE (2 << 2) 179 + # define DP_LINK_QUAL_PATTERN_11_PRBS7 (3 << 2) 180 + # define DP_LINK_QUAL_PATTERN_11_MASK (3 << 2) 243 181 244 182 # define DP_RECOVERED_CLOCK_OUT_EN (1 << 4) 245 183 # define DP_LINK_SCRAMBLING_DISABLE (1 << 5) ··· 283 219 /* bitmask as for DP_I2C_SPEED_CAP */ 284 220 285 221 #define DP_EDP_CONFIGURATION_SET 0x10a /* XXX 1.2? */ 222 + # define DP_ALTERNATE_SCRAMBLER_RESET_ENABLE (1 << 0) 223 + # define DP_FRAMING_CHANGE_ENABLE (1 << 1) 224 + # define DP_PANEL_SELF_TEST_ENABLE (1 << 7) 225 + 226 + #define DP_LINK_QUAL_LANE0_SET 0x10b /* DPCD >= 1.2 */ 227 + #define DP_LINK_QUAL_LANE1_SET 0x10c 228 + #define DP_LINK_QUAL_LANE2_SET 0x10d 229 + #define DP_LINK_QUAL_LANE3_SET 0x10e 230 + # define DP_LINK_QUAL_PATTERN_DISABLE 0 231 + # define DP_LINK_QUAL_PATTERN_D10_2 1 232 + # define DP_LINK_QUAL_PATTERN_ERROR_RATE 2 233 + # define DP_LINK_QUAL_PATTERN_PRBS7 3 234 + # define DP_LINK_QUAL_PATTERN_80BIT_CUSTOM 4 235 + # define DP_LINK_QUAL_PATTERN_HBR2_EYE 5 236 + # define DP_LINK_QUAL_PATTERN_MASK 7 237 + 238 + #define DP_TRAINING_LANE0_1_SET2 0x10f 239 + #define DP_TRAINING_LANE2_3_SET2 0x110 240 + # define DP_LANE02_POST_CURSOR2_SET_MASK (3 << 0) 241 + # define DP_LANE02_MAX_POST_CURSOR2_REACHED (1 << 2) 242 + # define DP_LANE13_POST_CURSOR2_SET_MASK (3 << 4) 243 + # define DP_LANE13_MAX_POST_CURSOR2_REACHED (1 << 6) 286 244 287 245 #define DP_MSTM_CTRL 0x111 /* 1.2 */ 288 246 # define DP_MST_EN (1 << 0) 289 247 # define DP_UP_REQ_EN (1 << 1) 290 248 # define DP_UPSTREAM_IS_SRC (1 << 2) 291 249 292 - #define DP_LINK_RATE_SET 0x115 250 + #define DP_AUDIO_DELAY0 0x112 /* 1.2 */ 251 + #define DP_AUDIO_DELAY1 0x113 252 + #define DP_AUDIO_DELAY2 0x114 253 + 254 + #define DP_LINK_RATE_SET 0x115 /* eDP 1.4 */ 255 + # define DP_LINK_RATE_SET_SHIFT 0 256 + # define DP_LINK_RATE_SET_MASK (7 << 0) 257 + 258 + #define DP_RECEIVER_ALPM_CONFIG 0x116 /* eDP 1.4 */ 259 + # define DP_ALPM_ENABLE (1 << 0) 260 + # define DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE (1 << 1) 261 + 262 + #define DP_SINK_DEVICE_AUX_FRAME_SYNC_CONF 0x117 /* eDP 1.4 */ 263 + # define DP_AUX_FRAME_SYNC_ENABLE (1 << 0) 264 + # define DP_IRQ_HPD_ENABLE (1 << 1) 265 + 266 + #define DP_UPSTREAM_DEVICE_DP_PWR_NEED 0x118 /* 1.2 */ 267 + # define DP_PWR_NOT_NEEDED (1 << 0) 268 + 269 + #define DP_AUX_FRAME_SYNC_VALUE 0x15c /* eDP 1.4 */ 270 + # define DP_AUX_FRAME_SYNC_VALID (1 << 0) 293 271 294 272 #define DP_PSR_EN_CFG 0x170 /* XXX 1.2? */ 295 273 # define DP_PSR_ENABLE (1 << 0) 296 274 # define DP_PSR_MAIN_LINK_ACTIVE (1 << 1) 297 275 # define DP_PSR_CRC_VERIFICATION (1 << 2) 298 276 # define DP_PSR_FRAME_CAPTURE (1 << 3) 277 + # define DP_PSR_SELECTIVE_UPDATE (1 << 4) 278 + # define DP_PSR_IRQ_HPD_WITH_CRC_ERRORS (1 << 5) 299 279 300 280 #define DP_ADAPTER_CTRL 0x1a0 301 281 # define DP_ADAPTER_CTRL_FORCE_LOAD_SENSE (1 << 0) ··· 446 338 # define DP_SET_POWER_D3 0x2 447 339 # define DP_SET_POWER_MASK 0x3 448 340 449 - #define DP_EDP_DPCD_REV 0x700 341 + #define DP_EDP_DPCD_REV 0x700 /* eDP 1.2 */ 342 + # define DP_EDP_11 0x00 343 + # define DP_EDP_12 0x01 344 + # define DP_EDP_13 0x02 345 + # define DP_EDP_14 0x03 346 + 347 + #define DP_EDP_GENERAL_CAP_1 0x701 348 + 349 + #define DP_EDP_BACKLIGHT_ADJUSTMENT_CAP 0x702 350 + 351 + #define DP_EDP_GENERAL_CAP_2 0x703 352 + 353 + #define DP_EDP_GENERAL_CAP_3 0x704 /* eDP 1.4 */ 354 + 355 + #define DP_EDP_DISPLAY_CONTROL_REGISTER 0x720 356 + 357 + #define DP_EDP_BACKLIGHT_MODE_SET_REGISTER 0x721 358 + 359 + #define DP_EDP_BACKLIGHT_BRIGHTNESS_MSB 0x722 360 + #define DP_EDP_BACKLIGHT_BRIGHTNESS_LSB 0x723 361 + 362 + #define DP_EDP_PWMGEN_BIT_COUNT 0x724 363 + #define DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN 0x725 364 + #define DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX 0x726 365 + 366 + #define DP_EDP_BACKLIGHT_CONTROL_STATUS 0x727 367 + 368 + #define DP_EDP_BACKLIGHT_FREQ_SET 0x728 369 + 370 + #define DP_EDP_BACKLIGHT_FREQ_CAP_MIN_MSB 0x72a 371 + #define DP_EDP_BACKLIGHT_FREQ_CAP_MIN_MID 0x72b 372 + #define DP_EDP_BACKLIGHT_FREQ_CAP_MIN_LSB 0x72c 373 + 374 + #define DP_EDP_BACKLIGHT_FREQ_CAP_MAX_MSB 0x72d 375 + #define DP_EDP_BACKLIGHT_FREQ_CAP_MAX_MID 0x72e 376 + #define DP_EDP_BACKLIGHT_FREQ_CAP_MAX_LSB 0x72f 377 + 378 + #define DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET 0x732 379 + #define DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET 0x733 380 + 381 + #define DP_EDP_REGIONAL_BACKLIGHT_BASE 0x740 /* eDP 1.4 */ 382 + #define DP_EDP_REGIONAL_BACKLIGHT_0 0x741 /* eDP 1.4 */ 450 383 451 384 #define DP_SIDEBAND_MSG_DOWN_REQ_BASE 0x1000 /* 1.2 MST */ 452 385 #define DP_SIDEBAND_MSG_UP_REP_BASE 0x1200 /* 1.2 MST */ ··· 507 358 #define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */ 508 359 # define DP_PSR_LINK_CRC_ERROR (1 << 0) 509 360 # define DP_PSR_RFB_STORAGE_ERROR (1 << 1) 361 + # define DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR (1 << 2) /* eDP 1.4 */ 510 362 511 363 #define DP_PSR_ESI 0x2007 /* XXX 1.2? */ 512 364 # define DP_PSR_CAPS_CHANGE (1 << 0) ··· 520 370 # define DP_PSR_SINK_ACTIVE_RESYNC 4 521 371 # define DP_PSR_SINK_INTERNAL_ERROR 7 522 372 # define DP_PSR_SINK_STATE_MASK 0x07 373 + 374 + #define DP_RECEIVER_ALPM_STATUS 0x200b /* eDP 1.4 */ 375 + # define DP_ALPM_LOCK_TIMEOUT_ERROR (1 << 0) 523 376 524 377 /* DP 1.2 Sideband message defines */ 525 378 /* peer device type - DP 1.2a Table 2-92 */
-4
include/drm/drm_plane_helper.h
··· 100 100 extern int drm_primary_helper_disable(struct drm_plane *plane); 101 101 extern void drm_primary_helper_destroy(struct drm_plane *plane); 102 102 extern const struct drm_plane_funcs drm_primary_helper_funcs; 103 - extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, 104 - const uint32_t *formats, 105 - int num_formats); 106 - 107 103 108 104 int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, 109 105 struct drm_framebuffer *fb,