From owner-freebsd-current@freebsd.org Tue Aug 7 08:05:36 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24A801051334 for ; Tue, 7 Aug 2018 08:05:36 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9589182883 for ; Tue, 7 Aug 2018 08:05:35 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id j5-v6so14791724wrr.8 for ; Tue, 07 Aug 2018 01:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=AQ5TEsTFnRlaJBMmqc+H88X5m5GciQjSRItWliJ0yXQ=; b=LE3YdX2vbSM4GoixyobL2YMy1/dJgYTzWQLLsiuCMDf8kaEmzk6YG8gC226ToGD6x6 uGYkmNWjUsPF5kbH8sci/3Pc9u0V7SIXkONIPa+yY+8NaFAkhtbJdejh5fdcbP/Jc+X7 BcVu/XSIHGwKssX7qnMtOe9dTHoIhR+4XqAVjGHPVF/dKDvQvpeNGhKFsxVr0n2VVBQG AzIucZLkskMHhCmZT6o+Fkcl+mx/MzEl68auHlY+EDepwbcNwRYcTbTvvayj26QM7hBE dQjO/eDSj1k/g6b066afkQXpR08s0vsdmbsJKm+e5NZJoazeMPenrav+C1MKMl2xsDx3 3h5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=AQ5TEsTFnRlaJBMmqc+H88X5m5GciQjSRItWliJ0yXQ=; b=OC0/QmTztXdzU9RJZGw3LZNfWyvLrbym0N26MrB4FYSgwG+Rbsm255k7bsRtdBIdPw NnpHfLWfL+YmqZtJHM28wgwIn/b50B5f+w9shc1tZQqq+7D1ALG+79HnBggWcZKfkHU4 TBTiQ/5jb6ND7rIev4a0o+IN4vGxLMvWEgTC8HCdznLxIl7D88G+tWSlFMqaRYYipCI+ 381DDMKF/IRfVqu0zdua/ETSivQaNMC1Xtj1QaEjibp/k6DAcn0CL+PYiwIxCYpHvhoM DaAzYX6gw3PUYRHodwyk3FYeX7/lZ4a95/N2DlRN49j4LS+onXd6QPfPL23LwZ2RHHTu d8Sw== X-Gm-Message-State: AOUpUlGTYr++uxqV2fktSibvPyj6Y/4IsUEjuZ/2pz0m6ee0lsi5+Qlc sHEwum2KdK3v6kIlV0hKyxqczBPnKqm+DD1/wVMGAnUw X-Google-Smtp-Source: AAOMgpdZinsja/Hr7vR0vUC6SoAdyT4v+QE/LQcR6WitJF62JyAr2c1uIvZNAVgxsDxPewMM5q2H24PX5Uw83P8znKU= X-Received: by 2002:adf:fe8f:: with SMTP id l15-v6mr12199941wrr.165.1533629134208; Tue, 07 Aug 2018 01:05:34 -0700 (PDT) MIME-Version: 1.0 From: Johannes Lundberg Date: Tue, 7 Aug 2018 09:04:57 +0100 Message-ID: Subject: Need to reserve Intel graphics memory in early boot To: freebsd-current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 08:05:36 -0000 Hi I'm working on getting the graphics drivers up to Linux 4.16 version and there has been a patch for Intel gpus that require some code in early boot. The problem is that no all bios report the memory allocated for the gpu, called stolen memory, correctly so on some configurations the OS can reclaim this memory during boot that thus it's not accessible to the gpu driver (at least that is my understanding). Drivers need the stolen memory for frame buffer compression (fbc) to work (maybe more features as well depend on stolen memory). The purpose of fbc is to reduce power consumption. So, what we need to do is get the base and size of the stolen memory and reserve it before the OS have a chance to claim it. This information will be stored in a global variable that the drm i915 driver can later read. The Linux implementation can be found here: https://elixir.bootlin.com/linux/v4.16/source/arch/x86/kernel/early-quirks.c#L539 The drm and i915 driver code are dual licensed but I'm not sure about the code in the file above, it might be GPL only. Anyone feeling up to doing this? Or if you have any pointers as to where would be a good place to implement this in FreeBSD, I can give it a shot. Cheers