Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3480622imw; Mon, 11 Jul 2022 09:23:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vAt8ZKUWc501wtp4E0Uqnv6aPfOMfDZeETzIwNqE62pCFTf6rQKtgWrLPdpbDGUwrsglrJ X-Received: by 2002:a63:4462:0:b0:40d:fb07:ec27 with SMTP id t34-20020a634462000000b0040dfb07ec27mr15985486pgk.346.1657556612922; Mon, 11 Jul 2022 09:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657556612; cv=none; d=google.com; s=arc-20160816; b=o8OzhhpBwucDE+DhtZtNh1la9+H7XBw6kTAYoskNAd46l19KMRPIyvTRBOwyggpY3A 4lUmm9EfMhwuhGKaN7mcaKUc8gSJebYZeRQIhXyTnGIltaaloUayV2nvWheTJDyb4fS4 f8R+oL6r9x2ttXvEqSc3IULB4i2Cv32G57LEAGFOBjqjoeZK5CZfrLMMKT/51UWYetle pPVeZnbXy3PlYQ7CpFwfBeJQLvn1R0ugcMVtkZq8huGZmUNb7QzSgEd2zlB/Y6mXKveZ wY+IEZTYuaQwQkaLFcWV8KOlyQS18v1nCqzX8QIoZrmocqxChBKEw91CxHPPEbdGUU0e qXIA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6DvcIYc/PioFLcqGyV66PdH+sZYNgpEPGNt2XepWGjk=; b=B50EHe1u8Dn7Pr8n1Ei3YpUxHrKYY2KkO/xhyLXJ1CMMGSjOIncZE8nEi8XtgPxFz1 BVd5kxqw4Wbowds44/5KVD79rGXoSCflQs2swbz6kiy/U9qc1DkmjqVpXreogLjHij8w /k5GWnlPJHBi6PQ2JYVg3FVOQlOfQBPLjQ60Whd844TDr7sq4PbQgVXuysVJFV5Re+Je 0IbuVLMgzcWkngw1XeNTYSXrsOUILZi62AJ5CF94/TQ/9DHq/fxjitxRhVZxuryq8Smj JLutcWxRBh5CSz43Zj5/6iGMHLKwCfAWdSHcajo8INE1nUADQ/nAPXx98vEEq4Q+hddQ yjsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk16-20020a17090b33d000b001ec9d0aca51si12255156pjb.164.2022.07.11.09.23.20; Mon, 11 Jul 2022 09:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbiGKPuv (ORCPT + 99 others); Mon, 11 Jul 2022 11:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbiGKPun (ORCPT ); Mon, 11 Jul 2022 11:50:43 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1B076EAC for ; Mon, 11 Jul 2022 08:50:39 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by xavier.telenet-ops.be with bizsmtp id trqe2700d4C55Sk01rqe4f; Mon, 11 Jul 2022 17:50:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oAvgD-0036x0-N6; Mon, 11 Jul 2022 17:50:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oAvgC-006shU-Tl; Mon, 11 Jul 2022 17:50:36 +0200 From: Geert Uytterhoeven To: Helge Deller Cc: Michael Schmitz , Jonathan Corbet , linux-fbdev@vger.kernel.org, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 04/10] video: fbdev: atari: Fix ext_setcolreg() Date: Mon, 11 Jul 2022 17:50:28 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 The red, green, and blue color values are 16-bit, while the external graphics hardware registers are 8-bit. Add the missing conversion from 16-bit to 8-bit. Signed-off-by: Geert Uytterhoeven --- Untested due to lack of hardware. --- drivers/video/fbdev/atafb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c index 39c3b860a797d4bc..a36cd8f1f4200dd5 100644 --- a/drivers/video/fbdev/atafb.c +++ b/drivers/video/fbdev/atafb.c @@ -2206,6 +2206,10 @@ static int ext_setcolreg(unsigned int regno, unsigned int red, if (regno > 255) return 1; + red >>= 8; + green >>= 8; + blue >>= 8; + switch (external_card_type) { case IS_VGA: OUTB(0x3c8, regno); -- 2.25.1