History

Merge branch 'drm-fixes-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

Misc radeon and amdgpu bug fixes for 4.6. * 'drm-fixes-4.6' of git://people.freedesktop.org/~agd5f/linux: amdgpu/uvd: add uvd fw version for amdgpu drm/amdgpu: forbid mapping of userptr bo through radeon device file drm/radeon: forbid mapping of userptr bo through radeon device file drm/amdgpu: bump the afmt limit for CZ, ST, Polaris drm/amdgpu: use defines for CRTCs and AMFT blocks drm/radeon: print a message if ATPX dGPU power control is missing Revert "drm/radeon: disable runtime pm on PX laptops without dGPU power control" drm/amdgpu/acp: fix resume on CZ systems with AZ audio drm/radeon: add a quirk for a XFX R9 270X drm/radeon: print pci revision as well as pci ids on driver load drm/amdgpu: when suspending, if uvd/vce was running. need to cancel delay work. drm/radeon: fix initial connector audio value

Dave Airlie committed 10 years ago

Commit 18cdfe72 parents 221004c 562e26812 files · +37 −19Browse files

Unified · Split

12 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 −0
  2. drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +4 −0
  3. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 −1
  4. drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +3 −3
  5. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 −0
  6. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +5 −0
  7. drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1 −0
  8. drivers/gpu/drm/radeon/radeon_atpx_handler.c +7 −4
  9. drivers/gpu/drm/radeon/radeon_connectors.c +6 −1
  10. drivers/gpu/drm/radeon/radeon_device.c +4 −10
  11. drivers/gpu/drm/radeon/radeon_ttm.c +2 −0
  12. drivers/gpu/drm/radeon/si_dpm.c +1 −0
