Show a patch.

GET /api/1.1/patches/9289/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 9289,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/9289/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9289/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<5279f1e6-262b-5ace-0f4c-bff2cfdccb11@uajain.com>",
    "date": "2020-08-11T20:06:22",
    "name": "[libcamera-devel,RFC] ChromiumOS build instructions for amd64-generic board",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "776bc7ea4782bc578ace10c61cfcdce9de2a8d2a",
    "submitter": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/people/1/?format=api",
        "name": "Umang Jain",
        "email": "email@uajain.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/1.1/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/9289/mbox/",
    "series": [
        {
            "id": 1214,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1214/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1214",
            "date": "2020-08-11T20:06:22",
            "name": "[libcamera-devel,RFC] ChromiumOS build instructions for amd64-generic board",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1214/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9289/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9289/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 240A4BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 11 Aug 2020 20:06:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9EC3860DCA;\n\tTue, 11 Aug 2020 22:06:26 +0200 (CEST)",
            "from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B6036055A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 11 Aug 2020 22:06:23 +0200 (CEST)",
            "by filterdrecv-p3mdw1-7ff865655c-g882x with SMTP id\n\tfilterdrecv-p3mdw1-7ff865655c-g882x-20-5F32FA3E-46\n\t2020-08-11 20:06:22.601369117 +0000 UTC m=+1129812.079538171",
            "from mail.uajain.com (unknown)\n\tby ismtpd0005p1hnd1.sendgrid.net (SG) with ESMTP id\n\tgf3iHdpbSVaPamYUlxWFjw for <libcamera-devel@lists.libcamera.org>;\n\tTue, 11 Aug 2020 20:06:22.157 +0000 (UTC)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=uajain.com header.i=@uajain.com\n\theader.b=\"c+yMUiPF\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com;\n\th=from:subject:mime-version:to:content-type:content-transfer-encoding;\n\ts=s1; bh=GceoeEPW9/eVr2M2jKnW+ob+JIjQRn+C8hRZd7TBW00=;\n\tb=c+yMUiPFSX5X+CjyYnNWrzTsNUCnBOVlrbIyVzjDGxptpgRywTbbNyv/jnz/ct+ioUzr\n\tFKP9+SAxIRAf+22SDTvkOa/uQ28VOxoFXb8hSOwn3fV2Mp3gINVdb4rFPg3P7VzDrWud9F\n\tBZuqDg2Kccl/v0drJgeH5ww3AZtPnfX8s=",
        "From": "Umang Jain <email@uajain.com>",
        "Message-ID": "<5279f1e6-262b-5ace-0f4c-bff2cfdccb11@uajain.com>",
        "Date": "Tue, 11 Aug 2020 20:06:22 +0000 (UTC)",
        "Mime-Version": "1.0",
        "X-SG-EID": "1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcj9TjcWbOI2k4lJ0fKJaee+q97FMIpgsLYTFSsmKwTnwLJVTFLXZiYpBs7cQ9AfbUpPU1wQ6MJuxzV5R7pS1zoDzTsKck+YG8+TK/8oVtiNiZKZ+Byw1rEuHCdaqiWCx8GLmew3u+v5ZXYMszaronaPvfeHQ7yEff+2BeC6k/Mf26mBytZQUgEmeqmUsk0PtMJEe6Lk3bJtEz7J1LbdlWGQ==",
        "To": "libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Content-Language": "en-US",
        "Subject": "[libcamera-devel] [RFC] ChromiumOS build instructions for\n\tamd64-generic board",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Content-Transfer-Encoding": "base64",
        "Content-Type": "text/plain; charset=\"utf-8\"; Format=\"flowed\"",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Guide format: .markdown\n===============================\n\n\n# Chromium OS build for board amd64-generic\n\nReference guide: \nhttps://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md\n\nThis particular guide is a supplement guide for building chromium OS for \na `amd64-generic` board. It is recommended to have a read of the \nreference guide above because most of the steps in this guide are \nextracted from there. This guide primarily focuses on few nuances that a \ndeveloper might face while building CrOS for first time for \namd64-generic board.\n\n### Download the source\nPrepare the prerequisites and download the source as per the reference \nguide on the development machine.\n\n### Building CrOS for --board=amd64-generic\n\n#### Creating the chroot:\n- Open terminal and  `cd` to the chromium source directory : for e.g. \n`cd ~/src/chromiumos`\n- `cros_sdk --nouse-image` (without --nouse-image, running `cros_sdk` \ndoes nothing for me)\n\n#### Enter the chroot:\n- `cros_sdk` - Running `cros_sdk` in ~/src/chromiumos will now help you \nenter the chroot.\nWhile in the chroot you will see a special “(cr)” prompt to remind you \nthat you are there for e.g.:\n`(cr) ((431cf23...)) uajain@localhost ~/trunk/src/scripts $`\n\n#### Prepare for the build:\n- CrOS needs to be built for specific board, in our case, it's \n\"amd64-generic\". We need to export $BOARD var inside the chroot so that  \nit's easier to specify in subsequent build commands.\n`(cr) export BOARD=amd64-generic`\n**Tip**: If you want $BOARD var being set automatically everytime you \nenter the chroot, it is recommended to set this in `~/.bashrc`\n`(cr) echo \"export BOARD=amd64-generic\" >> ~/.bashrc`\n\n- After this, you need to setup the board by: `(cr) $ setup_board \n--board=$BOARD`\n\n#### Build packages and test image (and go get some coffee!)\n- `./build_packages --board=${BOARD} --nowithautotest`\nThis will start building the packages and will take quite a long time to \ncomplete.\n- After the packages are built (and hopefully you didn't receive any \nerrors) - now is the time to build a test image which can be flashed \nonto a flash drive:\n` ./build_image --board=${BOARD} --noenable_rootfs_verification \n--adjust_part='STATE:+3G' test`\n\n#### Flash the image and testing\n- After `./build_image` is completed, the instruction to flash to a USB \nwill be displayed. Generally it will be:\n`(cr) ~/trunk/src/scripts$ cros flash usb:// \n../build/images/amd64-generic/latest/` followed by USB selection. The \ndrives I used were 16+ GB flash drives.\n- Boot a x86_64 device (DUT) from this USB. You might need to play \naround with BIOS and/or disable secure boot for it to work.\n\n#### Enable debug features:\nWhen the system is booted up from USB from the first time, you have an \noption to enable debugging features.\nEnable the debugging features. One might see a flash screen \"Something \nwent wrong\" while enabling it, but it doesn't cause any harm and \nprobably it has already enabled the debugging features.\n\n#### Updating the kernel:\n- Now that your test image works, it's time to know the kernel version \nof the build. Simply enter the console on DUT by pressing [Alt} + [Ctrl] \n+ [F2 or F3 ...]\n- After getting to the console, you need to login. I generally use \ndefault user and password provided by the test build - User: `chronos` \nPassword: `test0000`\n- [After a successful login] Query $`uname -r` to know the kernel \nversion. It is a high possibility that the kernel version is `4.14` has \nbeen deployed and we need to update it to `>=5.1` in order for libcamera \nintegration.  If the version already reported is `>=5.1` you can skip \nthis step.\n- **Tip**: Recommended reading of `emerge-` and `cros deploy` at this \npoint, from the reference guide.\n- On your development machine, inside chroot:\n`emerge-${BOARD} -C chromeos-kernel-4_14 && emerge-${BOARD}  \nchromeos-kernel-5_4`\nThis will unlink kernel-4_14 and build chromeos-kernel-5_4 in the ebuild.\n- Since it's the kernel, CrOS has a special script for it's deployment \nand traditional `cros deploy` for packages is not used here. The concept \nof deployment, more or less is the same as seen from the build user's \npoint-of-view.\n`./update_kernel.sh --remote <remote_ip> chromeos-kernel-5_4`\n- The `./update kernel.sh` will update the kernel and also restart the \nsystem.\nHopefully, the new kernel has been deployed; to check that refer and \nrepeat to the first 3 steps of this section.\n\nAfter updating the kernel, if you see a black screen with the mouse \narrow in center, follow on to the next section, otherwise, skip it.\n\n#### Black screen with mouse arrow on kernel update:\nThis has been found after updating the kernel to `v5.4` on Haswell(or \nolder) systems. This particular issue is about X-Tiling on these \nplatforms which are causing this graphics issue. We will simply disable \nthe X-Tiling for now, to make it work. The changes to be done is a \nplatform module named `minigbm`.\n\n- On the development machine,  inside chroot:\n$ `(cr) cros_workon-$BOARD start minigbm` (Refer to `cros_workon` \ndocumentation from reference guide)\n- Apply the following patch in `~/trunk/src/platform/minigbm/i915.c` file\n```diff\n+       //                   &metadata, scanout_and_render);\n\n         metadata.tiling = I915_TILING_Y;\n         metadata.priority = 3;\n@@ -271,9 +271,9 @@ static int i915_bo_compute_metadata(struct bo *bo, \nuint32_t width, uint32_t heig\n                                     uint64_t use_flags, const uint64_t \n*modifiers, uint32_t count)\n  {\n         static const uint64_t modifier_order[] = {\n-               I915_FORMAT_MOD_Y_TILED,\n-               I915_FORMAT_MOD_X_TILED,\n                 DRM_FORMAT_MOD_LINEAR,\n+               I915_FORMAT_MOD_Y_TILED,\n+               I915_FORMAT_MOD_X_TILED\n         };\n         uint64_t modifier;\n         struct i915_device *i915 = bo->drv->priv;\n@@ -289,6 +289,7 @@ static int i915_bo_compute_metadata(struct bo *bo, \nuint32_t width, uint32_t heig\n                 modifier = combo->metadata.modifier;\n         }\n\n+       modifier = DRM_FORMAT_MOD_LINEAR;\n         /*\n          * i915 only supports linear/x-tiled above 4096 wide\n          */\n```\n\n- Build this `minigbm` patched version and deploy it to the system.\n  `(cr) ~/trunk/src/scripts$   emerge-${BOARD} minigbm`\n   `(cr) ~/trunk/src/scripts$   cros deploy <remote IP of DUT> minigbm`\n- Restart DUT and boot it again from USB. Hopefully you should see a  \nfunctional login screen at this point with an updated kernel (v5.4).\n\n#### Proceed to Libcamera integration as per \nchromiumos-libcamera-integration.txt\nIn order to test the libcamera integration, you can use the `cam` \nutility tool on the DUT console (console can be obtained by [Alt] + \n[Ctrl] + [F2, F3...]. If the `cam` reports the cameras present on \nsystem, your libcamera integration has been successful.\n\nOtherwise, if it happens so that no cameras are reported, one needs to \ncheck for the CONFIG_MEDIA_CONTROLLER kernel config option. To check the \nkernel config, logged in as `chronos` user on DUT console:\n$ `sudo modprobe configs `\n$ `zcat /proc/config.gz | grep CONFIG_MEDIA_CONTROLLER`\nIt will probably output  `# CONFIG_MEDIA_CONTROLLER is not set`.\nIf you are hitting this issue, you need to enable this(and related) \nkernel configuration for libcamera to work.\nThis can be very tricky to work out in my honest opinion. Refer to the \nfollowing guide in order to playaround with kernel configuration: \n[https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-configuration](https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-configuration)\n*[This sections needs further expanding ]*",
    "diff": "diff --git a/i915.c b/i915.c\nindex bccc0b5..821953c 100644\n--- a/i915.c\n+++ b/i915.c\n@@ -102,13 +102,13 @@ static int i915_add_combinations(struct driver *drv)\n         render = unset_flags(render, linear_mask);\n         scanout_and_render = unset_flags(scanout_and_render, linear_mask);\n\n-       metadata.tiling = I915_TILING_X;\n-       metadata.priority = 2;\n-       metadata.modifier = I915_FORMAT_MOD_X_TILED;\n+       //metadata.tiling = I915_TILING_X;\n+       //metadata.priority = 2;\n+       //metadata.modifier = I915_FORMAT_MOD_X_TILED;\n\n-       drv_add_combinations(drv, render_formats, \nARRAY_SIZE(render_formats), &metadata, render);\n-       drv_add_combinations(drv, scanout_render_formats, \nARRAY_SIZE(scanout_render_formats),\n-                            &metadata, scanout_and_render);\n+       //drv_add_combinations(drv, render_formats, \nARRAY_SIZE(render_formats), &metadata, render);\n+       //drv_add_combinations(drv, scanout_render_formats, \nARRAY_SIZE(scanout_render_formats),\n",
    "prefixes": [
        "libcamera-devel",
        "RFC"
    ]
}