Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp750784pxb; Tue, 5 Apr 2022 21:43:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxs1eDs/NyZsHoeo0g9DPHv+LPsg/7FxXKAtIyQ+ysPhtR3pIGSt8LctnfOIbiAyTlffyf X-Received: by 2002:a17:902:a588:b0:156:599c:6278 with SMTP id az8-20020a170902a58800b00156599c6278mr6697940plb.109.1649220214685; Tue, 05 Apr 2022 21:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649220214; cv=none; d=google.com; s=arc-20160816; b=ava/Nh/f3Z7CveT+qIDB9GsfnJJQ2qUZEpx3kF1lxkRtCMOH6wilaTwbNNMyQ2nqfh 63HbXiZgmZ/wUcj2Ts/Eu6dXuKYEmMbLIFbMYAiyxx0S1Nk4q76DCmvFsk2/wLr+/I3+ iLgM05Qfidn5A9Q/Wa3fJoYFKIGA0+oo+Dtz+ibgG1scAgtNhDi55R0HOcaaMoocuDgu /K9698JTO9dMgM/d+vwAduE0jGEDyp3HN/tFvksqRGynNzpwXW59/sIvhuCJWcQNx5/Q 8OUIs1dhg9LNhgAP0UIPamvrIjb2BIrunDQjB7eLE3Bey79JLRd71kIZIEMQ5HBB4oiO Z0pw== 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=cgXkvsC0P7OIEMPb0NFjfKY8vBY+VDHupozAFkN6yU8=; b=kB50LCh1MtlIJ0yEKACF3ZcvOZ3SjC+jkYVl07ut7Pk+VO1G8OfJzgmHwaMtU7rSbp z+Lk43+uEp4IlRorjZmMRJmEolcxZ8PyJPgGwN1qsXT2nwbDPwv8ZpcwkuZ6xGP4xDZw dBRBCDSWykwudVl9q0PWTqCYONkyj4SIJ1DkgJXynINpYwCViY3i/Gzi+4ULliFHJAk1 xrE51AQJdaXUr/XQ7bYjZK3He6bXfzALA0rd4FB1N9SJ74Bae+W2/6htnayDr4rBXxWq +eWDLnvJh/Qyosq6yYwKgpAxrPLomug7q0r56jbOkQJ2047joJ1KYeiJHcjBuoV+IKC3 FMyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Il4NHh0D; 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 y16-20020a170902b49000b00155fc0b4904si14388438plr.234.2022.04.05.21.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:43:34 -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=Il4NHh0D; 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 1EA47360CF7; Tue, 5 Apr 2022 20:04:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241232AbiDEO6c (ORCPT + 99 others); Tue, 5 Apr 2022 10:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344632AbiDEJmH (ORCPT ); Tue, 5 Apr 2022 05:42:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BAB3BE9EA; Tue, 5 Apr 2022 02:27:50 -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 EC5C56165C; Tue, 5 Apr 2022 09:27:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03140C385A0; Tue, 5 Apr 2022 09:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150869; bh=/fa+W8otdX4/pIC4YUsTrMT7cnva2we2YaIsU6eSU8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Il4NHh0D3FfRPmmTDON3R6umP+EBGn4ok1Q8GN0Uk8R38N3qq+CE+gWFXfw0a2iCK AD0XfSvxECY/JaoKE0bHkwRzlkfCrOVAajDm8keKQ1G/xIjgK2+e2H2SMP9dQAIwsv VYdR8YUA/Oxu7U8Wsodbmn2D4qWuWreJ3Gmikki8= 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.15 178/913] drm/fb-helper: Mark screen buffers in system memory with FBINFO_VIRTFB Date: Tue, 5 Apr 2022 09:20:40 +0200 Message-Id: <20220405070345.189489718@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: 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 = fb->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