From patchwork Wed Aug 30 15:45:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 137211 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4732761vqm; Wed, 30 Aug 2023 12:24:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/o5N6FhekeXxSJPmaH2O9WGJ+FFNUViZVMYfITdSIotjPo8aipYfG4AtYSD735mFgUSqL X-Received: by 2002:a17:906:51d4:b0:9a2:2635:dab6 with SMTP id v20-20020a17090651d400b009a22635dab6mr2608929ejk.47.1693423497948; Wed, 30 Aug 2023 12:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693423497; cv=none; d=google.com; s=arc-20160816; b=ApvTG4r1wacUm9p5i+MkLCI5VinsBLqbeeuiYWmQcsXK7w5fbZOp9KOQxxa0uQ3Zuk mnGWtBEFxjR3MQ0MNA+3QeaocdadBJZPLc5LDnbZEMJl/AQJkD1fjEn8s9l03I8rYTrf wZ5psdQlj0v0Xv2wY+H8b5PJeRxzSkcsiS9L6yFZxm88QRx7G2EE68WDWKW1XG1FlpB+ tv2JtDiVCtyiZ5DchpSocXWhYE86hmMkzoUX8nU+gcRTcN2phT+Rp+PQtaLTNNgY8vv0 3pDvAHycXDJMZ+R+9H5pUjZa3gR7foyq73FYG0hZ7Xw8JGc3kVRLUnjy8IImz4W4MWHb ZuaQ== 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=EpugbVW7mtiiSW8eZXHNn4mn2mDo7nLoE6c1j8PnRfA=; fh=F322SQGktmtfJ1ONvgY0z4T/sqHVXRDKHFKKMjSETX0=; b=YbJoWze1Fz7GLZ7BiIg1HcgL3sIrq7xSo5UWVZnqrV+e3FvGTtNpcNv9XNW8BdeeoO a3JwNmn4RCJq3/ln536ayerc1owIbTEW/vQBiyayRSlTi/ZzNilnrdPexW+UG2saeorU FSHl3Ia5dXc25PrgCOx0d+2ypte5XCf7yTJlCB12VAHlPXJW1IhgThSVYMo+hRXhbmF/ xiWWe989Zm2gt1LHUksyYyHjKCNN3r3HVES9kI/PenXR5gc+CJkB8UTqAUBDi4NaGbpl x4l3omCaNzL+eiuy1/yoDvGTlfHX3v0djPu0dILejre/OBL17rSHz0ootiH5F3bQC01t ckxw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z5-20020a170906714500b0099327746bd7si7376611ejj.520.2023.08.30.12.24.20; Wed, 30 Aug 2023 12:24:57 -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 S242071AbjH3TUF (ORCPT + 99 others); Wed, 30 Aug 2023 15:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245639AbjH3Ppw (ORCPT ); Wed, 30 Aug 2023 11:45:52 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E9D9122 for ; Wed, 30 Aug 2023 08:45:48 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8DxFegqZO9klyEdAA--.443S3; Wed, 30 Aug 2023 23:45:46 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxviMqZO9kjVRnAA--.12491S3; Wed, 30 Aug 2023 23:45:46 +0800 (CST) From: Sui Jingfeng To: Patrik Jakobsson , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] drm/gma500: Print the stolen memory base and size with drm_info() Date: Wed, 30 Aug 2023 23:45:44 +0800 Message-Id: <20230830154546.499987-2-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230830154546.499987-1-suijingfeng@loongson.cn> References: <20230830154546.499987-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxviMqZO9kjVRnAA--.12491S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj9xXoWrKF4kKr4UAF47AFWUur4rWFX_yoWfJFc_K3 ZxZrsxGr17uanrAF4rZr1S9r90y3WIvF48XF40qay5K3sruwnxX34j9r93WrW5Ja13Ga4D t3Z8Xr93tFn7GosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7xYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Cr1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j83kZUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775683237691089345 X-GMAIL-MSGID: 1775683237691089345 while at it, also replace the 'K' with 'KiB'. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/gma500/gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 4b7627a72637..6fe78f61e127 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -344,8 +344,8 @@ int psb_gem_mm_init(struct drm_device *dev) stolen_size = vram_stolen_size; - dev_dbg(dev->dev, "Stolen memory base 0x%x, size %luK\n", - dev_priv->stolen_base, vram_stolen_size / 1024); + drm_info(dev, "Stolen memory base 0x%x, size %luKiB\n", + dev_priv->stolen_base, vram_stolen_size / 1024); pg->stolen_size = stolen_size; dev_priv->vram_stolen_size = vram_stolen_size; From patchwork Wed Aug 30 15:45:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 137195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4724238vqm; Wed, 30 Aug 2023 12:08:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPVKF9oWm6c7OdklraPbul8lsMI4jDOtYCkIKeFA3LYeYmSoH/+Sc/9B+QRWQ0VRendfpU X-Received: by 2002:a17:907:9501:b0:9a5:c3f9:c89d with SMTP id ew1-20020a170907950100b009a5c3f9c89dmr1938183ejc.24.1693422501993; Wed, 30 Aug 2023 12:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693422501; cv=none; d=google.com; s=arc-20160816; b=rPElHmodvQJhc09NaP7/mtXtyPUzBM9tFmBbUzPyDI282qrTTfhUV9ENvUd53YEBpF GQqIBwd/I0E5ADloJ+0IFBoghq59E6SKtb1iGdtbW5Ui8qdczVdKS32CmHAvZ5HjWZRd vJ7hA//mfmvXb73lZSGz3QRmyCUf6nuSP3Idl6U9/kwi1XKAhoaNbgmHppZa/xMs6pxI cuV6oHu9WZLlJv7F/ni1K6J5/nUqkMEjucS34YzVB9SxH6KKkPV30bwyaaBp8ZXfEyhp 0UheazBkWohFci1FfmZMF6D20jFmpFCqPEt3rPU4p2SQuDIsWZCJXN2Yu02ivgYbE0SK j10g== 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=XaQC47vb9n6iQQLnwtF1sXAjvvKW9qqkYrM4yVEgpso=; fh=F322SQGktmtfJ1ONvgY0z4T/sqHVXRDKHFKKMjSETX0=; b=nV1Q8JBlieg11X79fXgzTjLe6cEqtnB/7rrZvhymLHbEC4HszNE2yTKHmaWu6fT/wR afFpqdNGKY48Tx+iRiEWwoNB7L5vSQEE85NFWMkCRe76IstJrnkvpfZB0rzAS85O+O8i 8nDY/PDxhfo/tp2+KKi+/0MSmLQqAO4glP0Gwoja/LQ3f70T36Bpet3U93Yz07b1v5B4 rCmG2b+dHSd2ND6sy9tBEKvuBJJPbrcvEP8cjun6yOxnt2KoPBKxTV+P8gbabRGLwF8T ui1O20D90XWsGx2oaZmlhYoFm1OltNsX1//FXNnND8XYAM6kTtpv4vsWOPBTBwk4rTvx fkEw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl11-20020a170906e0cb00b00996d0a9b50csi6434764ejb.234.2023.08.30.12.07.52; Wed, 30 Aug 2023 12:08:21 -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 S232571AbjH3TEG (ORCPT + 99 others); Wed, 30 Aug 2023 15:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245640AbjH3Ppw (ORCPT ); Wed, 30 Aug 2023 11:45:52 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 16E88132 for ; Wed, 30 Aug 2023 08:45:48 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8Cx7+sqZO9kmyEdAA--.58305S3; Wed, 30 Aug 2023 23:45:46 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxviMqZO9kjVRnAA--.12491S4; Wed, 30 Aug 2023 23:45:46 +0800 (CST) From: Sui Jingfeng To: Patrik Jakobsson , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] drm/gma500: Print the start address of the GTT Date: Wed, 30 Aug 2023 23:45:45 +0800 Message-Id: <20230830154546.499987-3-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230830154546.499987-1-suijingfeng@loongson.cn> References: <20230830154546.499987-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxviMqZO9kjVRnAA--.12491S4 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj9xXoW7GrW5WF4fWw1xurWxZF1UJwc_yoWfXFXEga yUArZxGryqkFs8GFs7Zrs5AFy2ya4avF4vvan2qa43Gr98Ar17X34jgF95X3yxXa17KFnr JwnrXF10kFsFkosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7xYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JF0_JFyl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Cr1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv67AK xVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j5l1kUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775682193810158761 X-GMAIL-MSGID: 1775682193810158761 The PGTBL_CTL register provides the starting physical memory address of the Graphics Translation Table (GTT). We want to see what's the value in it. This patch is useful for debug. Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/gma500/gtt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c index 379bc218aa6b..112418301866 100644 --- a/drivers/gpu/drm/gma500/gtt.c +++ b/drivers/gpu/drm/gma500/gtt.c @@ -243,6 +243,8 @@ static void psb_gtt_init_ranges(struct drm_psb_private *dev_priv) gtt_mem = &pdev->resource[PSB_GATT_RESOURCE]; } + drm_info(dev, "Phys start of GTT: 0x%llx\n", (u64)gtt_phys_start); + pg->gtt_phys_start = gtt_phys_start; pg->mmu_gatt_start = mmu_gatt_start; pg->gtt_start = gtt_start; From patchwork Wed Aug 30 15:45:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 137193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4719056vqm; Wed, 30 Aug 2023 11:59:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFW7ggwbiskcnGcHu8cCT8a9WXyZyFzbbY3QSPkgQS4fSpVRofbbvHSsso3spUd3Tcnv8pA X-Received: by 2002:a05:6a20:13d2:b0:14e:429e:b0e3 with SMTP id ho18-20020a056a2013d200b0014e429eb0e3mr3174237pzc.52.1693421986694; Wed, 30 Aug 2023 11:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693421986; cv=none; d=google.com; s=arc-20160816; b=F0d9rcH9y2zeBPujomF9qGiunAIOHL6KK81M7VLA6b8LbHkB8bn+xeMbY6nFBsQ6Zc lXp3VkAFosndLHGdIEda7h7u49zXYDXaFzyuy9TVWyF9lVV9bHRqESHNb3iefenweeZ7 RRvu7ijkqYJtAc0l+SuQA1UojYjPg8tLqaTTPdh9exqftA0bXMaf2IitPvL0tDGVNCbN 3PdVXCqM9RyNLV85GIdx1TAa+1KnYOqG/hsrjjQ230TVsHCNI0QdMxF1lcs/G0S91NXD Sn/5pIZzLryGFe7O52hktAXiYy07LzMTXpwhEAq/fmVUaXUdjMfGFjhA4H6nIVHwIa2/ WIiQ== 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=kxE0P+a9ucrTiyIv+ewZ5ZV/AaUrlJwl8I39VM3d4DI=; fh=F322SQGktmtfJ1ONvgY0z4T/sqHVXRDKHFKKMjSETX0=; b=DiMb4m3nN6Yb6hCfhPU+mRuw3EhYj0gTd303xROalMyWrf7Gi/cH+lgP/YkW6disc6 bKiDnl6fBxbBYJjcBYAq5JLCdU33SkKvbCfZtbY7VIH7K+h28pZCc7gAxOZdl/nHOZIA j2rUJ3QU1YGInhOhGH+Zw2tsQ4zacKGs97+hhiX/7p3KOOzxgQsF0N0UY/JvD8KEuEfY le3DB6D2+jXBrBIQ8dnKkKu3FGewrxc+GtvSkSQp0zYR4c5eJOPT0BR50sn6ga4hFGmm W8Kq6U7uLa1GJbtGLeVNHcB/VOdnquve/m4NOyL3bpvQNg7CMS6b6wLXsnX6ee8396uf 8uWw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a656691000000b0056a670ebd71si12836447pgw.667.2023.08.30.11.59.29; Wed, 30 Aug 2023 11:59:46 -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 S232624AbjH3S6R (ORCPT + 99 others); Wed, 30 Aug 2023 14:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245641AbjH3Ppy (ORCPT ); Wed, 30 Aug 2023 11:45:54 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2E0D11A3 for ; Wed, 30 Aug 2023 08:45:48 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8CxbesqZO9knSEdAA--.57301S3; Wed, 30 Aug 2023 23:45:46 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxviMqZO9kjVRnAA--.12491S5; Wed, 30 Aug 2023 23:45:46 +0800 (CST) From: Sui Jingfeng To: Patrik Jakobsson , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drm/gma500: Fix the failure to map the stolen memory Date: Wed, 30 Aug 2023 23:45:46 +0800 Message-Id: <20230830154546.499987-4-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230830154546.499987-1-suijingfeng@loongson.cn> References: <20230830154546.499987-1-suijingfeng@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxviMqZO9kjVRnAA--.12491S5 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxWF13GFWkJF45uFW8uFy7XFc_yoW5XF4rpF ZIqa12grWkJFWIyr4UWryUW3Way3Z7ua4xWr1fCryxuw43KFWkXr98JayYgrWrXr1DJrs2 v39rtw1S9w48AagCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUv2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1a6r1DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v2 6F4UJVW0owAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8C rVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtw CIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x02 67AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr 0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUbCz uJUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775681653042544582 X-GMAIL-MSGID: 1775681653042544582 When another discrete video card(SM750 or AST1400) is mounted into the mini PCIe slot of my ASRock AD2550B-ITX board, the gma500 drivers fails to work. It probably because the UEFI firmware of that board forget to initialize the PSB_PGETBL_CTL reg, therefore the value of dev_priv->pge_ctl is 0, then the value of gtt_phys_start is also 0. On normal case, the value of the dev_priv->stolen_base is 0xbf800000 for this board, so the value of the vram_stolen_size will be negative in this case, the calculation of the stolen vram size of drm/gma500 is pasted at below: vram_stolen_size = pg->gtt_phys_start - dev_priv->stolen_base - PAGE_SIZE; = 0 - 0xbf800000 - 4096 = 1056764 KiB Which is so large, so this cause the ioremap_wc() fail, see below dmesg for more information. gma500 0000:00:02.0: enabling device (0000 -> 0003) gma500 0000:00:02.0: GPU: power management timed out. gma500 0000:00:02.0: [drm] Phys start of GTT: 0x0 gma500 0000:00:02.0: [drm] Stolen memory base 0xbf800000, size 1056764KiB x86/PAT: systemd-udevd:386 conflicting memory types bf800000-fffff000 write-combining<->uncached-minus x86/PAT: memtype_reserve failed [mem 0xbf800000-0xffffefff], track write-combining, req write-combining ioremap memtype_reserve failed -16 gma500 0000:00:02.0: Failure to map stolen base. gma500: probe of 0000:00:02.0 failed with error -12 Regardless, we want this driver works even there have another video card mounted. This patch solve this problem by given 8M stolen memory if the value of pg->gtt_phys_start is zero. And after apply this patch, it works fine. $ dmesg | grep drm gma500 0000:00:02.0: [drm] Phys start of GTT: 0x0 gma500 0000:00:02.0: [drm] Stolen memory base 0xbf800000, size 8192KiB [drm] Initialized gma500 1.0.0 20140314 for 0000:00:02.0 on minor 0 gma500 0000:00:02.0: [drm] fb1: gma500drmfb frame buffer device Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/gma500/gem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 6fe78f61e127..0e9971bb24fa 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -340,7 +340,11 @@ int psb_gem_mm_init(struct drm_device *dev) pg = &dev_priv->gtt; pci_read_config_dword(pdev, PSB_BSM, &dev_priv->stolen_base); - vram_stolen_size = pg->gtt_phys_start - dev_priv->stolen_base - PAGE_SIZE; + + if (pg->gtt_phys_start) + vram_stolen_size = pg->gtt_phys_start - dev_priv->stolen_base - PAGE_SIZE; + else + vram_stolen_size = 8 * 1024 * 1024; stolen_size = vram_stolen_size;