Subversion Repositories Kolibri OS

Rev

Rev 6937 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6937 Rev 7144
Line 163... Line 163...
163
		params[GUC_CTL_LOG_PARAMS] = guc->log_flags;
163
		params[GUC_CTL_LOG_PARAMS] = guc->log_flags;
164
		params[GUC_CTL_DEBUG] =
164
		params[GUC_CTL_DEBUG] =
165
			i915.guc_log_level << GUC_LOG_VERBOSITY_SHIFT;
165
			i915.guc_log_level << GUC_LOG_VERBOSITY_SHIFT;
166
	}
166
	}
Line -... Line 167...
-
 
167
 
-
 
168
	if (guc->ads_obj) {
-
 
169
		u32 ads = (u32)i915_gem_obj_ggtt_offset(guc->ads_obj)
-
 
170
				>> PAGE_SHIFT;
-
 
171
		params[GUC_CTL_DEBUG] |= ads << GUC_ADS_ADDR_SHIFT;
-
 
172
		params[GUC_CTL_DEBUG] |= GUC_ADS_ENABLED;
-
 
173
	}
167
 
174
 
168
	/* If GuC submission is enabled, set up additional parameters here */
175
	/* If GuC submission is enabled, set up additional parameters here */
169
	if (i915.enable_guc_submission) {
176
	if (i915.enable_guc_submission) {
170
		u32 pgs = i915_gem_obj_ggtt_offset(dev_priv->guc.ctx_pool_obj);
177
		u32 pgs = i915_gem_obj_ggtt_offset(dev_priv->guc.ctx_pool_obj);
Line 190... Line 197...
190
 * Read the GuC status register (GUC_STATUS) and store it in the
197
 * Read the GuC status register (GUC_STATUS) and store it in the
191
 * specified location; then return a boolean indicating whether
198
 * specified location; then return a boolean indicating whether
192
 * the value matches either of two values representing completion
199
 * the value matches either of two values representing completion
193
 * of the GuC boot process.
200
 * of the GuC boot process.
194
 *
201
 *
195
 * This is used for polling the GuC status in a wait_for_atomic()
202
 * This is used for polling the GuC status in a wait_for()
196
 * loop below.
203
 * loop below.
197
 */
204
 */
198
static inline bool guc_ucode_response(struct drm_i915_private *dev_priv,
205
static inline bool guc_ucode_response(struct drm_i915_private *dev_priv,
199
				      u32 *status)
206
				      u32 *status)
200
{
207
{
Line 250... Line 257...
250
 
257
 
251
	/* Finally start the DMA */
258
	/* Finally start the DMA */
Line 252... Line 259...
252
	I915_WRITE(DMA_CTRL, _MASKED_BIT_ENABLE(UOS_MOVE | START_DMA));
259
	I915_WRITE(DMA_CTRL, _MASKED_BIT_ENABLE(UOS_MOVE | START_DMA));
253
 
260
 
254
	/*
261
	/*
255
	 * Spin-wait for the DMA to complete & the GuC to start up.
262
	 * Wait for the DMA to complete & the GuC to start up.
256
	 * NB: Docs recommend not using the interrupt for completion.
263
	 * NB: Docs recommend not using the interrupt for completion.
257
	 * Measurements indicate this should take no more than 20ms, so a
264
	 * Measurements indicate this should take no more than 20ms, so a
258
	 * timeout here indicates that the GuC has failed and is unusable.
265
	 * timeout here indicates that the GuC has failed and is unusable.
259
	 * (Higher levels of the driver will attempt to fall back to
266
	 * (Higher levels of the driver will attempt to fall back to
260
	 * execlist mode if this happens.)
267
	 * execlist mode if this happens.)
Line 261... Line 268...
261
	 */
268
	 */
262
	ret = wait_for_atomic(guc_ucode_response(dev_priv, &status), 100);
269
	ret = wait_for(guc_ucode_response(dev_priv, &status), 100);
Line 263... Line 270...
263
 
270
 
Line 436... Line 443...
436
	if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_PENDING)
443
	if (guc_fw->guc_fw_load_status == GUC_FIRMWARE_PENDING)
437
		guc_fw->guc_fw_load_status = GUC_FIRMWARE_FAIL;
444
		guc_fw->guc_fw_load_status = GUC_FIRMWARE_FAIL;
Line 438... Line 445...
438
 
445
 
439
	direct_interrupts_to_host(dev_priv);
446
	direct_interrupts_to_host(dev_priv);
-
 
447
	i915_guc_submission_disable(dev);
Line 440... Line 448...
440
	i915_guc_submission_disable(dev);
448
	i915_guc_submission_fini(dev);
441
 
449
 
Line 442... Line 450...
442
	return err;
450
	return err;
Line 552... Line 560...
552
	DRM_DEBUG_DRIVER("GuC fw fetch status FAIL; err %d, fw %p, obj %p\n",
560
	DRM_DEBUG_DRIVER("GuC fw fetch status FAIL; err %d, fw %p, obj %p\n",
553
		err, fw, guc_fw->guc_fw_obj);
561
		err, fw, guc_fw->guc_fw_obj);
554
	DRM_ERROR("Failed to fetch GuC firmware from %s (error %d)\n",
562
	DRM_ERROR("Failed to fetch GuC firmware from %s (error %d)\n",
555
		  guc_fw->guc_fw_path, err);
563
		  guc_fw->guc_fw_path, err);
Line -... Line 564...
-
 
564
 
556
 
565
	mutex_lock(&dev->struct_mutex);
557
	obj = guc_fw->guc_fw_obj;
566
	obj = guc_fw->guc_fw_obj;
558
	if (obj)
567
	if (obj)
559
		drm_gem_object_unreference(&obj->base);
568
		drm_gem_object_unreference(&obj->base);
-
 
569
	guc_fw->guc_fw_obj = NULL;
Line 560... Line 570...
560
	guc_fw->guc_fw_obj = NULL;
570
	mutex_unlock(&dev->struct_mutex);
561
 
571
 
562
	release_firmware(fw);		/* OK even if fw is NULL */
572
	release_firmware(fw);		/* OK even if fw is NULL */
Line 622... Line 632...
622
void intel_guc_ucode_fini(struct drm_device *dev)
632
void intel_guc_ucode_fini(struct drm_device *dev)
623
{
633
{
624
	struct drm_i915_private *dev_priv = dev->dev_private;
634
	struct drm_i915_private *dev_priv = dev->dev_private;
625
	struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
635
	struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
Line -... Line 636...
-
 
636
 
626
 
637
	mutex_lock(&dev->struct_mutex);
-
 
638
	direct_interrupts_to_host(dev_priv);
627
	direct_interrupts_to_host(dev_priv);
639
	i915_guc_submission_disable(dev);
Line 628... Line -...
628
	i915_guc_submission_fini(dev);
-
 
629
 
640
	i915_guc_submission_fini(dev);
630
	mutex_lock(&dev->struct_mutex);
641
 
631
	if (guc_fw->guc_fw_obj)
642
	if (guc_fw->guc_fw_obj)
632
		drm_gem_object_unreference(&guc_fw->guc_fw_obj->base);
643
		drm_gem_object_unreference(&guc_fw->guc_fw_obj->base);