From patchwork Wed Apr 24 17:08:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162799 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903871jan; Wed, 24 Apr 2019 10:08:46 -0700 (PDT) X-Received: by 2002:aa7:8518:: with SMTP id v24mr27342302pfn.219.1556125726076; Wed, 24 Apr 2019 10:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125726; cv=none; d=google.com; s=arc-20160816; b=lhN3oXf9AVXhFa6nojpKM4c0O4D4S4wC5+cpjava97Lkfjws6u9+IUK+J41mvEogOa bXZhDeXLzrFNcFaRDscPVTu1gExsZLRWFIxJ2+5G1fXcuQaOhb/2EOmdZLVPgVItatuD tFU8NL0TjFBY2q1eYp/xsV3my0BRB0Bz0IWK9smmAA+9stTlSQe9ayDBAJjd7Os+BXqW iYsxtHJu3j4kBMV9GpUhK1sngCHZN0c21sCJGH10B9HrjK3E9rj0pvYAOJZnIV7l3XWf Ooc4iMbp7jJi+RRibGxz3d4LnLW//zAhvz3fYo3FwVk6pHfXhjAfgaXa0OgNzt1i6Hx8 F4XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=Hd8psFHy++bqUy4oH6/XkbD06MGx5J2DqFEcKp1h8Bm1Qp0BGUPujAnPTT3r5gn1bd kJvE8VT26NHjGF3smWNaSO3QTwZ4L2Nfzni4QK2cCfY+89BqybySfrhFoeUXlgp7Ie6g HLJBEzOILZ4ntthpMD0B/5vbVPoyRzsvXHJnTVK+gWI2ZUfpU66jY2I0cykj+Z8lUn57 adWrzfm3JKlT3L8ZeXkRBSUfrVAgQMq849G3wl+p+R/J5PEonyANj3Xf5ahue0NrYMYh 23jmvleorIQeMrvzs3h9iDWZX5H29xRx+Y1+BhlEco4H7dz/6R8PKcfCfvMyMaGNWjv+ uxdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UTf2v6St; 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 r10sor22173536pfd.10.2019.04.24.10.08.45 for (Google Transport Security); Wed, 24 Apr 2019 10:08:46 -0700 (PDT) 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=UTf2v6St; 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=UTf2v6StjvEQJI37I3dzf0v43Cliy2iqN+hDTOGB6Gn8Olsb+LvnwR3EcjXKL4+Xzl Ldr7ePtP+nu58vm3NXUzS3CVrzNuhzhDgCvM27ViArCBGv+PAz+jE/t2cwmaYCKJ5uq4 9Ltc97Eu8BJYuRf1aSSRbQ9xLnilprXhQ6V1f16h3srFZ7IwA8kLusO8kU2bj+h6DsJ9 58DXBAuRSDfH1azZDVuBwRJ7LHRbpuGysYYK4ehwj6Ji7hWzJnlu4Ff6BUmyIYlK6wl4 jOvblAtvL3oGRx6dAE3cAacdVwj5JVEplH/Xu7jKn1HETxdxXr+epfzqk8FLJFUAXfeZ XljQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=fGMCTWJCYFtCmoIcDdlw37giMEwdIgyb7vmAWnlhAbU=; b=qXB5eoKe6VBzVXR0RGZNuye9DbcpvGF53zsaIfL3TOlqQsEmHsn862QB2CuyUm3lIk Sh3BWWYy4Lzvb334uQVLD3hjrDNc37bmgxWTy/eSmqgI9XRpFLgSmlFDOBdhcps5jSQi 36fBdO1Stid5OWB3HJkZTDGFGzLk8k3XSc/pXhZwU+zy7MGbqVKPxmNkULdVjFNu6RLa 0iUgMVPWTNGH9GgPFK/mCkZyTyjvFMX5a8gwoNvaaZx96DOlzV2ZLIzHyzURiXoBRn63 K5fvOoZ9UTayex4cxao2pS3VQwIMpW+yaLT5sTtzKtCy/oLHed+dxBT39hUaYHw4LAlM OGCQ== X-Gm-Message-State: APjAAAWv55OT3OTm31UyvEAetPbiC4sXEopIiA4iTo/fCdIY1R6TE8Bc 6JYbz6xKFzKeS4B7Po9JXLdXGTbxWQ0iPg== X-Google-Smtp-Source: APXvYqz6CFw5lGSSen7EuCkTvTwvP/PD0nL/SxzVhNOmBWySmKaHoOzCFB2ss79TJh7/2xra2caRHA== X-Received: by 2002:a62:5ec2:: with SMTP id s185mr35524823pfb.16.1556125725630; Wed, 24 Apr 2019 10:08:45 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:44 -0700 (PDT) From: John Stultz To: dri-devel Cc: Sean Paul , Emil Velikov , Alistair Strachan , Marissa Wall , John Stultz Subject: [PATCH 1/6 v2] libdrm: Use mmap64 instead of __mmap2 Date: Wed, 24 Apr 2019 10:08:36 -0700 Message-Id: <1556125721-32145-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 From: Sean Paul __mmap2 isn't supported on all platforms, mmap64 is the right way to do this in android. Also folds in a fix from Stéphane Marchesin Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Acked-by: Alex Deucher Reviewed-by: Emil Velikov Signed-off-by: Sean Paul [jstultz: Folded in Stéphane's fix] Signed-off-by: John Stultz --- libdrm_macros.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.7.4 diff --git a/libdrm_macros.h b/libdrm_macros.h index 95f0ef5..0dca827 100644 --- a/libdrm_macros.h +++ b/libdrm_macros.h @@ -48,8 +48,6 @@ #if defined(ANDROID) && !defined(__LP64__) #include /* for EINVAL */ -extern void *__mmap2(void *, size_t, int, int, int, size_t); - static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, int fd, loff_t offset) { @@ -59,7 +57,7 @@ static inline void *drm_mmap(void *addr, size_t length, int prot, int flags, return MAP_FAILED; } - return __mmap2(addr, length, prot, flags, fd, (size_t) (offset >> 12)); + return mmap64(addr, length, prot, flags, fd, offset); } # define drm_munmap(addr, length) \ From patchwork Wed Apr 24 17:08:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162800 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903923jan; Wed, 24 Apr 2019 10:08:48 -0700 (PDT) X-Received: by 2002:a63:6503:: with SMTP id z3mr32319254pgb.113.1556125728337; Wed, 24 Apr 2019 10:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125728; cv=none; d=google.com; s=arc-20160816; b=BSHLjeG+Uh7t8ubVBzEDkkG8Beed+EVYFPExxVyepo5RZKG9C4+xPbJ/USi9v0Eurt F2mJcGhO0tQ6Oy9B8QksR1NhinFdAkMYgYVq0gXDCqxQZhpwiU+NEd2k2KveruVo5rqw rbic0i9+ww74UucuEVMBDQrls/kVkGA/Zjkek7VudIb8dd9cOUsLZVZIFRipAUFELWLH 1QwgJRApMg9X0vFhL3V/3oBjpOwdWAwaQDhKssDy8uJHnVWBlg9lueND52hW1tUq5ptp wMuAJ2mtOg8hVcPskhlbRswxovXS0Il0kAJHlqsijOZO1gSxtXbZj+bPFykxU0hi4wlH ONlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9+iz4QZevRRvfzFdoUmhGoUHh5WLuHlapt5scL4pmOw=; b=x4e7y/I4qGR7URlDqGe2yfl3w8YdjceznKzeLispe13y9PC3mg6My1iFjZKbA+xNtu Rdf9XOgfmqqUlWI/E/GoVzaTMrruKs7FnHe0bpvEoowvCKBfEsW5bzWv2tez51jm7YpL NYjWtes23/By9P6n1rPQEPc7ENOW//40VuFNqt0FpLfN+ajqWIWafiNYXLvDV0o/4WpX JkMAKlrSxrcYOJ1RyYDVNnP1YMv7jopkTg7rWX76P5r2rxufIAzbNEQc+c1a9U6gXp3f KiuJ5cba/LwxHMhwodcDRhAtK11zRkXWCMDqzHKKFnjOok6YKJ4qfj281F2MNipFYtlS 9j5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qiQEVXc/"; 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 f21sor3745137pfa.5.2019.04.24.10.08.48 for (Google Transport Security); Wed, 24 Apr 2019 10:08:48 -0700 (PDT) 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="qiQEVXc/"; 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:in-reply-to:references; bh=9+iz4QZevRRvfzFdoUmhGoUHh5WLuHlapt5scL4pmOw=; b=qiQEVXc/IIWj5EPnUcpbIg2Xt17LgxJLF7Ic2O4l/TR4u/53yLL+w4q8T9+/ioFnTV +a4rCye6EFaVtO6Yh08+D3jw8AMkGvpi+COHzoxwAxTY4fNjD/9jIyUeRVDP/yteaijK xRGnQC+48DWBOkUSyTsAY6+6MaOqaSA7ZCZUv4NsQUXsaUQbE00Fj4qAnrD6p/P87LtE Q875N5DZLUu0PGEnNnTS0/S889HH2EtAbjyiiGDPZHbAYdJmcF3IB5KzrViH3lXIidy1 /eDVtbjwnosQhHlxKAjfF2On4rB+8Fg2NDW+2TjEJb/I76WC+H+wZlmbtxNYfeT4HBLd EFEg== 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:in-reply-to :references; bh=9+iz4QZevRRvfzFdoUmhGoUHh5WLuHlapt5scL4pmOw=; b=pluDjEVjFDvO1A1FsUOtuDteiq8Ajqm1P1dGro9kxEkT2KSr7KhWTfvg7PsQx1G6Wb 60ULjqDJYmkuc0ccJch+8T4MALTRif56dX2eohLAJELW2vFUMpQULogxodfha2+V5XLd lrPRDYEyFCRv7LKtrf5tjDOZWjm32QKHdbO7Kj69Ksdo9O5prBcdUpd80Wd8Sw/kp7xf KsSO3E3CLJtqGT4oGAMzZvwQ44GhPF+7SKSC9VfFpxvuynGElfjqkxW7sPnNZitvUauB dTZPj5kJf5+hYBXPqyAc/fdUbPlh6OmONh24nJs0LBmbvRb3jAFVAv+pA2Xlc+QSssf5 3n1A== X-Gm-Message-State: APjAAAV1upEVqmadkN3pKu37dp8+EDLi1vG6yqIlORPJ0t7sP5+gb2yC 3PwYKCWb5SaxAO9pe+f77AVVejtl X-Google-Smtp-Source: APXvYqwfJwe0mW0WdFHM57DN2+iaUGNul2Tmeau4PwrtLWc/kKpXw0oDKSPMFZbHf64dHQxmD0lMjQ== X-Received: by 2002:a62:4e86:: with SMTP id c128mr34190550pfb.39.1556125727926; Wed, 24 Apr 2019 10:08:47 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:46 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall Subject: [PATCH 2/6 v2] libdrm: Android.mk: Add minimal Android platform check Date: Wed, 24 Apr 2019 10:08:37 -0700 Message-Id: <1556125721-32145-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> Add a check to error out on Android version K(4.4) or lower. This is due to dependency added in a previous commit on mmap64, which was introduced with Android L. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Suggested-by: Emil Velikov Signed-off-by: John Stultz --- NOTE: This change was suggested by Emil, and I've implemented it as suggested, but due to the fact that the Android.mk files are no longer usable with AOSP/master, I'm not able to test this change. Help in validating would be appreciated. --- Android.mk | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/Android.mk b/Android.mk index 1b77c53..0ab6f0f 100644 --- a/Android.mk +++ b/Android.mk @@ -21,6 +21,11 @@ # IN THE SOFTWARE. # +LIBDRM_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION))) +ifneq ($(filter 2 4, $(LIBDRM_ANDROID_MAJOR_VERSION)),) +$(error "Android 4.4 and earlier not supported") +endif + LIBDRM_COMMON_MK := $(call my-dir)/Android.common.mk LOCAL_PATH := $(call my-dir) From patchwork Wed Apr 24 17:08:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162801 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903945jan; Wed, 24 Apr 2019 10:08:49 -0700 (PDT) X-Received: by 2002:aa7:85cc:: with SMTP id z12mr34627440pfn.142.1556125729785; Wed, 24 Apr 2019 10:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125729; cv=none; d=google.com; s=arc-20160816; b=Dw9q1EoauEQ3GpQP0J+ac6LI6kclN+xZFJc7DGVm33yMpgb8SvqmKe8aGSSTB2ONWO 22QGawrU7j2Q67wjS4oOgY1TVUY72rkegS8U1hYddmIoPgJnGMA32Kz++xwMlRywA0KR r8jfr89Hl80T6TJlSOjBQxUsFgkCofO3VR85gyQ1mII+GYIAgPUTBCYGX2rGdRcPkAdY fUhROH+eB0IYA14mgtZ+npI7tdXEXp92XxEDWZ2Q0NjYCj33UCb4aoh5cGm4umXVLEfn u7qRxBgJ7GBBDP0KJkYfjiKL3trLyQa47fntmuIeezOLhmhnAvAG6jgGYop9MK+uMoMd MvqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zKaUzrk/ydlVbPS7i5drt5PTA8n/bRh1ygekvEDrRTg=; b=fw3NszJctE0cSyQXSvHVkou71E94F10Y01DNlG/91NomLqm8MISidYc9HfXn9xsYR7 Rb0Wpzp9j7YX2LR4VYCaiOtsF9cg9RVhNc3dGi4+N7fur3UyyezqOAaUxXJr0k88+Ar9 LEZgIX3444nEnIAvFiYmlAviLcinip1rN5JOrJUYM3XYkmbjkXjfo1Nw4TUsWnh8CrsT Ha8aFo8yU/5Hv/Zditt8T6wgc4X1Y8Tx9+EBkCgUvAnH+i4O/Sa4WQX+iHdTPq50YRXU nQjFyW8NEjG0S8Ac8aRLUXV6AvCmue8SHgwgYVxKjbJQVTHbGJuh1Kmr42xMKxqvSTya rtCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wInlrsHg; 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 f34sor20665378pgb.14.2019.04.24.10.08.49 for (Google Transport Security); Wed, 24 Apr 2019 10:08:49 -0700 (PDT) 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=wInlrsHg; 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=zKaUzrk/ydlVbPS7i5drt5PTA8n/bRh1ygekvEDrRTg=; b=wInlrsHgv5UBYVx3X8ekJYXVzKjzvTYhIMVmeLaoMmHMUd7diw0iRKPZ0ojm08uSKR Ij+kj1j5W2o+DVuPaR6TuTLABO3oQi7/KJseYYL/O3c9l7DgefLyZsNj03Hj29QqNIma VM8p6S/sxVAet6dbWMJ991lvRsDvNdZl/+9tGT63jpKBSsTZ93NbWShIiFXAdw5EgFcJ ctvM8EXvCZ1Uix5tUfbZpA2/yAg2O474UAy+XzfMntGDnJkOFqLwBOa/J3P0NEYSqD41 3lr+UJuhBUVmCMa6aP9NWkNpsngLO5QMGfnGIp44i86FqfCT1Cj08khn17lB3gFwh4ae +O6A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=zKaUzrk/ydlVbPS7i5drt5PTA8n/bRh1ygekvEDrRTg=; b=clElWaT613MayQGlSYMjzcJ2qlvwDAOpMorhRezSYgtm7vMSgIJQzeUWP4IuYWlT0T 5GvgX7g/twcf8CgQOWTk+dwyp8kI5OENc8QdXblYg6w3kxDBxJ9ET8AOb6z0ytvqoGBK Xp98cAJj4nu3CwhbOfBmFSke+MiaX6TAxxTKXif8zr9i1xy84xgtfiWlpo2/1KEjMEpH etZcgf0E96ZibxZq7nePpuc77Mjoi0olN71S5mFCOgCJFm+xUGxu8q7PeDsxqffNmlH9 SDYp74ej3knhJ4U6CrDbLYhCjcnTv81J+60QD6FDemGzol+i97w5igpD6Thl4+Oifc0T BtGQ== X-Gm-Message-State: APjAAAVKiQgquaMKYT13Hvh033/zHuajCUkkmc4e5K4i2cwnp3Q7yE/C dPhQLx8Jifmsq1XsvE+C8rp5MSnc X-Google-Smtp-Source: APXvYqyxJZnNRgndbMjisqJ29bPkn6SEqbvQBvxDb5Pb7yXGbQjl6wBCVJJuXq8/aXpc0Wzvxvmmcw== X-Received: by 2002:a63:5c53:: with SMTP id n19mr31948290pgm.193.1556125729304; Wed, 24 Apr 2019 10:08:49 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:48 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall Subject: [PATCH 3/6 v2] libdrm: amdgpu: Initialize unions with memset rather than "= {0}" Date: Wed, 24 Apr 2019 10:08:38 -0700 Message-Id: <1556125721-32145-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Clang complains when initializing unions using "= {0}" so instead use memset. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Reviewed-by: Alex Deucher Reviewed-by: Emil Velikov Reviewed-by: Christian König Signed-off-by: John Stultz --- amdgpu/amdgpu_cs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 7ee844f..7c5b9d1 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -733,12 +733,13 @@ drm_public int amdgpu_cs_submit_raw(amdgpu_device_handle dev, struct drm_amdgpu_cs_chunk *chunks, uint64_t *seq_no) { - union drm_amdgpu_cs cs = {0}; + union drm_amdgpu_cs cs; uint64_t *chunk_array; int i, r; if (num_chunks == 0) return -EINVAL; + memset(&cs, 0, sizeof(cs)); chunk_array = alloca(sizeof(uint64_t) * num_chunks); for (i = 0; i < num_chunks; i++) chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i]; @@ -763,10 +764,11 @@ drm_public int amdgpu_cs_submit_raw2(amdgpu_device_handle dev, struct drm_amdgpu_cs_chunk *chunks, uint64_t *seq_no) { - union drm_amdgpu_cs cs = {0}; + union drm_amdgpu_cs cs; uint64_t *chunk_array; int i, r; + memset(&cs, 0, sizeof(cs)); chunk_array = alloca(sizeof(uint64_t) * num_chunks); for (i = 0; i < num_chunks; i++) chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i]; @@ -803,9 +805,10 @@ drm_public int amdgpu_cs_fence_to_handle(amdgpu_device_handle dev, uint32_t what, uint32_t *out_handle) { - union drm_amdgpu_fence_to_handle fth = {0}; + union drm_amdgpu_fence_to_handle fth; int r; + memset(&fth, 0, sizeof(fth)); fth.in.fence.ctx_id = fence->context->id; fth.in.fence.ip_type = fence->ip_type; fth.in.fence.ip_instance = fence->ip_instance; From patchwork Wed Apr 24 17:08:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162802 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903974jan; Wed, 24 Apr 2019 10:08:51 -0700 (PDT) X-Received: by 2002:a17:902:28ab:: with SMTP id f40mr16415528plb.297.1556125731262; Wed, 24 Apr 2019 10:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125731; cv=none; d=google.com; s=arc-20160816; b=x9Y72vC0dpm4s4xPKU51sjqwy2CumYUTqBGa90w0zZTLapvtk79pchI4fNZhOqsGbG 8dQ30RCKEuGqOSGcBP04wGbe2PcIamVsJvBy7j5UbVnYygIHx9FCz447Vz+Sft2cj5+v Qemb5rmxc/wwq3RlvIw8vxdyrSZo2UtUiv8a04PtOsAiZadM5cBbo49mW4bDUVTpI7GJ jAgqeYiiKzJP0GSwR53M0Iol0bnK8EP0zLd8FbPrMx3NKX5aqYt/Rn3HhJylk131XwDY Z8JPfYcGebjuJXILbc1clgiAgp6hPslAr5OSwspxfRDLZgReUKqqEOiykEnDL6lbP4vy +34g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dAIluZjSLJwIxa7KvWN7HZ/X+6U+jK6ejf8yyjQSeDc=; b=XNUfHrhH7tO12vTXk/tyHF4dum5j7Nd4vZ4mwtRGdtFEjnYkK8d7KIh2ET3fWtRlvc vjK5DV+SsdHHQw3HbperH0ALUsbbsk7Ca1pjOY6ADZi1pn1NFZ7+mapFdSaSO0SXga4c fbpPn0W2HeKXLpb0vcDzcazudwc75RNWN2KZTx8wAA8ruduftMwg3a99Pe6DlKYzBe1J l0xSvpxQdLmqRZG9gZ0ss3ftzgMIEHVLLFHjeTaHRfQv3xPVPOiN18JqslUd4AyryfvD vagD6nj5sZ1xhXgL6AjQgaAWBbv8h0id5c2s+hQx1LTOnamGUhbSdfxdKp968Vg1hqEl 5zOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DueiEhJh; 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 c3sor16668032pgj.58.2019.04.24.10.08.51 for (Google Transport Security); Wed, 24 Apr 2019 10:08:51 -0700 (PDT) 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=DueiEhJh; 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:in-reply-to:references; bh=dAIluZjSLJwIxa7KvWN7HZ/X+6U+jK6ejf8yyjQSeDc=; b=DueiEhJhYxh0nPu7G/PYtL7B1BOWLQpLDU3hwpBIUNa1FWP/k3U6iYU7fOGtwIaH1i 57mSskil+0wa0VPLt/g8xulelDDhC1nmRK2Ck2ArPDcGmZZc/dUTR/obkAFkEvNNC9xs Typ11cyavRs20TV44ufkt1n8ig1vJNP3NTKmIDJUjHgw49GmOLV7WVjCkTX+3RXpBNkJ 96/HoGqtler9diU1K8wrcY16RftVmmVyoBahTrBfRweXENvbrQDT+GFMlR83meb5bl2W UahjO4K2ztu3qiTXU23SZ6z8QARJ8eToUICrl8W4VjlhTYVMlCsgQo3OsRFFe6Io/xic edQA== 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:in-reply-to :references; bh=dAIluZjSLJwIxa7KvWN7HZ/X+6U+jK6ejf8yyjQSeDc=; b=h4jjZNBQsoKKRDt2SBHOQVafCtpI4NX9yeHMO5qFCWCshJktuLCgABTorXvTkqnOFw bY5eVS5IqgOd5vvvvURAqQB+BOba3JcFotZ1UgO0Nl9wOxQzIFgzx/6OOwqp+qIdmYpy FdHTSqReUE8Qne+FmUTY1v30nHIWTxMHyf+MWIAseZ7RN0iVQA9AhBUjnMRhkMyfuxtT WP9LjBLP/YDFKuYVoaBkL5tVCfkn6Se88toTcFy1NrNK9CkXjkl53hEsd8HvVPqCoNpS t4mL3WTVWS30blL0XE2uQTjydRlOp1FKt93bH5cwP/sPChaztvcXHBJrYaDOnprQ4ixA gR6w== X-Gm-Message-State: APjAAAXCBhSoD5JF7qSTMv2SsoBWNhn1o/N/YTxNG+iJjRVyqo1WMVuf 2beZAWw9UfV1WQjfoluqr3dUcbRP X-Google-Smtp-Source: APXvYqxd+OclpBKmDT97OaiNa0BO9Rb/EzvIEw3NtC9kz55kQ3uXGSILcr9jYsQiwCnxnExFPSPPxw== X-Received: by 2002:a65:4302:: with SMTP id j2mr31398460pgq.291.1556125730819; Wed, 24 Apr 2019 10:08:50 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:49 -0700 (PDT) From: John Stultz To: dri-devel Cc: Prabhanjan Kandula , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall , John Stultz Subject: [PATCH 4/6 v2] libdrm: Avoid additional drm open close Date: Wed, 24 Apr 2019 10:08:39 -0700 Message-Id: <1556125721-32145-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> From: Prabhanjan Kandula Avoid additional drm device open and close. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Reviewed-by: Alex Deucher Signed-off-by: John Stultz --- xf86drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/xf86drm.c b/xf86drm.c index fe822ca..2c19376 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -750,8 +750,8 @@ drm_public int drmOpen(const char *name, const char *busid) */ drm_public int drmOpenWithType(const char *name, const char *busid, int type) { - if (!drmAvailable() && name != NULL && drm_server_info && - drm_server_info->load_module) { + if (name != NULL && drm_server_info && + drm_server_info->load_module && !drmAvailable()) { /* try to load the kernel module */ if (!drm_server_info->load_module(name)) { drmMsg("[drm] failed to load kernel module \"%s\"\n", name); From patchwork Wed Apr 24 17:08:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162803 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp904032jan; Wed, 24 Apr 2019 10:08:54 -0700 (PDT) X-Received: by 2002:a62:2a97:: with SMTP id q145mr35392776pfq.22.1556125734224; Wed, 24 Apr 2019 10:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125734; cv=none; d=google.com; s=arc-20160816; b=0bksPkEd0/Xbe/MdG6oGCuPRlc425IgHmSArRzOqcJUTMEyQH1Dr2NmVFFDYkjmUM5 QEHFXyDeI4BmOFnNGrlZi6YRhoAC8TKD56V3FNIjL2uJn1dpWt8/IlpM1NBuew1o65W4 bGQ9h5mOt+1qB2YLmvbW+xDorndsRK/VMRcPErUzSrzkbyg9lZEg8CR6dvpMtJy5aBeE j0hQso38mJWE0V+2mRd9TZ42+c3S77eU0J91J49oboxdV3YuC/5hNfvT8sJf5ZLWvFbt 9+mBrO5vbvRI3Xli0/m683wPdI+fadgBQbKfvWLIJw4D04Q3uxtiumiNV6ro+PKljSa8 Y43A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Kw97zKx6ijTQMTY8hmHHesW3NQxmgImJerDwv67tN38=; b=DxBrF30VCp6UOAgJGhlrEny/ZhkYpyodWgNxy4QSJKunY+5OxwuR+VocgxtPN6ROew EFtEa5WqJYi2j6k70H9oSDCktfb/n+/8r7y9CDmEhc0x0wM2DDdjx/12OXlAz04z6I9q vC1cdm7SdvaatXmyqOKok8nV1+PW4mM//H1OBe4XdOIQ7UkO4k9kF7CeGxOL4H0GBKjm zYW6Fjf+M57PtEkLLcmWVgzcgvCb0pZpYSTGbmTkfvWIMJPPbLpUGIkPUqkSN5hnFZan 4fFdxdem5+SLpY0Ll3vieqfbiLvSIJqSwmARXYjPVBtUBzjxiotex7M8lI4KfHfgf9Jd E2bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AvtakVJH; 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 cd18sor14774595plb.27.2019.04.24.10.08.54 for (Google Transport Security); Wed, 24 Apr 2019 10:08:54 -0700 (PDT) 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=AvtakVJH; 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:in-reply-to:references; bh=Kw97zKx6ijTQMTY8hmHHesW3NQxmgImJerDwv67tN38=; b=AvtakVJH9GjFvEO+6pYWMVfAjWin/3isimRi8bNIupS7xQS2R086ojvSWT5/JMoUga TdMbBDjeQO++m5sXUD2v2KMllYuyzhmcla8PtPgbQvWIIwyhuBnyQWXnJLUKXZVe3pn7 8qXHdzWzMEcPNNwIswKCobouemNbOOUboL8xSD+uk+VE7Sl3vxXEcX74+CssqhtEDeiG SCRhvaGXYXW+cg8EtPhsyNREuN2ET1pZqdoQFmmy0Qe/1D2MlzQsGgNgCrRH5vhzvCim x81EwAavDstySkCOZXM5YIWnfnIahBhZbXprjLAwZosiklnQl6GJzv8SMtFtOUcGZO2T eMDw== 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:in-reply-to :references; bh=Kw97zKx6ijTQMTY8hmHHesW3NQxmgImJerDwv67tN38=; b=ByDydxTgX+LBNeQi6kvA1R42ZTxZMu8scFgmb7CN/vp2qwpER0wktL6EkkV/OWVrON WHsWrr60RXEqaP6Jjgkw7cPY4wVREp+9cjxSECUd/eCM1+N1e8Tt5oGT12bXmT709Fhz ByHYgWuXOvfxt6eDETqxEczlFpInD5Z5PCSiY1sioIF5wJDV9ivJOHbozkAcGJ35kAiS o/2QA8xbRyZs8GFHOKRi/PJHNcXsZB7FtqPMqcOKlXrooQMjjIwCFdjcBXF0mitS5EYE kp+p0KlC6ZdVTLH90PkmrCLmisbEL5d9OWYvwXy/4gqKrOW95y5nSJXr5wA7EkXfG9z0 bdng== X-Gm-Message-State: APjAAAWGrD4lDqIDesuRe5P6PneAJJYmZ7uAAYN5dsW3skeDoFzwMeYP cvC2Mv2feWRzt0TSCU7iQSEa1rsQ X-Google-Smtp-Source: APXvYqwhHdrTPysllqKY01CrRcX42uZ5LMg1LS+AWQN+Z0rDWHtrXQjq/viL8bTkPk0mhwo/gkY4dw== X-Received: by 2002:a17:902:854c:: with SMTP id d12mr33870818plo.150.1556125733827; Wed, 24 Apr 2019 10:08:53 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:52 -0700 (PDT) From: John Stultz To: dri-devel Cc: Adrian Salido , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall , John Stultz Subject: [PATCH 5/6 v2] libdrm: reduce number of reallocations in drmModeAtomicAddProperty Date: Wed, 24 Apr 2019 10:08:40 -0700 Message-Id: <1556125721-32145-6-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> From: Adrian Salido When calling drmModeAtomicAddProperty allocation of memory happens as needed in increments of 16 elements. This can be very slow if there are multiple properties to be updated in an Atomic Commit call. Increase this to as many as can fit in a memory PAGE to avoid having to reallocate memory too often. Also this patch has a small one line perf tweak in drmModeAtomicDuplicate() to only memcpy items to the cursor position in order avoid copying the entire item array if its mostly empty. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Reviewed-by: Alex Deucher Reviewed-by: Emil Velikov [jstultz: Expanded commit message] Signed-off-by: John Stultz --- v2: Improved commit message --- xf86drmMode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/xf86drmMode.c b/xf86drmMode.c index 8f8633e..c878d9e 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -1259,7 +1259,7 @@ drm_public drmModeAtomicReqPtr drmModeAtomicDuplicate(drmModeAtomicReqPtr old) return NULL; } memcpy(new->items, old->items, - old->size_items * sizeof(*new->items)); + old->cursor * sizeof(*new->items)); } else { new->items = NULL; } @@ -1322,12 +1322,13 @@ drm_public int drmModeAtomicAddProperty(drmModeAtomicReqPtr req, return -EINVAL; if (req->cursor >= req->size_items) { + const uint32_t item_size_inc = getpagesize() / sizeof(*req->items); drmModeAtomicReqItemPtr new; - req->size_items += 16; + req->size_items += item_size_inc; new = realloc(req->items, req->size_items * sizeof(*req->items)); if (!new) { - req->size_items -= 16; + req->size_items -= item_size_inc; return -ENOMEM; } req->items = new; From patchwork Wed Apr 24 17:08:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162804 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp904064jan; Wed, 24 Apr 2019 10:08:55 -0700 (PDT) X-Received: by 2002:a63:1601:: with SMTP id w1mr27115713pgl.258.1556125735837; Wed, 24 Apr 2019 10:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125735; cv=none; d=google.com; s=arc-20160816; b=yf9MJT6kP8X3Igae/wJL9xE9hj5vIx24HnwTNdfJi/vDQf3fLhOtUgpQYK5kloMLPu I/kSEcOlq5+tqj2EHkqCwZcEGK5NX47KWLZ8nDMLbfuax3mMuCiwhmIC07ae/E+Cujgq UNQUEd1PDEssCYqvnW5bIK7FSaGTfgdIEYQMnmSXLyWRrSx++pomUt7ef94wz8P6nDcF aWPC1a8lhByAp8gCSRx3A5gsvK9RmB/Bt0YkvVqK034gPTd8jRqyyAnNdWYiGP7+kVzo vQhhd92i4a4nrMoivo0TPCvGdRQYiyTI/kcQHoEZIDlSm7nU56PzMAVH+R6XIzknRI3a +QDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VSHWfn1d0RNfNqAGpfbv5d3OwNaRJi8ca2rT/Zc5NEk=; b=dv69v62YTTn/oo9qS/6dzqG4DsmhElTBq+EdsP5k1X5wSId3JgcJilB6aLdw9yZ1K6 Rz7Xv6F7/8mpt02Lz2/WfKr0CjnYFwzhwtG/+hlHOqEoIxMxNSTsMd+MSd/ryHSSc8su PjWCLyizwpYaDnq1EgTx5ZK2ONT1/JySohYJxm2rbYoHCG6op3G03CCZjrFqYt6Asz3k 2tLCzZpp1X6UgTZWbEJViKeR2NRNjEMSv8+cVrSX2mKVVOeJgDP5pGR/4Y7qt4+44LQN HtrW0itnhOAirbolEMDgzuWatpW/7Oay3BwsofAvYEsu2E68fLXjYhPMF0Mnd/Uxi27W 5SCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vxVNkJrz; 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 cl14sor17529573plb.30.2019.04.24.10.08.55 for (Google Transport Security); Wed, 24 Apr 2019 10:08:55 -0700 (PDT) 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=vxVNkJrz; 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:in-reply-to:references; bh=VSHWfn1d0RNfNqAGpfbv5d3OwNaRJi8ca2rT/Zc5NEk=; b=vxVNkJrzIVtdHtmMwZ3jt6OoA/lcnXukHd0rCfOL7ZM2arNygI0Mwg/u+IKAt72foe FlNB40hlZ6qKhUZ1zs2y9KLXPQs1Rj9JUps99x8/a4K6ccvFQVZNVLxceaqHWVWaHwcD lt7v6fApzW+17m9MmTkFAScWaBhX8//c6I89YrFe6WBRAkEtkM5n418yXo8g9sD8hBO1 tc6iiAGvVBXvmqtmkljbddL2l+D+84Z7fJXkJpf0eYJTdwxjeLghJ/s4OfFJw/F3l3XA LCrUztQ6ENwwPe93xuWCfHn1ByziNE1qDM85WOfNUf1T4X14xYZpTkSA2Wcq0wKHL6e5 xoNA== 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:in-reply-to :references; bh=VSHWfn1d0RNfNqAGpfbv5d3OwNaRJi8ca2rT/Zc5NEk=; b=gzwfnyJGMouBsimwPHbhuT10juDiWMBLaxccAGHTuJ9nLgkMsUDNEQgbaNuUA4zQVU fWw+HNmRpAcdaFBlrmKDqdPWzYzIw+T1+jNTYzD3n4aSYlc0GGcgs/3eoRlc//T/D9cq 2Wblfc6yql+SLhHMjXzHVmLjGHFOPsDD/aDzmNk9hYH7TOuJLJCRPY3i1HUK+PyxMZvC Xmpex3TGYIlY3csMO06aIqa7bF8omWkHkcAZPiRafH0LgV3wSF9ViJgPCTc7xujfeBxY BY4UY9PecCLaepYZFRA25oD7r2ax7rZAEpLBcvQnBeSRgEjyoC2AMtcKSXn/9g0TKPwF 02Dg== X-Gm-Message-State: APjAAAVSQEvAMXwWMC5esh1mB8RILJOEMOMdkGoLza+MjaDA4mTkFjRu hC0nZ5RMSTCtu6gFU4QPCBJq13gDoOWp5Q== X-Google-Smtp-Source: APXvYqya7QwTYvCVYNxVYj9TE2uI8RZOlmI6lMrmiMVC1ZlwS00hayspHNXIurFX3UHZmDrtrTzCbw== X-Received: by 2002:a17:902:d83:: with SMTP id 3mr34793889plv.125.1556125735424; Wed, 24 Apr 2019 10:08:55 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:54 -0700 (PDT) From: John Stultz To: dri-devel Cc: Hemant Hariyani , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall , Praneeth Bajjuri , John Stultz Subject: [PATCH 6/6 v2] libdrm: omap: Add DRM_RDWR flag to dmabuf export Date: Wed, 24 Apr 2019 10:08:41 -0700 Message-Id: <1556125721-32145-7-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> From: Hemant Hariyani Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE. This fixes boot failures with Android (likely w/ closed source user-space drivers) that were caused due to mmap() returning error. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Signed-off-by: Hemant Hariyani [picked and updated commitmsg from http://git.ti.com/cgit/cgit.cgi/android/external-libdrm.git/] Signed-off-by: Praneeth Bajjuri Signed-off-by: Alistair Strachan [jstultz: Tweaked commit message] Signed-off-by: John Stultz --- v2: Tweaked commit message --- omap/omap_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/omap/omap_drm.c b/omap/omap_drm.c index 3aed4e0..ffacea6 100644 --- a/omap/omap_drm.c +++ b/omap/omap_drm.c @@ -414,7 +414,7 @@ drm_public int omap_bo_dmabuf(struct omap_bo *bo) if (bo->fd < 0) { struct drm_prime_handle req = { .handle = bo->handle, - .flags = DRM_CLOEXEC, + .flags = DRM_CLOEXEC | DRM_RDWR, }; int ret;