Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c258f91d authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915/gtt: Tidy up duplicate branches in gen8_gmch_probe()



Following commit f773568b ("drm/i915: nuke the duplicated stolen
discovery"), the if-else-chain for determining the GTT size is redundant
with the !chv branches all being the same.

Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
References: f773568b ("drm/i915: nuke the duplicated stolen discovery")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180503212956.3948-1-chris@chris-wilson.co.uk
parent 47d4cb8a
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -3326,14 +3326,10 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt)
		DRM_ERROR("Can't set DMA mask/consistent mask (%d)\n", err);
		DRM_ERROR("Can't set DMA mask/consistent mask (%d)\n", err);


	pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
	pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);

	if (IS_CHERRYVIEW(dev_priv))
	if (INTEL_GEN(dev_priv) >= 9) {
		size = gen8_get_total_gtt_size(snb_gmch_ctl);
	} else if (IS_CHERRYVIEW(dev_priv)) {
		size = chv_get_total_gtt_size(snb_gmch_ctl);
		size = chv_get_total_gtt_size(snb_gmch_ctl);
	} else {
	else
		size = gen8_get_total_gtt_size(snb_gmch_ctl);
		size = gen8_get_total_gtt_size(snb_gmch_ctl);
	}


	ggtt->base.total = (size / sizeof(gen8_pte_t)) << PAGE_SHIFT;
	ggtt->base.total = (size / sizeof(gen8_pte_t)) << PAGE_SHIFT;
	ggtt->base.cleanup = gen6_gmch_remove;
	ggtt->base.cleanup = gen6_gmch_remove;