From patchwork Tue Jan 23 23:16:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 125602 Delivered-To: patches@linaro.org Received: by 10.46.66.141 with SMTP id h13csp50419ljf; Tue, 23 Jan 2018 15:16:48 -0800 (PST) X-Received: by 10.99.94.197 with SMTP id s188mr9264417pgb.399.1516749408119; Tue, 23 Jan 2018 15:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516749408; cv=none; d=google.com; s=arc-20160816; b=n4ERXCHZZvpSfTMTWZcC5cyEAUqsE8bqLjIGU+2L0bkuVNzfyAJC+qM3wlC6Feq1I0 Y+RffXL6g1BfGe3buJzWaqZXXXyQW4AvqVcg6DEUv+VXvOJkIpOTnS7mJxE+qPdLg8no hL669VsOvQ2AS13dGheOxY4IdmRhPL6YDKOAcnLG8dYfIQNR2cBkCogrspPHCViA2uGp HwqFxkWk7I2QxbJ61U6h2tHr5Qox3fRxz2AaowTS5vPBo5ecsPtX+cwSy3p+49zha16b zXatxQVKmiMofbkt84d4W7dz0WMMJaMTYUWiB23ZcxsoWtUAL/uYjGpbDRqGJ/eGzzNr TnWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=+YK/9m3aSBwbPMURxLG85rY00BIy7WxYRn32BLKMl5w=; b=hiJfQ8zOIb9gK/QNSavbc6SYbBHnvEch+jcmArjzTGPqO8HWUDCQlnqrSdNKlvU5CJ LtdAR44J13tcYxZxkySb2+HKF26B5g0/Xq8ukBDgEeqYIqNUjEXAq3zGH1w4G6Ii646Z PCN2iujc98dThhHKEQV5h0cbiT+SdzCzJ66t4+QQgWNOhOYbuok3DCce7+urlDxu37/m I0P3RElkh/uu2Wo8TZGLeboSvAlHDL8/+v4w8Oh7vEu1vaOhUKxboWx2ipBYSJ5ljPjY XjemnoeecA8kgZcB3uw3w1PzG9Cabrl/Q/nD5wLTSMBLMrUKy4d2qlRPBtehmK1H84D0 BnAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AD0IeoZ8; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g2-v6sor2113183pll.95.2018.01.23.15.16.47 for (Google Transport Security); Tue, 23 Jan 2018 15:16:48 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AD0IeoZ8; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+YK/9m3aSBwbPMURxLG85rY00BIy7WxYRn32BLKMl5w=; b=AD0IeoZ8vuX3dM9n1IJedkTeEHFZ+RhFmYjzJTBVErxjg4ja2Odfak/dBv/kRVLSnU 8HIOEEFx7kXlijpyc2U3QN+dN2Aioj2bQ1jXWzOlGc6GHTimHCxd6Xubu94bigCy0SIv wfmgax/t+pI5q4FZGuKHcdRoagLDsYSy4dLu0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+YK/9m3aSBwbPMURxLG85rY00BIy7WxYRn32BLKMl5w=; b=QlTCVDlPtgSW26nSzpBVBSImnxzm53oQgtaxtsjzW6GXPXH7EjDOEb1doxy0GSScQh EHdwSyVaz8R3/jz2BlaLCgYhJWv1ts6T9fNkyvLAJMO1reYxO2nPqiHU/oa1CIVwhQZy nCBOVnwffDI8UQU0fOyYWZptOO2x4Qw+4r3dXqfE2u/qUzumtiggmbL7/ri83Iy155CK H1imS3vU5a/4F4Z+m6q0Ek58ovONjVML6BxsUuDFehXsSNwSzjh7O9g82cK2kJWuPXUd ko48Ov2Pa8AQE4zVqyfEH7mSK3gTdv0M5YjQ0pXxegmH8dD8kDeetIglvndKk8uFETNT NmyQ== X-Gm-Message-State: AKwxytfT5Mbd2XY0ACPC+rhwqOvGr3YUkywiK47PnIyx4dsOdijEsiT6 X84UTQnVKaO/i38k88nx/0AzSzC/ X-Google-Smtp-Source: AH8x2256DAv+S7N8EODYvWMeBInRbbMFLZ3A5l0b42dd77gBrwr38t/xHFv7xl8mYGw9XudrsVXIFw== X-Received: by 2002:a17:902:43:: with SMTP id 61-v6mr6329243pla.73.1516749407504; Tue, 23 Jan 2018 15:16:47 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id c83sm6924811pfk.8.2018.01.23.15.16.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 15:16:45 -0800 (PST) From: John Stultz To: dri-devel@lists.freedesktop.org Cc: John Stultz , Marissa Wall , Sean Paul , Dmitry Shmidt , Robert Foss , Matt Szczesiak , Liviu Dudau , David Hanna , Rob Herring Subject: [RFC][PATCH 0/4 v2] drm_hwcomposer: Changes to support HiKey/HiKey960 Date: Tue, 23 Jan 2018 15:16:35 -0800 Message-Id: <1516749399-29504-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Here is a second revision of the early RFC patch set I wanted to send out to get some review and feedback on. I've been working to enable the drm_hwcomposer for HiKey and HiKey960 boards in AOSP, and this patchset contains the required changes to the drm_hwcomposer code to get things working. I'm really quite naive when it comes to graphics, and I'm sure I don't fully understand the drm_hwcomposer code, so forgive me if I've done anything terribly stupid here. The first two patches are, I think, mostly straightforward, the first being a bug fix, and the second adding an importer for the ARM gralloc implementations. The next two patches, while largely reworked from v1, are still a bit iffy, and I'd appreciate guidance on how to improve them. The third forcing client composition if there is only one layer and the fourth providing a glFinish() fallback which fixes on-screen tearing when the gl compositior fails to initalize. I also have two additional patches, which I've not included here - as they still need work, which get the glcompositor to properly function on HiKey960. But the curious can find them here: https://github.com/johnstultz-work/drm_hwcomposer/commits/drm_hwc If anyone wants to try the code out on either a HiKey or HiKey960, you will need just the 4 patches here on top of the freedesktop/master branch of drm_hwcomposer. You'll also need the freedesktop/master branch of libdrm. You'll need the following patches to the device/linaro/hikey project: https://github.com/johnstultz-work/android_device_linaro_hikey/commits/drm_hwc And you'll need to replace the kernel Image-dtb with one built from the following tree: https://git.linaro.org/people/john.stultz/android-dev.git/log/?h=dev/hikey-hwcomposer-deps Any thoughts or feedback will be very much appreciated! Many thanks to Rob Herring and Matt Szczesiak for help to get this working so far! And Sean Paul for his recent help working out the crtc activiation bug. Thanks so much for your time! -john Cc: Marissa Wall Cc: Sean Paul Cc: Dmitry Shmidt Cc: Robert Foss Cc: Matt Szczesiak Cc: Liviu Dudau Cc: David Hanna Cc: Rob Herring John Stultz (4): drm_hwcomposer: Make sure we set the active state when doing modesets drm_hwcomposer: Add platformhisi buffer importer for hikey and hikey960 drm_hwcomposer: Use client compositing if there is only one plane drm_hwcomposer: Try to fallback if GLCompisition fails Android.mk | 15 +++- drmdisplaycompositor.cpp | 11 +++ drmhwctwo.cpp | 7 ++ platformhisi.cpp | 200 +++++++++++++++++++++++++++++++++++++++++++++++ platformhisi.h | 50 ++++++++++++ 5 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 platformhisi.cpp create mode 100644 platformhisi.h -- 2.7.4