Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp707825pxb; Tue, 5 Apr 2022 19:41:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0gWJiBzaHbeh79O+NCoKsHxP5SGeNa9mtWigvIL+75pa0Cy8vs6/mwjqrOa6iuF9n2/r+ X-Received: by 2002:a50:99c7:0:b0:419:225:80b6 with SMTP id n7-20020a5099c7000000b00419022580b6mr6631991edb.240.1649212874091; Tue, 05 Apr 2022 19:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212874; cv=none; d=google.com; s=arc-20160816; b=vR6Wl583oFLyyeWvxvCpwl/LlPIz1iMLChomFEt2oQMZjawhNmq9uMwgvQdlQQ9zvp 7kwoNouEaU17oq3pb4ADQw7NeRSqinCgHQE5KmSzlK4m8NAZpKaRElw1pelJKp8dvyia JCdt+bXrUNQlWQdBegb5S78l6PnY6hGNJYL85H8z5pdFwMUcJ+nesOYrVLPTEGKjShs9 JwqPPGeCJduW6W75AXB+stDVWGCUQT4t2WvdFQQrVPbKmaR+cvqDendahjzVg2lDgQBf g5+Air6cE6/j7DYwysprGmeDmDfQ3VDaw2QYTCG+VVPcZ3VkOWHzPPc4QcSGdqZZwkdL +v+w== 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=lN7YtUU0oKbBkHVBIT4CvtZEc0HDBwBxxA7oNA5DDHo=; b=MWIOxSqwRDfDT0uXUOhMKvxhRn592Gkzruc7W9JOqAcynwtHmiE2lbu93lpNswoSQC KnX60J3/rhBYIrVOvrK7FkHgKF/a6V5SKD5p1cXYH0QEG8EEaMFwZ9Nav4REPHevw6Q8 CnCsKKENxfX0MR8jZcrCiEItLsbmp6I5243Od3d18QKezz8IUty4sxtlPWU/klHWQRY7 J52YzVUjJY84seNo2FXxVdBWsJPF6VtAnFNUnWPbrDXSCXIYZmWGOQ421f8LiBkZwag1 Se2c4eyLeyfyOWWjmFxu1+lfxNb4EKjILjxHGyeSWCl7ChtoXK4Usbx/o6mP3A/o2d+I CGTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VP0JEGhX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv17-20020a170906b1d100b006df76385bf5si10615639ejb.149.2022.04.05.19.40.49; Tue, 05 Apr 2022 19:41:14 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VP0JEGhX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbiDEIDm (ORCPT + 99 others); Tue, 5 Apr 2022 04:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233232AbiDEHwO (ORCPT ); Tue, 5 Apr 2022 03:52:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2743919030; Tue, 5 Apr 2022 00:48:45 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A3DE8615C3; Tue, 5 Apr 2022 07:48:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3D97C34110; Tue, 5 Apr 2022 07:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144924; bh=IV/c1dNZq5Imz6GlTesiiw6Gbmo/NPg97KtelmdkllE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VP0JEGhXzFj5sXm+NOlf5YRK2c+kXwGPUMNrxZzzWxS81cPMuhF2LhG/C3pH8IEq+ N6B/tbYGmOx9SmeUKOkXTpZMjytjqq2HuT3QfX7SbsA7mdlCVoMo5ao1ucSfP0wy5I PSOKFmvAJGlh+sZBo6NvoPi+AEXlLoAHJtq7bNy4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Zimmermann , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: [PATCH 5.17 0186/1126] drm/fb-helper: Mark screen buffers in system memory with FBINFO_VIRTFB Date: Tue, 5 Apr 2022 09:15:33 +0200 Message-Id: <20220405070413.066504239@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Thomas Zimmermann commit cd9f7f7ac5932129fe81b4c7559cfcb226ec7c5c upstream. Mark screen buffers in system memory with FBINFO_VIRTFB. Otherwise, fbdev deferred I/O marks mmap'ed areas of system memory with VM_IO. (There's an inverse relationship between the two flags.) For shadow buffers, also set the FBINFO_READS_FAST hint. v3: * change FB_ to FBINFO_ in commit description v2: * updated commit description (Daniel) * added Fixes tag Signed-off-by: Thomas Zimmermann Fixes: d536540f304c ("drm/fb-helper: Add generic fbdev emulation .fb_probe function") Reviewed-by: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v4.19+ Link: https://patchwork.freedesktop.org/patch/msgid/20220201115305.9333-1-tzimmermann@suse.de Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_fb_helper.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2346,6 +2346,7 @@ static int drm_fb_helper_generic_probe(s fbi->fbops = &drm_fbdev_fb_ops; fbi->screen_size = sizes->surface_height * fb->pitches[0]; fbi->fix.smem_len = fbi->screen_size; + fbi->flags = FBINFO_DEFAULT; drm_fb_helper_fill_info(fbi, fb_helper, sizes); @@ -2353,19 +2354,21 @@ static int drm_fb_helper_generic_probe(s fbi->screen_buffer = vzalloc(fbi->screen_size); if (!fbi->screen_buffer) return -ENOMEM; + fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST; fbi->fbdefio = &drm_fbdev_defio; - fb_deferred_io_init(fbi); } else { /* buffer is mapped for HW framebuffer */ ret = drm_client_buffer_vmap(fb_helper->buffer, &map); if (ret) return ret; - if (map.is_iomem) + if (map.is_iomem) { fbi->screen_base = map.vaddr_iomem; - else + } else { fbi->screen_buffer = map.vaddr; + fbi->flags |= FBINFO_VIRTFB; + } /* * Shamelessly leak the physical address to user-space. As