diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-08-09 21:43:02 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2018-08-09 21:43:02 -0400 |
| commit | 557ce95051c8eff67af48612ab350d8408aa0541 (patch) | |
| tree | 701b570e51724a90595b55846290f0298429c085 | |
| parent | 8511b7da18694491afb50a5cf1515c29a999c7a4 (diff) | |
| parent | b045d3af7d1f443dd5209a096568e0ce983127e9 (diff) | |
Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next
More fixes for 4.19:
- Fixes for scheduler
- Fix for SR-IOV
- Fixes for display
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180809200052.2777-1-alexander.deucher@amd.com
21 files changed, 194 insertions, 78 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index e839470880d7..1e66dfd0e39c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
| @@ -3108,7 +3108,7 @@ static int amdgpu_device_handle_vram_lost(struct amdgpu_device *adev) | |||
| 3108 | long tmo; | 3108 | long tmo; |
| 3109 | 3109 | ||
| 3110 | if (amdgpu_sriov_runtime(adev)) | 3110 | if (amdgpu_sriov_runtime(adev)) |
| 3111 | tmo = msecs_to_jiffies(amdgpu_lockup_timeout); | 3111 | tmo = msecs_to_jiffies(8000); |
| 3112 | else | 3112 | else |
| 3113 | tmo = msecs_to_jiffies(100); | 3113 | tmo = msecs_to_jiffies(100); |
| 3114 | 3114 | ||
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 45e062022461..34f34823bab5 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
| @@ -1320,7 +1320,12 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd) | |||
| 1320 | 1320 | ||
| 1321 | static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) | 1321 | static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) |
| 1322 | { | 1322 | { |
| 1323 | return bd->props.brightness; | 1323 | struct amdgpu_display_manager *dm = bl_get_data(bd); |
| 1324 | int ret = dc_link_get_backlight_level(dm->backlight_link); | ||
| 1325 | |||
| 1326 | if (ret == DC_ERROR_UNEXPECTED) | ||
| 1327 | return bd->props.brightness; | ||
| 1328 | return ret; | ||
| 1324 | } | 1329 | } |
| 1325 | 1330 | ||
| 1326 | static const struct backlight_ops amdgpu_dm_backlight_ops = { | 1331 | static const struct backlight_ops amdgpu_dm_backlight_ops = { |
| @@ -1335,6 +1340,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm) | |||
| 1335 | struct backlight_properties props = { 0 }; | 1340 | struct backlight_properties props = { 0 }; |
| 1336 | 1341 | ||
| 1337 | props.max_brightness = AMDGPU_MAX_BL_LEVEL; | 1342 | props.max_brightness = AMDGPU_MAX_BL_LEVEL; |
| 1343 | props.brightness = AMDGPU_MAX_BL_LEVEL; | ||
| 1338 | props.type = BACKLIGHT_RAW; | 1344 | props.type = BACKLIGHT_RAW; |
| 1339 | 1345 | ||
| 1340 | snprintf(bl_name, sizeof(bl_name), "amdgpu_bl%d", | 1346 | snprintf(bl_name, sizeof(bl_name), "amdgpu_bl%d", |
| @@ -2109,13 +2115,8 @@ convert_color_depth_from_display_info(const struct drm_connector *connector) | |||
| 2109 | static enum dc_aspect_ratio | 2115 | static enum dc_aspect_ratio |
| 2110 | get_aspect_ratio(const struct drm_display_mode *mode_in) | 2116 | get_aspect_ratio(const struct drm_display_mode *mode_in) |
| 2111 | { | 2117 | { |
| 2112 | int32_t width = mode_in->crtc_hdisplay * 9; | 2118 | /* 1-1 mapping, since both enums follow the HDMI spec. */ |
| 2113 | int32_t height = mode_in->crtc_vdisplay * 16; | 2119 | return (enum dc_aspect_ratio) mode_in->picture_aspect_ratio; |
| 2114 | |||
| 2115 | if ((width - height) < 10 && (width - height) > -10) | ||
| 2116 | return ASPECT_RATIO_16_9; | ||
| 2117 | else | ||
| 2118 | return ASPECT_RATIO_4_3; | ||
| 2119 | } | 2120 | } |
| 2120 | 2121 | ||
| 2121 | static enum dc_color_space | 2122 | static enum dc_color_space |
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index b329393307e5..326f6fb7e0bc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | |||
| @@ -231,18 +231,21 @@ void amdgpu_dm_set_ctm(struct dm_crtc_state *crtc) | |||
| 231 | * preparation for hardware commit. If no lut is specified by user, we default | 231 | * preparation for hardware commit. If no lut is specified by user, we default |
| 232 | * to SRGB degamma. | 232 | * to SRGB degamma. |
| 233 | * | 233 | * |
| 234 | * Currently, we only support degamma bypass, or preprogrammed SRGB degamma. | 234 | * We support degamma bypass, predefined SRGB, and custom degamma |
| 235 | * Programmable degamma is not supported, and an attempt to do so will return | ||
| 236 | * -EINVAL. | ||
| 237 | * | 235 | * |
| 238 | * RETURNS: | 236 | * RETURNS: |
| 239 | * 0 on success, -EINVAL if custom degamma curve is given. | 237 | * 0 on success |
| 238 | * -EINVAL if crtc_state has a degamma_lut of invalid size | ||
| 239 | * -ENOMEM if gamma allocation fails | ||
| 240 | */ | 240 | */ |
| 241 | int amdgpu_dm_set_degamma_lut(struct drm_crtc_state *crtc_state, | 241 | int amdgpu_dm_set_degamma_lut(struct drm_crtc_state *crtc_state, |
| 242 | struct dc_plane_state *dc_plane_state) | 242 | struct dc_plane_state *dc_plane_state) |
| 243 | { | 243 | { |
| 244 | struct drm_property_blob *blob = crtc_state->degamma_lut; | 244 | struct drm_property_blob *blob = crtc_state->degamma_lut; |
| 245 | struct drm_color_lut *lut; | 245 | struct drm_color_lut *lut; |
| 246 | uint32_t lut_size; | ||
| 247 | struct dc_gamma *gamma; | ||
| 248 | bool ret; | ||
| 246 | 249 | ||
| 247 | if (!blob) { | 250 | if (!blob) { |
| 248 | /* Default to SRGB */ | 251 | /* Default to SRGB */ |
| @@ -258,11 +261,30 @@ int amdgpu_dm_set_degamma_lut(struct drm_crtc_state *crtc_state, | |||
| 258 | return 0; | 261 | return 0; |
| 259 | } | 262 | } |
| 260 | 263 | ||
| 261 | /* Otherwise, assume SRGB, since programmable degamma is not | 264 | gamma = dc_create_gamma(); |
| 262 | * supported. | 265 | if (!gamma) |
| 263 | */ | 266 | return -ENOMEM; |
| 264 | dc_plane_state->in_transfer_func->type = TF_TYPE_PREDEFINED; | 267 | |
| 265 | dc_plane_state->in_transfer_func->tf = TRANSFER_FUNCTION_SRGB; | 268 | lut_size = blob->length / sizeof(struct drm_color_lut); |
| 266 | return -EINVAL; | 269 | gamma->num_entries = lut_size; |
| 270 | if (gamma->num_entries == MAX_COLOR_LUT_ENTRIES) | ||
| 271 | gamma->type = GAMMA_CUSTOM; | ||
| 272 | else { | ||
| 273 | dc_gamma_release(&gamma); | ||
| 274 | return -EINVAL; | ||
| 275 | } | ||
| 276 | |||
| 277 | __drm_lut_to_dc_gamma(lut, gamma, false); | ||
| 278 | |||
| 279 | dc_plane_state->in_transfer_func->type = TF_TYPE_DISTRIBUTED_POINTS; | ||
| 280 | ret = mod_color_calculate_degamma_params(dc_plane_state->in_transfer_func, gamma, true); | ||
| 281 | dc_gamma_release(&gamma); | ||
| 282 | if (!ret) { | ||
| 283 | dc_plane_state->in_transfer_func->type = TF_TYPE_BYPASS; | ||
| 284 | DRM_ERROR("Out of memory when calculating degamma params\n"); | ||
| 285 | return -ENOMEM; | ||
| 286 | } | ||
| 287 | |||
| 288 | return 0; | ||
| 267 | } | 289 | } |
| 268 | 290 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table.c b/drivers/gpu/drm/amd/display/dc/bios/command_table.c index 651e1fd4622f..a558bfaa0c46 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/command_table.c +++ b/drivers/gpu/drm/amd/display/dc/bios/command_table.c | |||
| @@ -808,6 +808,24 @@ static enum bp_result transmitter_control_v1_5( | |||
| 808 | * (=1: 8bpp, =1.25: 10bpp, =1.5:12bpp, =2: 16bpp) | 808 | * (=1: 8bpp, =1.25: 10bpp, =1.5:12bpp, =2: 16bpp) |
| 809 | * LVDS mode: usPixelClock = pixel clock | 809 | * LVDS mode: usPixelClock = pixel clock |
| 810 | */ | 810 | */ |
| 811 | if (cntl->signal == SIGNAL_TYPE_HDMI_TYPE_A) { | ||
| 812 | switch (cntl->color_depth) { | ||
| 813 | case COLOR_DEPTH_101010: | ||
| 814 | params.usSymClock = | ||
| 815 | cpu_to_le16((le16_to_cpu(params.usSymClock) * 30) / 24); | ||
| 816 | break; | ||
| 817 | case COLOR_DEPTH_121212: | ||
| 818 | params.usSymClock = | ||
| 819 | cpu_to_le16((le16_to_cpu(params.usSymClock) * 36) / 24); | ||
| 820 | break; | ||
| 821 | case COLOR_DEPTH_161616: | ||
| 822 | params.usSymClock = | ||
| 823 | cpu_to_le16((le16_to_cpu(params.usSymClock) * 48) / 24); | ||
| 824 | break; | ||
| 825 | default: | ||
