Re: [PATCH v2 1/2] drm/i915/gt: Split intel-gtt functions by arch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 29, 2022 at 04:35:17PM -0700, Casey Bowman wrote:
> @@ -1208,11 +576,11 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt)
>  	dma_resv_init(&ggtt->vm._resv);
>  
>  	if (GRAPHICS_VER(i915) <= 5)
> -		ret = i915_gmch_probe(ggtt);
> +		ret = intel_gt_gmch_gen5_probe(ggtt);

s/gen5/gen2/ to conform to the standard "name things based
on the oldest thing" doctrine.

Also s/intel_gt_gmch/intel_ggtt/ for all of these might be
a good idea to actually convey what they do.

>  	else if (GRAPHICS_VER(i915) < 8)
> -		ret = gen6_gmch_probe(ggtt);
> +		ret = intel_gt_gmch_gen6_probe(ggtt);
>  	else
> -		ret = gen8_gmch_probe(ggtt);
> +		ret = intel_gt_gmch_gen8_probe(ggtt);
>  	if (ret) {
>  		dma_resv_fini(&ggtt->vm._resv);
>  		return ret;
<snip>
> +/*
> + * Certain Gen5 chipsets require idling the GPU before
> + * unmapping anything from the GTT when VT-d is enabled.
> + */
> +static bool needs_idle_maps(struct drm_i915_private *i915)
> +{
> +	/*
> +	 * Query intel_iommu to see if we need the workaround. Presumably that
> +	 * was loaded first.
> +	 */
> +	if (!intel_vtd_active(i915))
> +		return false;
> +
> +	if (GRAPHICS_VER(i915) == 5 && IS_MOBILE(i915))
> +		return true;
> +
> +	if (GRAPHICS_VER(i915) == 12)
> +		return true; /* XXX DMAR fault reason 7 */

This gen12 part is still dead code. Should just nuke it most likely,
but someone should actually figure out where it came from, what it
was supposed to fix, and did it ever actually work.

-- 
Ville Syrjälä
Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux