From patchwork Wed Jan 10 06:05:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 124013 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4884336qgn; Tue, 9 Jan 2018 22:05:53 -0800 (PST) X-Received: by 10.99.1.151 with SMTP id 145mr5671834pgb.229.1515564353243; Tue, 09 Jan 2018 22:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515564353; cv=none; d=google.com; s=arc-20160816; b=KbcHHYk4A0nZCIu1q0L7/zhdp/sYCdikdBS8d/51SLTQ8gXJdFqUeMF31hNKAagzrb v8cc8XQbKBZdpAPy/U0qWzt+C67q2JSfc5745RWNqcwgjd/JhCHmnPwzVi1kikFkiARd h9FTEpxFpGvqslqtq0Qs9VNsh52JPZ/O4fYo5wXqU54IkwOTUOhP/yXgP58sy+DCKyyy 3y0Sm3w1W2n8zgg2jdWea7hAQaozZNYW9JLTo+S6LNu6SmV13gBRfXHxyuwqByVTltbS KnvM0I/rY+JRb/fz3EqI3CEUDZyC/CUpqpjUovwQyXxBloOF7XBeJy5AvgxgduxI35Ha vvqw== 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=jNL2OAE9tscDdLA8R6Yhyi7qrbhRgZBceW6DNg+h8FQ=; b=UNWvvlQjn/kISfN6FGI18M5pd5BeRS+/qXOYDFBc5TxUDMXcDUEstwRhDcX55kZDss GGGGBKlo+BMNGMCNB47/ixUtB3pJljIOtEvto+Rmv5s+si84WNP3JXfu7XQClhKRUHek +woClx0z1L1cmt5BjJsYx4QtO4Igs+fMUuyG8HFu8/QWWYFLMGoyQtkscQOnRHpIYwas qOTwZhU9gbq/BK/cXZQmYoZjSG/sI9Hv9YHtbx4FDiJG3UFpfliJldotqjdIjJjL4l3+ uYwNRASOPJh16xQ6fqJb+hi0LI0pVdKxHuiPe6H3JnxBfHHwMpEwNUFJB1PfVFt51wtL /FmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Elw+UyRR; 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 71sor1161217pfx.99.2018.01.09.22.05.53 for (Google Transport Security); Tue, 09 Jan 2018 22:05:53 -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=Elw+UyRR; 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=jNL2OAE9tscDdLA8R6Yhyi7qrbhRgZBceW6DNg+h8FQ=; b=Elw+UyRRg5s0ZmB+7MWvXlSYxUQboUkma0Kn4LwDJcCzNcGZeePXs4Zx0AjHnD3Lo7 fNAREo+M//0yUBfh4rq23uRjWldHuGTJHnKYhZjE9rK0+uagQ00Q+AJzCIJMJ8Ed0oHG 3XFmlOXgRio0x2qfA07dLWmYMiBIaGTKcrP1s= 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=jNL2OAE9tscDdLA8R6Yhyi7qrbhRgZBceW6DNg+h8FQ=; b=l6RmpNW+FkatVYx9M3AIewkoQvtWlPmc1vkNsZiH1HzPgxCpUEgiYQgqHSCUpj4R9I NB5M8boXLbHqn7YO9kylytD5sXUm0E1+tt8aLhBnnyDa/7v+braxCF8axGmMC3QA16XJ wVZyC4r0jUxIclfu7BkH63nOJwT2uzqnjO9NZ0Ab2LpOOEaO4ra8iAMtPmD9onw/2qif QlJ7Lwaw/yGiRqvbHhPLsIL/xDQkjI9VgEmFAwTNznaOgEn0/qqZzHEr3N1+ETxNqyxH zsCxysnYk60TtITLVOUNW1IZ5FjlhbjT/ZGGjwn1TqT1UzJvCi97roLxYY83hUPrOPOa EAPw== X-Gm-Message-State: AKGB3mLc3eCHDLPgE8r3U+KfoTgFXyPqXhKbNzI63ou4G/0ikvgZWDd5 bCB81uNVGhQS07ScK6VHpK6T9tj2 X-Google-Smtp-Source: ACJfBouL/umEsczffOQEWUozvN12aAnm9IIX7wwSPFJCY7FQ06NT5WDq5xBkVNErWGKrHzsUGGzWRw== X-Received: by 10.98.25.8 with SMTP id 8mr15890817pfz.62.1515564352672; Tue, 09 Jan 2018 22:05:52 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id g8sm25538595pgs.55.2018.01.09.22.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 22:05:51 -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/5] drm_hwcomposer: Changes to support HiKey/HiKey960 Date: Tue, 9 Jan 2018 22:05:40 -0800 Message-Id: <1515564345-1339-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 This patchset is an inital RFC I wanted to send out to get some early review and feedback. 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. There are a few terrible hacks involved, which I'd really love to get any guidance on how things should be properly done here. The first is I'm using Rob's patch to force use of single plane, without which I don't get anything on the screen. The second is that after getting the drm_hwcomposer running, I was seeing tons of tearing, which was exactly the behavior I'm making this effort to avoid. So I have another hack patch that removes some checks that fail which keep us from doing fence handling properly. Again, any tips for what deeper issues need to be addressed would be helpful! Finally, the third hack isn't in this patchset, but in the kernel, where with the drm_hwcomposer, on initialization, we would hit the case where it was trying to enable vsync while the crtc is off. So I worked around that here: https://git.linaro.org/people/john.stultz/android-dev.git/commit/?h=dev/hikey-hwcomposer-deps&id=30aa3e944e5c87fd4f61333a123d365e99825e3a For that last issue, I'm not sure if this is due to some quirk w/ the drm_hwcomposer initialization, or some other quirk of the kirin drm driver, but in development of this, I've also worked with an older drm based hwc implementations which didn't trigger this issue. Anyway, outside of those hacks I'm sure there can be further improvement as well, so I wanted to get it out for some initial review. If anyone wants to try the code out on either a HiKey or HiKey960, you will need this patchset 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! 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 (3): drm_hwcomposer: glworker: Add build time options for certain shader feature names drm_hwcomposer: Add platformhisi buffer importer for hikey and hikey960 drm_hwcomposer: HACK: Fix tearing on hikey/hikey960 Rob Herring (2): drm_hwcomposer: provide a common gralloc handle definition drm_hwcomposer: HACK: force single plane Android.mk | 13 ++- drmdisplaycompositor.cpp | 9 ++- drmhwctwo.cpp | 4 +- glworker.cpp | 15 +++- gralloc_drm_handle.h | 87 +++++++++++++++++++++ platformhisi.cpp | 200 +++++++++++++++++++++++++++++++++++++++++++++++ platformhisi.h | 50 ++++++++++++ 7 files changed, 368 insertions(+), 10 deletions(-) create mode 100644 gralloc_drm_handle.h create mode 100644 platformhisi.cpp create mode 100644 platformhisi.h -- 2.7.4