From nobody Sun Feb 8 12:39:05 2026 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 4A4F51F1300 for ; Tue, 25 Mar 2025 21:28:47 +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=1742938129; cv=none; b=GQJoZBGig7m4NcMiNW+DBz17TFwAmEBPwDmw8r7RwyTfh6RBisezhR7lNVMDkRRMmjozuk24zwLZtiOwFjUsrDVRo5R7Q+2x11sKstbwZv2PYu3s0Ri2XPuSx6J6Xd2O8qh7xVY3AMYxutSAwNU+p7ZgsINsfa/rcgzBemB54YQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742938129; c=relaxed/simple; bh=QzvD+twqG+PK6CX3j8Cn8yeRU+WFHIBiOGn35iMcfkI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DeaHs2oHKa6OIZNBJf7Bp/U0ai9a3ehTiFbru+6OcOZNl07wa2TA49y/ZPMV2xC3qNrmMr7JRbSd/Ta3yiC3d6hqujbBMsS+uL93UywLAiWsY5nUFcFkRWfctppqGQwAWI5epffP4wyTQDuXkoSusFaWtjhNEDBEHDo/fnCxYH0= 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=c0ntSM+q; 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="c0ntSM+q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742938127; 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=V4xLb8V8T6CZWLRFn4kKzM+FxRUrfETXJPEGmVxhSAE=; b=c0ntSM+qtA1my+9HOGZfjcYdKV2QSj5dBgA8pTI73EDzqpr9fXdtavCqm0gJr+VI7nE8g6 srMgvEf2EER6nW3iBK5psRY3PtfPNityzQpcc7v7pLuoWg4RvvCTeTTwxtQhjdRuxitV9A GSMvvumFu5w3K+1WEa6kxgITTmqJ1Cw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-mekVL5PmOnOPqw1sBArMJQ-1; Tue, 25 Mar 2025 17:28:42 -0400 X-MC-Unique: mekVL5PmOnOPqw1sBArMJQ-1 X-Mimecast-MFC-AGG-ID: mekVL5PmOnOPqw1sBArMJQ_1742938120 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F1BFA1801A00; Tue, 25 Mar 2025 21:28:39 +0000 (UTC) Received: from chopper.lyude.net (unknown [10.22.80.20]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 878B219541A6; Tue, 25 Mar 2025 21:28:35 +0000 (UTC) From: Lyude Paul To: Maxime Ripard , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , rust-for-linux@vger.kernel.org (open list:RUST:Keyword:\b(?i:rust)\b) Subject: [PATCH 1/2] drm/edid: Use unsigned int in drm_add_modes_noedid() Date: Tue, 25 Mar 2025 17:27:04 -0400 Message-ID: <20250325212823.669459-2-lyude@redhat.com> In-Reply-To: <20250325212823.669459-1-lyude@redhat.com> References: <20250325212823.669459-1-lyude@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.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" A negative resolution doesn't really make any sense, no one goes into a TV store and says "Hello sir, I would like a negative 4K TV please", that would make everyone look at you funny. So, let's make these parameters a bit more reasonable and ensure that they're unsigned - which makes the resulting rust bindings for this function a bit easier to understand and work with. Signed-off-by: Lyude Paul Cc: Greg Kroah-Hartman Cc: Maxime Ripard Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_edid.c | 2 +- include/drm/drm_edid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 13bc4c290b17d..2e2e1d2347397 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -7099,7 +7099,7 @@ EXPORT_SYMBOL(drm_add_edid_modes); * Return: The number of modes added or 0 if we couldn't find any. */ int drm_add_modes_noedid(struct drm_connector *connector, - int hdisplay, int vdisplay) + unsigned int hdisplay, unsigned int vdisplay) { int i, count, num_modes =3D 0; struct drm_display_mode *mode; diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index eaac5e665892a..b38409670868d 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -437,7 +437,7 @@ bool drm_detect_monitor_audio(const struct edid *edid); enum hdmi_quantization_range drm_default_rgb_quant_range(const struct drm_display_mode *mode); int drm_add_modes_noedid(struct drm_connector *connector, - int hdisplay, int vdisplay); + unsigned int hdisplay, unsigned int vdisplay); =20 int drm_edid_header_is_valid(const void *edid); bool drm_edid_is_valid(struct edid *edid); --=20 2.48.1 From nobody Sun Feb 8 12:39:05 2026 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 82BF31FF5FC for ; Tue, 25 Mar 2025 21:28:48 +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=1742938130; cv=none; b=MFnmHWbQtkt5C90JppfZ1t5UMA7UmqZl1wKs1qKSUTTeU1AujCXzVfwoa8wRto3+souTFqNKkSNu0G8uzeaGhgqM9oPVyEHYh+R1ZvuVjUSRU4BjQCd5X5s5mpimntMLAzyv6lq1U9qrhf1ioXLNaKrzmEyslry/CSSI40Buwwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742938130; c=relaxed/simple; bh=WOKjfO5Le5ZbWGc0aTaU8R66dTfSI7l0KXfGeSy0yr0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TUNTKmJD9aEc6xWxWQCq7HQ5eZlHdMj9D4KU46MswpHoJfpC8m2jCxdOh7tWv3rQomL3V4x3tEVb1mJ8s4jnFnzQ5mzINe0WkcOqlyOJzs0g7vJffsNoJvtay/MzbkDrW05wXAjcvEAGXqjzcT7sJ759D9AKn51R6TXXj2GCUPY= 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=aUFYLfrb; 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="aUFYLfrb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742938127; 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=lMQDXtxbqTS7ziJJiCZIX0LB76TW0s62efGfyV0tZrY=; b=aUFYLfrb0mBOEMKUjEETUJj+EkREsgMrRS5b9oKFxZlp0X87i+ohUQodIldXWYsW+s8C+F J6oLpZ7H3dgKA72h1TlCLrwgXAUmiMdTcn6aDLDuWc898SJ8AYjKH2yQ4l4wEDadsp1Q+J lcaP26Lbs9dXjwkbjoMQBFMHxN7RCMk= Received: from mx-prod-mc-01.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-9-h6ygNYWKM4q_iEEXd15dvQ-1; Tue, 25 Mar 2025 17:28:44 -0400 X-MC-Unique: h6ygNYWKM4q_iEEXd15dvQ-1 X-Mimecast-MFC-AGG-ID: h6ygNYWKM4q_iEEXd15dvQ_1742938122 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6EE1A196D2CF; Tue, 25 Mar 2025 21:28:42 +0000 (UTC) Received: from chopper.lyude.net (unknown [10.22.80.20]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7462919541A5; Tue, 25 Mar 2025 21:28:40 +0000 (UTC) From: Lyude Paul To: Maxime Ripard , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter Subject: [PATCH 2/2] drm/mode_config: Make drm_mode_config.(max|min)_(width|height) signed Date: Tue, 25 Mar 2025 17:27:05 -0400 Message-ID: <20250325212823.669459-3-lyude@redhat.com> In-Reply-To: <20250325212823.669459-1-lyude@redhat.com> References: <20250325212823.669459-1-lyude@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.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" Similarly, it doesn't really make much sense for us to allow devices to specify their minimum/maximum resolution as signed. So, let's fix that as well while we're at it. Signed-off-by: Lyude Paul Cc: Greg Kroah-Hartman Cc: Maxime Ripard Reviewed-by: Maxime Ripard --- include/drm/drm_mode_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 271765e2e9f2d..4b8f0370b79bf 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -532,8 +532,8 @@ struct drm_mode_config { */ struct list_head privobj_list; =20 - int min_width, min_height; - int max_width, max_height; + unsigned int min_width, min_height; + unsigned int max_width, max_height; const struct drm_mode_config_funcs *funcs; =20 /* output poll support */ --=20 2.48.1