Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1966274yba; Fri, 10 May 2019 04:14:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzpdKyKcYW5aKxISQ4qj2631qp9W12cAMXM6N4zuN1NFzr3w2tA+s0yyVMBfnkGFVSV1t+ X-Received: by 2002:a62:570a:: with SMTP id l10mr12890359pfb.151.1557486856193; Fri, 10 May 2019 04:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557486856; cv=none; d=google.com; s=arc-20160816; b=ksIqckAdB88BQJqeueXD86+ODcZKLhQCMHhkCw/RN+QsYLrHeXa2O1eJ5XDaM9ZFKI l+BGLFXJS2LyOillNQpBEQCWLPfgFqzWPeIUEawlLeJgz9tr0BcjxMW2HPIR/0sRC4sI yr2yqvPlawNaFI+7vbOI5qDHJQIU7Q2Q0aN0yuJp2tgLxC4rpNzK7PIL9WqaS92ugAEr ADbv4r6EOCVCJuuZpwDP4fCCQpVNj33npLd8s9W82UpU588K86jhhq/WGXqtDfpzEyMQ 2sYVcYIkRiwWIKasx1dBswfHevZvLLfEAcCP0dPradQggOcCwe16NqDK0gKEGurFiE56 7XFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mwNtW4ZLHqLZq/gCE78v34tuA8bRj9uKouVrqeQrVKI=; b=bcMSyGhz5KTLD5tfH5nT3cU4gt6bAINYMGbyIb5QHK7n7prScMV3UThFGKxbQCNIED 2j2PSiiGSS+PV2Nrk+q/BFei8f/jddhbdYqnm6vxNfMvbFaOVEwxkAq+YxTsJmZnnav0 XZGkBQWrEqDxw0UOxbvnGBZP2bKrQI//dkHvOBzoaihVxWzQT8hBUtHOIwD2tIZH6VJl QhgqhvYVAwdEM+em1OO0/xiLzQMURw//V7g6BJMz/ltbWqu3Lz5UIOrPwO1J2GpbXd2x IFxgvRYTDRlNT/wqHJghgkD9XzUfPw5xxpygJrlAOx9EX9n3FhuD559Xq7VlVo36odp8 ETtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si7499991pgf.479.2019.05.10.04.14.00; Fri, 10 May 2019 04:14:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727257AbfEJLI5 (ORCPT + 99 others); Fri, 10 May 2019 07:08:57 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:49983 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbfEJLI5 (ORCPT ); Fri, 10 May 2019 07:08:57 -0400 X-Originating-IP: 90.89.68.76 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (Authenticated sender: maxime.ripard@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 462351C000D; Fri, 10 May 2019 11:08:52 +0000 (UTC) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Sean Paul , Maxime Ripard Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Philipp Zabel Subject: [PATCH v2 1/6] drm/rockchip: Change the scl_vop_cal_scl_fac to pass drm_format_info Date: Fri, 10 May 2019 13:08:46 +0200 Message-Id: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1557486447.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Rockchip VOP driver has a function, scl_vop_cal_scl_fac, that will lookup the drm_format_info structure from the fourcc passed to it by its caller. However, its only caller already derefences the drm_format_info structure it has access to to retrieve that fourcc. Change the prototype of that function to pass the drm_format_info structure directly, removing the need for an extra lookup. Suggested-by: Philipp Zabel Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 20a9c296d027..9c0d6b367709 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -315,14 +315,13 @@ static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, uint32_t src_w, uint32_t src_h, uint32_t dst_w, - uint32_t dst_h, uint32_t pixel_format) + uint32_t dst_h, const struct drm_format_info *info) { uint16_t yrgb_hor_scl_mode, yrgb_ver_scl_mode; uint16_t cbcr_hor_scl_mode = SCALE_NONE; uint16_t cbcr_ver_scl_mode = SCALE_NONE; - int hsub = drm_format_horz_chroma_subsampling(pixel_format); - int vsub = drm_format_vert_chroma_subsampling(pixel_format); - const struct drm_format_info *info; + int hsub = drm_format_horz_chroma_subsampling(info->format); + int vsub = drm_format_vert_chroma_subsampling(info->format); bool is_yuv = false; uint16_t cbcr_src_w = src_w / hsub; uint16_t cbcr_src_h = src_h / vsub; @@ -331,8 +330,6 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, uint32_t val; int vskiplines; - info = drm_format_info(pixel_format); - if (info->is_yuv) is_yuv = true; @@ -856,7 +853,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, if (win->phy->scl) scl_vop_cal_scl_fac(vop, win, actual_w, actual_h, drm_rect_width(dest), drm_rect_height(dest), - fb->format->format); + fb->format); VOP_WIN_SET(vop, win, act_info, act_info); VOP_WIN_SET(vop, win, dsp_info, dsp_info); base-commit: a802303934b3bd4df6e2fc8bf2e4ebced1c37556 -- git-series 0.9.1