Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp836448pxb; Wed, 1 Sep 2021 10:57:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2pKy9rOkE7Dbkx9Nz2Eb+Usk/vSXmAtfP5/IjZD9xOwqnQMqdceVNjbGBHbYq9vBfTM2T X-Received: by 2002:a05:6402:c90:: with SMTP id cm16mr851119edb.170.1630519044179; Wed, 01 Sep 2021 10:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630519044; cv=none; d=google.com; s=arc-20160816; b=tRcfqlUWSgisK9fM17bajfCQsML2VYdpgR74Y48s7EzJGMLO0ekGP+1v3wIc8jSpPn R8o3FVFDK3E9I+2DQFfAm0xZOtAF1+zLLdEYEPLOMnF3qpOAzSyeEkOytnCcGLIHALnX T/gAJl2kcc4WEV12PiKGxEG9Br/0xPmpGtVqFUlim784MCghQMP+WCFUiBUEKnZ8vaQL 8TZpHc/SfDdYoJuWKt+Rk1fI+OkzPrfH6vhATbYkX9jKa5ZDMoQohmuzpGTz9UwpGE33 tbxYp/XMVQdOgcf6K1JvU88QZie/iMwd3B4GL7s//Gbi9cun3RFu6Gk6bL0HxaaNjxqS 1PGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tSZalxN4eS6zUgJ0YVZI2rOn4anzleL4h1z4IMhIKlM=; b=FgQb7vZoWFu1vAl9ocmtka3T7WehAaR6x4eiPsWBR5KUa5AvlpuykpF2Zc3UQiBY8R NLVJUh21Iv4HEMH0RbsoWjNrTiRxQQkqHYsV+7tKMKbTdpQNLL2B/XtHqj8uLOrxows9 tisKhWw6d7edi1ezXAGW6eJDYaqwqvQvH7jMybP161ZSSaHIV3+95Ix/t6gLuiYk/hVa Jo36FjnBSTyH8jKQI2Lew9HXS6GSDF8AGuUOh3i9mzMNVlIOJ6Asti5seoek71AsKR/p bK3CNiBFWM/IDpwv0SWMD1BJBQN3hrvQsQO2hATMk5ugCa1BnQAy4+12tNunAshuv2pH pE/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si270290edv.341.2021.09.01.10.56.40; Wed, 01 Sep 2021 10:57:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344554AbhIARzp (ORCPT + 99 others); Wed, 1 Sep 2021 13:55:45 -0400 Received: from rosenzweig.io ([138.197.143.207]:45114 "EHLO rosenzweig.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236754AbhIARzo (ORCPT ); Wed, 1 Sep 2021 13:55:44 -0400 From: Alyssa Rosenzweig To: dri-devel@lists.freedesktop.org Cc: Neil Armstrong , David Airlie , Daniel Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Rob Clark , Sean Paul , Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Abhinav Kumar , Dmitry Baryshkov , Lee Jones , Stephen Boyd , Kalyan Thota , Laurent Pinchart , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alyssa Rosenzweig Subject: [PATCH 1/5] drm: Add drm_fixed_16_16 helper Date: Wed, 1 Sep 2021 13:54:27 -0400 Message-Id: <20210901175431.14060-1-alyssa@rosenzweig.io> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This constructs a fixed 16.16 rational, useful to specify the minimum and maximum scaling in drm_atomic_helper_check_plane_state. It is open-coded as a macro in multiple drivers, so let's share the helper. Signed-off-by: Alyssa Rosenzweig --- include/drm/drm_fixed.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h index 553210c02ee0..df1f369b4918 100644 --- a/include/drm/drm_fixed.h +++ b/include/drm/drm_fixed.h @@ -208,4 +208,9 @@ static inline s64 drm_fixp_exp(s64 x) return sum; } +static inline int drm_fixed_16_16(s32 mult, s32 div) +{ + return (mult << 16) / div; +} + #endif -- 2.30.2