From nobody Fri Sep 25 16:02:42 2026 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8A9558F099 for ; Thu, 10 Sep 2026 18:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789066276; cv=none; b=BloF58uycEVvtzB9CTlputAH38Ga39+E699v19u34cKVhpwK7MKzb+tkTewVevXiMZXDXNRluAhBslbz96OyphBSO+wv+u0QU4HG3WtdLguAmKvNCZW804AIxDOJQ6LTYev+3LntChFLC4w9tKdWzdYFjPFGyCaGdPRHnxQYcXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789066276; c=relaxed/simple; bh=VYAlhDTEhQ8Z55RInU+qw8dimHrq60IQ+94YrUUz7Zw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S61xQE8ZjwRKGm3u/luYJ82+bxhZ2YY8GAXeraSNzgdO4gj3tZk2x3dkiYfiPyo9/xpXtpX8mP1OlUARa87imOKRJpvDPkdSp83KosozmYnswjawQsB5QcaH2aAXMv2cPgZ4nf/5sFHvmkE3mr+TaFECoM+emtQLhRDsgWZmHLw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wg2+on1e; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wg2+on1e" Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-87c938111a7so860777b3.0 for ; Thu, 10 Sep 2026 11:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789066262; x=1789671062; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=7ze+3Q1Zghvt73AjvM76sYvoFHG3lXKdzLgSKzynkjs=; b=Wg2+on1ePjz9OIr68sstr51txPFUVq7BCDp6JsmLfcqli5CyPmu5U0Lec3RLYPe07T qXANna/9TEJNKovnJha8KLTuiPNP4dq8fMQD+YcTgCiCNDorJUSc0Cvr7HmFYa05KWCX pxDK1i/MXYuQK0umfucikd7SdvjKur+Yjo4m+N5SxiPmdafb/+k6/vQvQDKeGPHROpxx 7tIf+x34qSvbANtEbS0dbEGq+auowtvPVh/Ue4uPknAjMRUWSKmWyJN7nf0Ig+d9MjfP ZkFcmELwDELGbjbjOrxpzuI11BRVjVDIfPxB/73YyV5Hj5lTdTVtqdxfNoyMty19/LPz dhXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789066262; x=1789671062; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=7ze+3Q1Zghvt73AjvM76sYvoFHG3lXKdzLgSKzynkjs=; b=F/GlDAfbCBY57LR5z1TSINBl8W/s/POkPB+A8S4Z0Jt6HrJMa7/PFQ2FISm0tuO2A7 KP305H230/iCnM7b3EL6TUet2L2iek4LOQsU4+PypTV5RXXVau8IrIUVfNkODEFzZc42 cItgp9/119MRPV/MXnk65tdf39akcd7c0qKGuuBPY8pwPhYaA18b8aQgkMdQP4r7VzEo XcPprz67Vp4uVr6K/FHZP2B5lTZ2Dgn59pNUZYlR9dIuPrTnpr1SDaaxaRsO58dmigqV gnJxLU8F3mhD4jPG4b45QfRVVMh8u8DMh2toZaxNX7pmKXvmbvERtvevnOW0jv4ytHxx QsWQ== X-Forwarded-Encrypted: i=1; AKwUvByeELZNUUFo/T+DVhjUUq94gI2b3FI575KsuzDoBWCsQrnDNtU8gy/MB+gIHu3Ia7vqKsCLulYds1Y9PFc=@vger.kernel.org X-Gm-Message-State: AFuF++kNw8qAaF9g5W/IlaB5gK+BByd/kpOOlLsZYz9NGIo8p14osve2 +fN2xdii6aRXf2gmT4DPB3iRRCKPyqF2yMNmR9WCc3+nT/ndgBQUloYk X-Gm-Gg: AYBFou3TIxaD6im2bZx6lvEdUBnnYRWTzQjgsdwbfOGZDoGGS+EjC4a48ifqV0HG2ho 1luPC9/rCe9DNojx8U1JSExVvpT5aOWSREgYLMMLXkgwSPkdy/WniDe43QGqVubu/zMgwC/wbX0 Ri44EdWOethzErxIc98bH/k5ifBkEANfYzJK+jt5WGFRAFmmlffvOfzboP1tIm85MzYA/gN8+ys lTeJAxVNCy0hoFMIksqqwOWJuUUlB7Jw67+bwho847ayfReqvZeNHbf9NwhiT5aMnJTRMubdRW/ 86HsrpQqQiqQtf6XZ+QAHnwB7auaGsBdmb2qiI+WB9GLYwB0UUaIWneh0huW2wuFoZrBoS+il8X JxynRKUq64F3OFEIhrHiIm0RvkiLOlc/tTX4Y0VULmPo9aR7YAp0nVuIAbO3WIBW5Rfc6U4iMGk L7Xs5n7SxnUh59P5JLJiEZxz5CNjZE8A1ZQ3pt9LxXQH/s0wpVkdHRCEeK7fqcTD1XFcd78iFeH f69MKTsbrM= X-Received: by 2002:a05:690c:387:b0:873:5c7b:c13b with SMTP id 00721157ae682-88206b7b4b9mr20143737b3.35.1789066261756; Thu, 10 Sep 2026 11:51:01 -0700 (PDT) Received: from DESKTOP-TLFH1MG ([76.255.203.42]) by smtp.gmail.com with ESMTPSA id 00721157ae682-88486086a50sm3291707b3.17.2026.09.10.11.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 11:51:01 -0700 (PDT) From: Jonathan Frazin To: dri-devel@lists.freedesktop.org Cc: Thomas Zimmermann , Maxime Ripard , Maarten Lankhorst , David Airlie , Simona Vetter , Kamlesh Gurudasani , Alex Lanzano , linux-kernel@vger.kernel.org, Jonathan Frazin , Dave Stevenson Subject: [PATCH v1 1/2] drm/mipi-dbi: honour the plane source offset when flushing Date: Thu, 10 Sep 2026 13:48:56 -0500 Message-ID: <20260910185030.870-2-frazinjonathan@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260910185030.870-1-frazinjonathan@gmail.com> References: <20260910185030.870-1-frazinjonathan@gmail.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 Content-Type: text/plain; charset="utf-8" mipi_dbi_fb_dirty() takes the damage rectangle from drm_atomic_helper_damage_merged(), which is expressed in framebuffer coordinates and already clipped to the plane's source rectangle. It then passed that rectangle straight to mipi_dbi_set_window_address(), which is correct only while the source rectangle starts at (0,0) - i.e. while the framebuffer is exactly panel-sized. If a driver allows a framebuffer larger than the panel and the plane selects a sub-region with a non-zero src_x/src_y, the controller was still addressed in framebuffer coordinates, so the wrong part of the panel was written and an out-of-range window could be programmed. Pass the integer plane source origin down to mipi_dbi_fb_dirty() and subtract it when programming the column/page address. The copy into the transfer buffer still uses the framebuffer-coordinate rectangle, so it keeps reading the correct pixels from an oversized source. With a panel-sized framebuffer src_x/src_y are zero and behaviour is unchanged. Cc: Dave Stevenson Signed-off-by: Jonathan Frazin --- drivers/gpu/drm/drm_mipi_dbi.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 25cf04d02..38db45a9d 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -271,7 +271,8 @@ static void mipi_dbi_set_window_address(struct mipi_dbi= _dev *dbidev, } =20 static void mipi_dbi_fb_dirty(struct iosys_map *src, struct drm_framebuffe= r *fb, - struct drm_rect *rect, struct drm_format_conv_state *fmtcnv_state) + struct drm_rect *rect, unsigned int src_x, unsigned int src_y, + struct drm_format_conv_state *fmtcnv_state) { struct mipi_dbi_dev *dbidev =3D drm_to_mipi_dbi_dev(fb->dev); unsigned int height =3D rect->y2 - rect->y1; @@ -298,8 +299,13 @@ static void mipi_dbi_fb_dirty(struct iosys_map *src, s= truct drm_framebuffer *fb, tr =3D src->vaddr; /* TODO: Use mapping abstraction properly */ } =20 - mipi_dbi_set_window_address(dbidev, rect->x1, rect->x2 - 1, rect->y1, - rect->y2 - 1); + /* + * @rect is in framebuffer coordinates and has been clipped to the plane + * src rectangle by the damage iterator. The panel is addressed relative + * to the src origin, so subtract it here. + */ + mipi_dbi_set_window_address(dbidev, rect->x1 - src_x, rect->x2 - 1 - src_= x, + rect->y1 - src_y, rect->y2 - 1 - src_y); =20 if (fb->format->format =3D=3D DRM_FORMAT_XRGB8888) dst_format =3D drm_format_info(dbidev->pixel_format); @@ -390,6 +396,8 @@ void drm_mipi_dbi_plane_helper_atomic_update(struct drm= _plane *plane, if (drm_dev_enter(plane->dev, &idx)) { if (drm_atomic_helper_damage_merged(old_plane_state, plane_state, &rect)) mipi_dbi_fb_dirty(&shadow_plane_state->data[0], fb, &rect, + plane_state->src_x >> 16, + plane_state->src_y >> 16, &shadow_plane_state->fmtcnv_state); drm_dev_exit(idx); } --=20 2.53.0 From nobody Fri Sep 25 16:02:42 2026 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A33E58FD06 for ; Thu, 10 Sep 2026 18:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789066298; cv=none; b=VTmimgb1VU7J/cvcc03xCjXDwzU2f4TE9M84In0mJNiH26LHS1VA1SCQ5tz+43RtOr184+I7Nzo5qUazEZTaKTZwPuz2ZcdG6CLhtvNmSG66AhMhTWSK9NCx/UYz1v5s2bynCqam2ZgrGLjgqD0qoVqkARiir/QJIw2bE+gYEDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789066298; c=relaxed/simple; bh=L+2ZhQGcjhpHfRCkNGkXqSTUy81ieP0Y8o2V0ExHZBw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ipLdFjrPpFI6inzCgFT9loEqhNylPKW9eMXgFS6p9lQvRTAsvD9DcxQxm3O4Umzz/ASPGsMUnCewUsSeW/KKeczT4a5GeNP2QO7COqyRzSeaecdOXSA0nosNnLhAQtui31UeSNO29BUt0VyvqmlAADusT8L7RaB3xNdP7PwoBgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RHG/kJ8B; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RHG/kJ8B" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-86162c086f8so754197b3.1 for ; Thu, 10 Sep 2026 11:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789066265; x=1789671065; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6m8h8p8x3swINqHznguOqnp4bmSBliy9kDD6omjjK2s=; b=RHG/kJ8Bcrb0KjnhApceJphsDreV45eQzKpQcK3QkE/cBFjqzqfZkTmRPhifezsgX4 ZYBK+JUUEbMY43bQhXGU3Se3/KvoGsu4qi/A4dVKr7BlcgMb4xM/tglRUjwi3BUW/5GS UFj95LLMPZUvmtT+tXIJsaeZQ86aqdxrV7P3NRjnio6dyNNfZndwUTP42iefkwUZ7pHD zChoJ4yOR1ncRQOdYpjT3UGeH/5VRN5PQJMb6jcUkpF7sqhtDIcaitsuR7XDr9ImR078 ZobP/22+hiS+ZoIJNYsrxPTkaIXnoY7AWA5ih5vvXAh0r5RQ119zoX5fuFPtPp5HdEj0 0F9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789066265; x=1789671065; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6m8h8p8x3swINqHznguOqnp4bmSBliy9kDD6omjjK2s=; b=rLWk2roxs4h149qbMkCby6BnJmMlmqb+wziVXLfVhSO2LGPvSEjLRzBcbodfd3sgAC gM6MjwYZQyCY3TbN9F6wX5Cuh8jvNtORpClu4X9pQwF6SDN5ocSi7U5ojt5bwfwsX7EU Hc0N/yuSpZ0oRnuuOe4HynefeWoJo1RnH8Myl1tCzgm4T5j4ISn+b+IuweXj9s0es/mg Rd9kdlDUnq39FDzKyde1EjznLj+hN8MNTiT8WPqDPgj703SdkUCweerAyxctyeUzd2ZC 2sNMzEZVFcEZki/CbXEFNbxabesO/McLfRq+k3T9M2RPeFPYGrn5vb7qWw8+r8XxI+YQ Y3Ow== X-Forwarded-Encrypted: i=1; AKwUvBwoVjKS0UOdYzeNsCqgeYJtc7rHrjsshlJraGYAY/idZsfuTGadX4wrtu7q33BB2mEaGVLjPUbhcvWPM2k=@vger.kernel.org X-Gm-Message-State: AFuF++njX49k9Wdn80GpDCqCtqhxxYJM6i9hL7dPWIgmzbATszMJMyNh 5C9TdXX4/ljvvxvh6o/9BdaXw3F9mVVxZSrM5UDhgTk2UN+o87miBx8f X-Gm-Gg: AYBFou0NWQtY6MBAX0ZzN0lmDfNGZ6T0W7QbHiKDbRH8sb7FjvkLiR6Nny5g0xMGeeR JCBpcdvNzN8EVOrTjDSqU1E+vj6WFPRriiMN9Wa6Rmi7PEFjdQiN+4hPXApbnpqf5uKPEFahQBF oQLHqWRrtvRgcfvZjX7sD7lQ1cxx0HBhk4l/cJAp2MWuPl8IVLYW7BFXBpRiWN0EEErOyjPJlQI Wlj24yT7Gk+u79G19e+MTFy7GDgMd6vR0gsK/GJ2G7hV6JNp9KJ0Iuwj8Dsa7Fs+6Av14CrgMDr Tj6u+4XnrLS97VGELs9ReG5jAo3/7Zs8ooIX3aAXG0fFO1lL6QAHh3TSScVg3PwOzADySmdayeI LxdnfgdT8SRtSLXTdKF5eggPBuh9RZWn31ovVyFDILRwjjziJ5Wxx8YK4dfAZsz2f4w9Gcuwd1m 51BpvaE4UBIrzc2k7Bcdo87pp6gjrJQjzN6S4Fb4wkHpbM3bC/f0TC/YYX/Sb4LAXDmgtwO3gj4 8UnpVonRQ== X-Received: by 2002:a05:690c:9c04:b0:861:7cb6:5790 with SMTP id 00721157ae682-88200ebff7cmr20543767b3.4.1789066265217; Thu, 10 Sep 2026 11:51:05 -0700 (PDT) Received: from DESKTOP-TLFH1MG ([76.255.203.42]) by smtp.gmail.com with ESMTPSA id 00721157ae682-88486086a50sm3291707b3.17.2026.09.10.11.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 11:51:04 -0700 (PDT) From: Jonathan Frazin To: dri-devel@lists.freedesktop.org Cc: Thomas Zimmermann , Maxime Ripard , Maarten Lankhorst , David Airlie , Simona Vetter , Kamlesh Gurudasani , Alex Lanzano , linux-kernel@vger.kernel.org, Jonathan Frazin , Dave Stevenson Subject: [PATCH v1 2/2] drm/tiny: allow a framebuffer larger than the panel on MIPI DBI drivers Date: Thu, 10 Sep 2026 13:48:57 -0500 Message-ID: <20260910185030.870-3-frazinjonathan@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260910185030.870-1-frazinjonathan@gmail.com> References: <20260910185030.870-1-frazinjonathan@gmail.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 Content-Type: text/plain; charset="utf-8" Every drm/tiny MIPI DBI driver pins mode_config.max_width/max_height to the panel size, so KMS rejects any framebuffer that is not exactly panel-sized: ili9341 spi0.0: bad framebuffer width 480, should be >=3D 240 && <=3D 2= 40 Raise the maximums to DRM_SHADOW_PLANE_MAX_WIDTH/HEIGHT (which its kerneldoc recommends for shadow-plane drivers) on the drivers that flush through the shared drm_mipi_dbi_plane_helper_atomic_update(), so a client can allocate a larger framebuffer and pick the displayed region through the plane source rectangle - a crop / pan with no scaling, now that drm_mipi_dbi honours the source offset (previous patch): ili9341, hx8357d, ili9486, mi0283qt, ili9163, panel-mipi-dbi The fixed mode, the minimums and the connector are unchanged. The plane check (drm_mipi_dbi_plane_helper_atomic_check) still forbids scaling and repositioning, and the transfer buffer is sized from the display mode, so the flushed rectangle stays bounded by the panel regardless of the framebuffer dimensions. ili9225 is left out: it has its own atomic_update / ili9225_fb_dirty() that addresses the panel from the damage rectangle without the source offset, so raising its limits would let a mispositioned buffer through. Cc: Dave Stevenson Signed-off-by: Jonathan Frazin --- drivers/gpu/drm/tiny/hx8357d.c | 8 ++++++-- drivers/gpu/drm/tiny/ili9163.c | 8 ++++++-- drivers/gpu/drm/tiny/ili9341.c | 8 ++++++-- drivers/gpu/drm/tiny/ili9486.c | 8 ++++++-- drivers/gpu/drm/tiny/mi0283qt.c | 8 ++++++-- drivers/gpu/drm/tiny/panel-mipi-dbi.c | 8 ++++++-- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c index f942a8d09..0599b8ccf 100644 --- a/drivers/gpu/drm/tiny/hx8357d.c +++ b/drivers/gpu/drm/tiny/hx8357d.c @@ -320,9 +320,13 @@ static int hx8357d_probe(struct spi_device *spi) return ret; =20 drm->mode_config.min_width =3D dbidev->mode.hdisplay; - drm->mode_config.max_width =3D dbidev->mode.hdisplay; + /* + * Allow a framebuffer larger than the panel so a sub-region can be + * displayed via the plane source rectangle (crop / pan, no scaling). + */ + drm->mode_config.max_width =3D DRM_SHADOW_PLANE_MAX_WIDTH; drm->mode_config.min_height =3D dbidev->mode.vdisplay; - drm->mode_config.max_height =3D dbidev->mode.vdisplay; + drm->mode_config.max_height =3D DRM_SHADOW_PLANE_MAX_HEIGHT; drm->mode_config.funcs =3D &hx8357d_mode_config_funcs; drm->mode_config.preferred_depth =3D 16; drm->mode_config.helper_private =3D &hx8357d_mode_config_helper_funcs; diff --git a/drivers/gpu/drm/tiny/ili9163.c b/drivers/gpu/drm/tiny/ili9163.c index 884242450..fe6c13056 100644 --- a/drivers/gpu/drm/tiny/ili9163.c +++ b/drivers/gpu/drm/tiny/ili9163.c @@ -251,9 +251,13 @@ static int ili9163_probe(struct spi_device *spi) return ret; =20 drm->mode_config.min_width =3D dbidev->mode.hdisplay; - drm->mode_config.max_width =3D dbidev->mode.hdisplay; + /* + * Allow a framebuffer larger than the panel so a sub-region can be + * displayed via the plane source rectangle (crop / pan, no scaling). + */ + drm->mode_config.max_width =3D DRM_SHADOW_PLANE_MAX_WIDTH; drm->mode_config.min_height =3D dbidev->mode.vdisplay; - drm->mode_config.max_height =3D dbidev->mode.vdisplay; + drm->mode_config.max_height =3D DRM_SHADOW_PLANE_MAX_HEIGHT; drm->mode_config.funcs =3D &ili9163_mode_config_funcs; drm->mode_config.preferred_depth =3D 16; drm->mode_config.helper_private =3D &ili9163_mode_config_helper_funcs; diff --git a/drivers/gpu/drm/tiny/ili9341.c b/drivers/gpu/drm/tiny/ili9341.c index 003381aa2..1e4bb56e3 100644 --- a/drivers/gpu/drm/tiny/ili9341.c +++ b/drivers/gpu/drm/tiny/ili9341.c @@ -282,9 +282,13 @@ static int ili9341_probe(struct spi_device *spi) return ret; =20 drm->mode_config.min_width =3D dbidev->mode.hdisplay; - drm->mode_config.max_width =3D dbidev->mode.hdisplay; + /* + * Allow a framebuffer larger than the panel so a sub-region can be + * displayed via the plane source rectangle (crop / pan, no scaling). + */ + drm->mode_config.max_width =3D DRM_SHADOW_PLANE_MAX_WIDTH; drm->mode_config.min_height =3D dbidev->mode.vdisplay; - drm->mode_config.max_height =3D dbidev->mode.vdisplay; + drm->mode_config.max_height =3D DRM_SHADOW_PLANE_MAX_HEIGHT; drm->mode_config.funcs =3D &ili9341_mode_config_funcs; drm->mode_config.preferred_depth =3D 16; drm->mode_config.helper_private =3D &ili9341_mode_config_helper_funcs; diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c index fab8bd7ce..de33d702a 100644 --- a/drivers/gpu/drm/tiny/ili9486.c +++ b/drivers/gpu/drm/tiny/ili9486.c @@ -309,9 +309,13 @@ static int ili9486_probe(struct spi_device *spi) return ret; =20 drm->mode_config.min_width =3D dbidev->mode.hdisplay; - drm->mode_config.max_width =3D dbidev->mode.hdisplay; + /* + * Allow a framebuffer larger than the panel so a sub-region can be + * displayed via the plane source rectangle (crop / pan, no scaling). + */ + drm->mode_config.max_width =3D DRM_SHADOW_PLANE_MAX_WIDTH; drm->mode_config.min_height =3D dbidev->mode.vdisplay; - drm->mode_config.max_height =3D dbidev->mode.vdisplay; + drm->mode_config.max_height =3D DRM_SHADOW_PLANE_MAX_HEIGHT; drm->mode_config.funcs =3D &ili9486_mode_config_funcs; drm->mode_config.preferred_depth =3D 16; drm->mode_config.helper_private =3D &ili9486_mode_config_helper_funcs; diff --git a/drivers/gpu/drm/tiny/mi0283qt.c b/drivers/gpu/drm/tiny/mi0283q= t.c index b0121e89e..df3801914 100644 --- a/drivers/gpu/drm/tiny/mi0283qt.c +++ b/drivers/gpu/drm/tiny/mi0283qt.c @@ -290,9 +290,13 @@ static int mi0283qt_probe(struct spi_device *spi) return ret; =20 drm->mode_config.min_width =3D dbidev->mode.hdisplay; - drm->mode_config.max_width =3D dbidev->mode.hdisplay; + /* + * Allow a framebuffer larger than the panel so a sub-region can be + * displayed via the plane source rectangle (crop / pan, no scaling). + */ + drm->mode_config.max_width =3D DRM_SHADOW_PLANE_MAX_WIDTH; drm->mode_config.min_height =3D dbidev->mode.vdisplay; - drm->mode_config.max_height =3D dbidev->mode.vdisplay; + drm->mode_config.max_height =3D DRM_SHADOW_PLANE_MAX_HEIGHT; drm->mode_config.funcs =3D &mi0283qt_mode_config_funcs; drm->mode_config.preferred_depth =3D 16; drm->mode_config.helper_private =3D &mi0283qt_mode_config_helper_funcs; diff --git a/drivers/gpu/drm/tiny/panel-mipi-dbi.c b/drivers/gpu/drm/tiny/p= anel-mipi-dbi.c index 60cd65cae..a0a098b0d 100644 --- a/drivers/gpu/drm/tiny/panel-mipi-dbi.c +++ b/drivers/gpu/drm/tiny/panel-mipi-dbi.c @@ -448,9 +448,13 @@ static int panel_mipi_dbi_spi_probe(struct spi_device = *spi) return ret; =20 drm->mode_config.min_width =3D dbidev->mode.hdisplay; - drm->mode_config.max_width =3D dbidev->mode.hdisplay; + /* + * Allow a framebuffer larger than the panel so a sub-region can be + * displayed via the plane source rectangle (crop / pan, no scaling). + */ + drm->mode_config.max_width =3D DRM_SHADOW_PLANE_MAX_WIDTH; drm->mode_config.min_height =3D dbidev->mode.vdisplay; - drm->mode_config.max_height =3D dbidev->mode.vdisplay; + drm->mode_config.max_height =3D DRM_SHADOW_PLANE_MAX_HEIGHT; drm->mode_config.funcs =3D &panel_mipi_dbi_mode_config_funcs; drm->mode_config.preferred_depth =3D bpp; drm->mode_config.helper_private =3D &panel_mipi_dbi_mode_config_helper_fu= ncs; --=20 2.53.0