drivers/gpu/drm/amd/amdgpu/amdgpu.h+1−0
@@ -1591,6 +1591,7 @@ struct amdgpu_uvd { · 1590 unmodified lines
15911591 struct amdgpu_bo *vcpu_bo;
15921592 void *cpu_addr;
15931593 uint64_t gpu_addr;
1594+ unsigned fw_version;
15941595 void *saved_bo;
15951596 atomic_t handles[AMDGPU_MAX_UVD_HANDLES];
15961597 struct drm_file *filp[AMDGPU_MAX_UVD_HANDLES];
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c+4−0
@@ -425,6 +425,10 @@ static int acp_resume(void *handle) · 424 unmodified lines
425425 struct acp_pm_domain *apd;
426426 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
427427
428+ /* return early if no ACP */
429+ if (!adev->acp.acp_genpd)
430+ return 0;
431+
428432 /* SMU block will power on ACP irrespective of ACP runtime status.
429433 * Power off explicitly based on genpd ACP runtime status so that ACP
430434 * hw and ACP-genpd status are in sync.
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+1−1
@@ -303,7 +303,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 302 unmodified lines
303303 fw_info.feature = adev->vce.fb_version;
304304 break;
305305 case AMDGPU_INFO_FW_UVD:
306− fw_info.ver = 0;
306+ fw_info.ver = adev->uvd.fw_version;
307307 fw_info.feature = 0;
308308 break;
309309 case AMDGPU_INFO_FW_GMC:
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+3−3
@@ -53,7 +53,7 @@ struct amdgpu_hpd; · 52 unmodified lines
5353
5454 #define AMDGPU_MAX_HPD_PINS 6
5555 #define AMDGPU_MAX_CRTCS 6
56−#define AMDGPU_MAX_AFMT_BLOCKS 7
56+#define AMDGPU_MAX_AFMT_BLOCKS 9
5757
5858 enum amdgpu_rmx_type {
5959 RMX_OFF,
@@ -309,8 +309,8 @@ struct amdgpu_mode_info { · 249 unmodified lines
309309 struct atom_context *atom_context;
310310 struct card_info *atom_card_info;
311311 bool mode_config_initialized;
312− struct amdgpu_crtc *crtcs[6];
313− struct amdgpu_afmt *afmt[7];
312+ struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS];
313+ struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS];
314314 /* DVI-I properties */
315315 struct drm_property *coherent_mode_property;
316316 /* DAC enable load detect */
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+2−0
@@ -223,6 +223,8 @@ static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp) · 222 unmodified lines
223223 {
224224 struct amdgpu_bo *rbo = container_of(bo, struct amdgpu_bo, tbo);
225225
226+ if (amdgpu_ttm_tt_get_usermm(bo->ttm))
227+ return -EPERM;
226228 return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp);
227229 }
228230
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c+5−0
@@ -158,6 +158,9 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) · 157 unmodified lines
158158 DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n",
159159 version_major, version_minor, family_id);
160160
161+ adev->uvd.fw_version = ((version_major << 24) | (version_minor << 16) |
162+ (family_id << 8));
163+
161164 bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8)
162165 + AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE;
163166 r = amdgpu_bo_create(adev, bo_size, PAGE_SIZE, true,
@@ -255,6 +258,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) · 91 unmodified lines
255258 if (i == AMDGPU_MAX_UVD_HANDLES)
256259 return 0;
257260
261+ cancel_delayed_work_sync(&adev->uvd.idle_work);
262+
258263 size = amdgpu_bo_size(adev->uvd.vcpu_bo);
259264 ptr = adev->uvd.cpu_addr;
260265
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c+1−0
@@ -234,6 +234,7 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev) · 233 unmodified lines
234234 if (i == AMDGPU_MAX_VCE_HANDLES)
235235 return 0;
236236
237+ cancel_delayed_work_sync(&adev->vce.idle_work);
237238 /* TODO: suspending running encoding sessions isn't supported */
238239 return -EINVAL;
239240 }
drivers/gpu/drm/radeon/radeon_atpx_handler.c+7−4
@@ -62,10 +62,6 @@ bool radeon_has_atpx(void) { · 61 unmodified lines
6262 return radeon_atpx_priv.atpx_detected;
6363 }
6464
65−bool radeon_has_atpx_dgpu_power_cntl(void) {
66− return radeon_atpx_priv.atpx.functions.power_cntl;
67−}
68−
6965 /**
7066 * radeon_atpx_call - call an ATPX method
7167 *
@@ -145,6 +141,13 @@ static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas · 73 unmodified lines
145141 */
146142 static int radeon_atpx_validate(struct radeon_atpx *atpx)
147143 {
144+ /* make sure required functions are enabled */
145+ /* dGPU power control is required */
146+ if (atpx->functions.power_cntl == false) {
147+ printk("ATPX dGPU power cntl not present, forcing\n");
148+ atpx->functions.power_cntl = true;
149+ }
150+
148151 if (atpx->functions.px_params) {
149152 union acpi_object *info;
150153 struct atpx_px_params output;
drivers/gpu/drm/radeon/radeon_connectors.c+6−1
@@ -2002,10 +2002,12 @@ radeon_add_atom_connector(struct drm_device *dev, · 2001 unmodified lines
20022002 rdev->mode_info.dither_property,
20032003 RADEON_FMT_DITHER_DISABLE);
20042004
2005− if (radeon_audio != 0)
2005+ if (radeon_audio != 0) {
20062006 drm_object_attach_property(&radeon_connector->base.base,
20072007 rdev->mode_info.audio_property,
20082008 RADEON_AUDIO_AUTO);
2009+ radeon_connector->audio = RADEON_AUDIO_AUTO;
2010+ }
20092011 if (ASIC_IS_DCE5(rdev))
20102012 drm_object_attach_property(&radeon_connector->base.base,
20112013 rdev->mode_info.output_csc_property,
@@ -2130,6 +2132,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 118 unmodified lines
21302132 drm_object_attach_property(&radeon_connector->base.base,
21312133 rdev->mode_info.audio_property,
21322134 RADEON_AUDIO_AUTO);
2135+ radeon_connector->audio = RADEON_AUDIO_AUTO;
21332136 }
21342137 if (connector_type == DRM_MODE_CONNECTOR_DVII) {
21352138 radeon_connector->dac_load_detect = true;
@@ -2185,6 +2188,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 49 unmodified lines
21852188 drm_object_attach_property(&radeon_connector->base.base,
21862189 rdev->mode_info.audio_property,
21872190 RADEON_AUDIO_AUTO);
2191+ radeon_connector->audio = RADEON_AUDIO_AUTO;
21882192 }
21892193 if (ASIC_IS_DCE5(rdev))
21902194 drm_object_attach_property(&radeon_connector->base.base,
@@ -2237,6 +2241,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 46 unmodified lines
22372241 drm_object_attach_property(&radeon_connector->base.base,
22382242 rdev->mode_info.audio_property,
22392243 RADEON_AUDIO_AUTO);
2244+ radeon_connector->audio = RADEON_AUDIO_AUTO;
22402245 }
22412246 if (ASIC_IS_DCE5(rdev))
22422247 drm_object_attach_property(&radeon_connector->base.base,
drivers/gpu/drm/radeon/radeon_device.c+4−10
@@ -103,12 +103,6 @@ static const char radeon_family_name[][16] = { · 102 unmodified lines
103103 "LAST",
104104 };
105105
106−#if defined(CONFIG_VGA_SWITCHEROO)
107−bool radeon_has_atpx_dgpu_power_cntl(void);
108−#else
109−static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
110−#endif
111−
112106 #define RADEON_PX_QUIRK_DISABLE_PX (1 << 0)
113107 #define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
114108
@@ -1305,9 +1299,9 @@ int radeon_device_init(struct radeon_device *rdev, · 1190 unmodified lines
13051299 }
13061300 rdev->fence_context = fence_context_alloc(RADEON_NUM_RINGS);
13071301
1308− DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X 0x%04X:0x%04X).\n",
1309− radeon_family_name[rdev->family], pdev->vendor, pdev->device,
1310− pdev->subsystem_vendor, pdev->subsystem_device);
1302+ DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X).\n",
1303+ radeon_family_name[rdev->family], pdev->vendor, pdev->device,
1304+ pdev->subsystem_vendor, pdev->subsystem_device, pdev->revision);
13111305
13121306 /* mutex initialization are all done here so we
13131307 * can recall function without having locking issues */
@@ -1439,7 +1433,7 @@ int radeon_device_init(struct radeon_device *rdev, · 125 unmodified lines
14391433 * ignore it */
14401434 vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode);
14411435
1442− if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl())
1436+ if (rdev->flags & RADEON_IS_PX)
14431437 runtime = true;
14441438 vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
14451439 if (runtime)
drivers/gpu/drm/radeon/radeon_ttm.c+2−0
@@ -235,6 +235,8 @@ static int radeon_verify_access(struct ttm_buffer_object *bo, struct file *filp) · 234 unmodified lines
235235 {
236236 struct radeon_bo *rbo = container_of(bo, struct radeon_bo, tbo);
237237
238+ if (radeon_ttm_tt_has_userptr(bo->ttm))
239+ return -EPERM;
238240 return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp);
239241 }
240242
drivers/gpu/drm/radeon/si_dpm.c+1−0
@@ -2931,6 +2931,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { · 2930 unmodified lines
29312931 { PCI_VENDOR_ID_ATI, 0x6811, 0x1462, 0x2015, 0, 120000 },
29322932 { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 },
29332933 { PCI_VENDOR_ID_ATI, 0x6811, 0x148c, 0x2015, 0, 120000 },
2934+ { PCI_VENDOR_ID_ATI, 0x6810, 0x1682, 0x9275, 0, 120000 },
29342935 { 0, 0, 0, 0 },
29352936 };
29362937