From nobody Fri Dec 19 20:53:12 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2957D288C15 for ; Fri, 6 Jun 2025 12:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749211612; cv=none; b=lMARNoIjE4MaD/mNhGDiX10dz8xoxEb/jjguftjlD6elHkt9pkQf79CzY9Pczf72gsisToCVQvEju6xkD53p9GJcIaGjZtRnyMEkbzDDFUMsQddZtPWyalzklu+G75O1D7lxtuf7A5ceOKVbz37JufJ+q2QGLwLJzqAU6pVIMhI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749211612; c=relaxed/simple; bh=VSl/cmmDftA9q5LXt7BTkwOCTZhsdMZmQ9CjBdt6jwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lsw6fwwUYJVVwITSjn0iqJO9bk6JIdXK2MHqJhr48/5eh72xtrRCKuP0t4T8CUP7QEwjKTtGcw2ivPHvn+GspjcLUL/63jYLyzgFt6bN8RKucdQx6YassrQVEVIycSSv9S5IgnMF9vxMp+k3wFkLFymVgWBpEicchTImEWWlrPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BRJ/2/N5; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BRJ/2/N5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749211610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8c6ZwDHb3uYxtsAvJpFTLFi4+b+kzhB9wfsMrz7lsLA=; b=BRJ/2/N57bWvZoqAVRjLh9EdY7M2KF8IvmPL/F1L6U2xdYibv8NXtt8Hg8r3phPjj9eopY ciHD4xsLYzZvBmQjGeKEfAqGA1C+CHjgGXVH8+CpR1L2g3KL8NmEjsuLw1erz9nhYfOgFs 9E8fnp4NW8vpt/lJw9BDpfhwl2HfIas= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-deCbbWWaO527rQf_oRFE7w-1; Fri, 06 Jun 2025 08:06:46 -0400 X-MC-Unique: deCbbWWaO527rQf_oRFE7w-1 X-Mimecast-MFC-AGG-ID: deCbbWWaO527rQf_oRFE7w_1749211604 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76FD31956089; Fri, 6 Jun 2025 12:06:44 +0000 (UTC) Received: from hydra.redhat.com (unknown [10.44.33.65]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 585D918002B5; Fri, 6 Jun 2025 12:06:38 +0000 (UTC) From: Jocelyn Falempe To: Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , David Airlie , Simona Vetter , Christian Koenig , Huang Rui , Matthew Auld , Matthew Brost , Maxime Ripard , Thomas Zimmermann , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jocelyn Falempe Subject: [PATCH v8 8/9] drm/i915/display: Add drm_panic support for 4-tiling with DPT Date: Fri, 6 Jun 2025 13:48:12 +0200 Message-ID: <20250606120519.753928-9-jfalempe@redhat.com> In-Reply-To: <20250606120519.753928-1-jfalempe@redhat.com> References: <20250606120519.753928-1-jfalempe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" On Alder Lake and later, it's not possible to disable tiling when DPT is enabled. So this commit implements 4-Tiling support, to still be able to draw the panic screen. Signed-off-by: Jocelyn Falempe --- .../gpu/drm/i915/display/intel_atomic_plane.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gp= u/drm/i915/display/intel_atomic_plane.c index ce5471bd3c43..8c422c6a7186 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -1297,6 +1297,25 @@ static unsigned int intel_ytile_get_offset(unsigned = int width, unsigned int x, u return offset; } =20 +static unsigned int intel_4tile_get_offset(unsigned int width, unsigned in= t x, unsigned int y) +{ + u32 offset; + unsigned int swizzle; + unsigned int width_in_blocks =3D DIV_ROUND_UP(width, 32); + + /* Block offset */ + offset =3D ((y / YTILE_HEIGHT) * width_in_blocks + (x / YTILE_WIDTH)) * Y= TILE_SIZE; + + x =3D x % YTILE_WIDTH; + y =3D y % YTILE_HEIGHT; + + /* bit order inside a block is y4 y3 x4 y2 x3 x2 y1 y0 x1 x0 */ + swizzle =3D (x & 3) | ((y & 3) << 2) | ((x & 0xc) << 2) | (y & 4) << 4 | + ((x & 0x10) << 3) | ((y & 0x18) << 5); + offset +=3D swizzle * 4; + return offset; +} + static void intel_panic_flush(struct drm_plane *plane) { struct intel_plane_state *plane_state =3D to_intel_plane_state(plane->sta= te); @@ -1342,6 +1361,7 @@ static unsigned int (*intel_get_tiling_func(u64 fb_mo= difier))(unsigned int width case I915_FORMAT_MOD_4_TILED_MTL_MC_CCS: case I915_FORMAT_MOD_4_TILED_BMG_CCS: case I915_FORMAT_MOD_4_TILED_LNL_CCS: + return intel_4tile_get_offset; case I915_FORMAT_MOD_X_TILED: case I915_FORMAT_MOD_Yf_TILED: case I915_FORMAT_MOD_Yf_TILED_CCS: --=20 2.49.0