Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1001425pxb; Wed, 6 Apr 2022 06:26:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMM4MCQ3gV9z1RpkdEeUKXofrkT8ZtpN8CLXIBMXmXLyw05BXQ8sxU/eanp1kLy33NKYrZ X-Received: by 2002:a65:5bc6:0:b0:399:4c5a:20c1 with SMTP id o6-20020a655bc6000000b003994c5a20c1mr7074656pgr.1.1649251616805; Wed, 06 Apr 2022 06:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251616; cv=none; d=google.com; s=arc-20160816; b=ei3LK4J71o1uwkOAevm168ee7E1FdeUxNCJly4a+jd6xQe1SLOp+paEcZ1GND0b81C scW+rOzm1AXFmLeLkv6Mk0NpGjNvLrC2LOpttyqsZxGZ7AWkC1EaKCivD3fLTfG9ylfB 4VAT/pAlda7HYD/wFZxbefdAhvuepw8NR7xepFKmHHgTzStLxlVKGgPXZfD7Pz+ayEF/ zjl3s2DLbyW+G9/NmLBl13OhZ9RgqvGNSdj6AR2zjwEk9MIj4fj16JI4Jhq1L1L6VDTJ zuBb+07ufWeV4Hlym7Y/9/XWW8YdllPdzNgb2KCppw0HvqOXSlMRhXMrDTX+sGLem84i GNqw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pbBjW72Mil3rqpHv04+hmnzuMJGkAuQUobeEgBkDAm0=; b=ts//XW6VHiF+Hnh7aa5mccZh2McLnNPGBZiIhCoDs/I1XK1AM7xllIgyRVoPr90U3o 1eqeaN4uiH23eSAixSXfte2eHLy7s8/hHCSzpiWo4Ea2KGUY4n/Sb+hNd25jcOY7prs6 y+g0ktgEmtcXI0iCoAmm7mU8dKdyeyBc+hqcl9qAgnPw1jOgojyND+2c6j47VMl63Fer WyI3tufYUyIxPTqrrZTJCudtKzfolUEiBSp0dBXT0154QAgOZ083BKOQkwJj69A2VMhw EI3aZ/PYXGzjAt5v/R1iMWAaZQOCzOtzey1ZrTedk+C7GjovpaELm8cvBv7BIrqxKl1U KXCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WuDYAUIb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id oc1-20020a17090b1c0100b001bfc572d5b1si5275848pjb.38.2022.04.06.06.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:26:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WuDYAUIb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E43C3C4FEA; Wed, 6 Apr 2022 04:03:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1837668AbiDFAqD (ORCPT + 99 others); Tue, 5 Apr 2022 20:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348258AbiDEJrT (ORCPT ); Tue, 5 Apr 2022 05:47:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0509413D2D; Tue, 5 Apr 2022 02:33:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 522E7B81C82; Tue, 5 Apr 2022 09:33:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B29A4C385A2; Tue, 5 Apr 2022 09:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151213; bh=hGfpX2/660mo2vFk//XI/hXob0LrOy9/SJhBumtFWJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WuDYAUIbCjncfIgr593vac5yeA5wtTQN3qcqBVuWk4kgNf85dvq3ntS05shBz1kDE 4cFCTQMY5/q8L/ndvCXnYIYTeuCyp1ZbdIYYRfT+zSdvAgjRh1wYg73q5pQ7S8NB9A RPzO0oH75bebzwnbrmmG+1ggAkZcuwAqSjhaD9GU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jammy Huang , Joel Stanley , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.15 287/913] media: aspeed: Correct value for h-total-pixels Date: Tue, 5 Apr 2022 09:22:29 +0200 Message-Id: <20220405070348.461014255@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jammy Huang [ Upstream commit 4b732a0016853eaff35944f900b0db66f3914374 ] Previous reg-field, 0x98[11:0], stands for the period of the detected hsync signal. Use the correct reg, 0xa0, to get h-total in pixels. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Jammy Huang Reviewed-by: Joel Stanley Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/aspeed-video.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index debc7509c173..757a58829a51 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -151,7 +151,7 @@ #define VE_SRC_TB_EDGE_DET_BOT GENMASK(28, VE_SRC_TB_EDGE_DET_BOT_SHF) #define VE_MODE_DETECT_STATUS 0x098 -#define VE_MODE_DETECT_H_PIXELS GENMASK(11, 0) +#define VE_MODE_DETECT_H_PERIOD GENMASK(11, 0) #define VE_MODE_DETECT_V_LINES_SHF 16 #define VE_MODE_DETECT_V_LINES GENMASK(27, VE_MODE_DETECT_V_LINES_SHF) #define VE_MODE_DETECT_STATUS_VSYNC BIT(28) @@ -162,6 +162,8 @@ #define VE_SYNC_STATUS_VSYNC_SHF 16 #define VE_SYNC_STATUS_VSYNC GENMASK(27, VE_SYNC_STATUS_VSYNC_SHF) +#define VE_H_TOTAL_PIXELS 0x0A0 + #define VE_INTERRUPT_CTRL 0x304 #define VE_INTERRUPT_STATUS 0x308 #define VE_INTERRUPT_MODE_DETECT_WD BIT(0) @@ -765,6 +767,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video) u32 src_lr_edge; u32 src_tb_edge; u32 sync; + u32 htotal; struct v4l2_bt_timings *det = &video->detected_timings; det->width = MIN_WIDTH; @@ -809,6 +812,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video) src_tb_edge = aspeed_video_read(video, VE_SRC_TB_EDGE_DET); mds = aspeed_video_read(video, VE_MODE_DETECT_STATUS); sync = aspeed_video_read(video, VE_SYNC_STATUS); + htotal = aspeed_video_read(video, VE_H_TOTAL_PIXELS); video->frame_bottom = (src_tb_edge & VE_SRC_TB_EDGE_DET_BOT) >> VE_SRC_TB_EDGE_DET_BOT_SHF; @@ -825,8 +829,7 @@ static void aspeed_video_get_resolution(struct aspeed_video *video) VE_SRC_LR_EDGE_DET_RT_SHF; video->frame_left = src_lr_edge & VE_SRC_LR_EDGE_DET_LEFT; det->hfrontporch = video->frame_left; - det->hbackporch = (mds & VE_MODE_DETECT_H_PIXELS) - - video->frame_right; + det->hbackporch = htotal - video->frame_right; det->hsync = sync & VE_SYNC_STATUS_HSYNC; if (video->frame_left > video->frame_right) continue; -- 2.34.1