Re: [PATCH] drm/panfrost: Give name to anonymous coredump object union

2022-09-20 Thread Steven Price
On 19/09/2022 07:44, Adrián Larumbe wrote: > Hi Steven, > > On 13.09.2022 09:45, Steven Price wrote: >> On 12/09/2022 17:44, Adrián Larumbe wrote: >>> Building Mesa's Perfetto requires including the panfrost drm uAPI header in >>> C++ code, but the C++ compiler

Re: [PATCH] drm/panfrost: Give name to anonymous coredump object union

2022-09-13 Thread Steven Price
2714a7dff0710ac5b8b457bcfe9ae52b458565 Mon Sep 17 00:00:00 2001 From: Steven Price Date: Tue, 13 Sep 2022 09:37:55 +0100 Subject: [PATCH] drm/panfrost: Remove type name from internal structs The two structs internal to struct panfrost_dump_object_header were named, but sadly that is incompatible w

Re: [PATCH v4 4/5] drm/panfrost: devfreq: set opp to the recommended one to configure regulator

2022-09-08 Thread Steven Price
> Suggested-by: Viresh Kumar > Signed-off-by: Clément Péron Reviewed-by: Steven Price Note this same sequence is used in the Lima driver, so it would be good to submit the fix there too as it presumably is affected by the same issue. I've CC'd Qiang for visibility. I'll push this patch to

Re: [PATCH] drm/panfrost: Update io-pgtable API

2022-09-01 Thread Steven Price
re efficient interface. > > Signed-off-by: Robin Murphy Looks correct to me. Although the voodoo magic does take a little bit of figuring out ;) Reviewed-by: Steven Price I'll push to drm-misc-next. Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 40 +++

Re: [PATCH v6 1/2] drm/panfrost: Add specific register offset macros for JS and MMU AS

2022-08-08 Thread Steven Price
han using magic numbers. > > Signed-off-by: Adrián Larumbe Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_regs.h | 42 ++-- > 1 file changed, 24 insertions(+), 18 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_

Re: [PATCH v6 2/2] drm/panfrost: Add support for devcoredump

2022-08-08 Thread Steven Price
On 29/07/2022 15:46, Adrián Larumbe wrote: > In the event of a job timeout, debug dump information will be written into > /sys/class/devcoredump. > > Inspired by etnaviv's similar feature. > > Signed-off-by: Adrián Larumbe Reviewed-by: Steven Price I'll push these to drm-

Re: [PATCH v5 1/2] drm/panfrost: Add specific register offset macros for JS and MMU AS

2022-07-25 Thread Steven Price
defines this, and secondly if hardware did add more registers and change the stride then we'd still need compatibility with the old hardware. So most likely we'd need a new driver for the new hardware. So just drop the comment. I'm not really sure why we have both _STRIDE and _SHIFT for the MMU

Re: [PATCH v5 2/2] drm/panfrost: Add support for devcoredump

2022-07-25 Thread Steven Price
On 18/07/2022 18:24, Adrián Larumbe wrote: > In the event of a job timeout, debug dump information will be written into > /sys/class/devcoredump. > > Inspired by etnaviv's similar feature. > > Signed-off-by: Adrián Larumbe LGTM Reviewed-by: Steven Price Steve > -

Re: [PATCH V3.1 02/20] OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list

2022-07-06 Thread Steven Price
static const struct panfrost_compatible mediatek_mt8183_data = { > - .num_supplies = ARRAY_SIZE(mediatek_mt8183_supplies), > + .num_supplies = ARRAY_SIZE(mediatek_mt8183_supplies) - 1, > .supply_names = mediatek_mt8183_supplies, > .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), > .pm_domain_names = mediatek_mt8183_pm_domains, Reviewed-by: Steven Price Thanks for the rework, much cleaner. Steve

Re: [PATCH V3 02/20] OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list

2022-07-06 Thread Steven Price
On 05/07/2022 05:34, Viresh Kumar wrote: > On 04-07-22, 15:35, Steven Price wrote: >> I have to say the 'new improved' list ending with NULL approach doesn't >> work out so well for Panfrost. We already have to have a separate >> 'num_supplies' variable for de

Re: [PATCH v7 0/2] Panfrost driver fixes

2022-07-04 Thread Steven Price
On 30/06/2022 21:05, Dmitry Osipenko wrote: > This series fixes two minor bugs in the Panfrost driver. > > Changelog: > > v7: - Factored out Panfrost fixes from [1] since I'll be working on > the dma-buf locking in a separate patchset now. > > [1] >

Re: [PATCH V3 02/20] OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list

2022-07-04 Thread Steven Price
On 04/07/2022 13:07, Viresh Kumar wrote: > Make dev_pm_opp_set_regulators() accept a NULL terminated list of names > instead of making the callers keep the two parameters in sync, which > creates an opportunity for bugs to get in. > > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Viresh

Re: [PATCH v4 2/2] drm/panfrost: Add support for devcoredump

2022-06-23 Thread Steven Price
On 22/06/2022 15:36, Adrián Larumbe wrote: > In the event of a job timeout, debug dump information will be written into > /sys/class/devcoredump. > > Inspired by etnaviv's similar feature. > > Signed-off-by: Adrián Larumbe Looks pretty good, a few comments below. > --- >

Re: [PATCH v4 1/2] drm/panfrost: Add specific register offset macros for JS and MMU AS

2022-06-23 Thread Steven Price
On 22/06/2022 15:36, Adrián Larumbe wrote: > Each Panfrost job has its own job slot and MMU address space set of > registers, which are selected with a job-specific index. > > Turn the shift and stride used for selection of the right register set base > into a define rather than using magic

[PATCH] drm/rockchip: Detach from ARM DMA domain in attach_device

2022-06-15 Thread Steven Price
ARM domain before attaching a new one. Suggested-by: Robin Murphy Signed-off-by: Steven Price --- See also the thread[1] where I reported the regression. [1] https://lore.kernel.org/linux-kernel/da9cca0a-ec5b-2e73-9de0-a930f7d947b2%40arm.com --- drivers/gpu/drm/rockchip/rockchip_drm_

Re: [PATCH v6 04/22] drm/panfrost: Fix shrinker list corruption by madvise IOCTL

2022-05-30 Thread Steven Price
it. > > Cc: sta...@vger.kernel.org > Fixes: 013b65101315 ("drm/panfrost: Add madvise and shrinker support") > Signed-off-by: Dmitry Osipenko Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_drv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 del

Re: [PATCH 15/31] drm/panfrost: Migrate to dev_pm_opp_set_config()

2022-05-26 Thread Steven Price
On 26/05/2022 12:42, Viresh Kumar wrote: > The OPP core now provides a unified API for setting all configuration > types, i.e. dev_pm_opp_set_config(). > > Lets start using it. > > Signed-off-by: Viresh Kumar Acked-by: Steven Price > --- > drivers/gpu/drm/panfros

Re: [PATCH v2 1/9] dt-bindings: Add compatible for Mali Valhall (JM)

2022-05-26 Thread Steven Price
t; > As the first SoC with a Valhall GPU receiving mainline support, add a > specific compatible for the MediaTek MT8192, which instantiates a > Mali-G57. > > v2: Change compatible to arm,mali-valhall-jm (Daniel Stone). > > Signed-off-by: Alyssa Rosenzweig > CC: devicet

Re: [PATCH v2 8/9] drm/panfrost: Add Mali-G57 "Natt" support

2022-05-26 Thread Steven Price
ULL(HW_ISSUE_TTRX_2968_TTRX_3162) | \ > + BIT_ULL(HW_ISSUE_TTRX_3076) | \ > + BIT_ULL(HW_ISSUE_TTRX_3485)) There's no need to repeat the issues that are generic for g57 in the r0p0 list. So this can be simplified to: #define hw_issues_g57_r0p0 (\ BIT_ULL(HW_ISSUE_TTRX_3485)) With that fixed: Reviewed-by: Steven Price > + > static inline bool panfrost_has_hw_issue(const struct panfrost_device *pfdev, >enum panfrost_hw_issue issue) > {

[PATCH] drm/panfrost: Job should reference MMU not file_priv

2022-05-19 Thread Steven Price
. To fix this, drop the reference to panfrost_priv in the job structure and add a direct reference to the MMU structure which is what's actually needed. Fixes: 7fdc48cc63a3 ("drm/panfrost: Make sure MMU context lifetime is not bound to panfrost_priv") Signed-off-by: Steven Price --- d

Re: [PATCH 1/1] drm/panfrost: Add support for devcoredump

2022-05-18 Thread Steven Price
On 17/05/2022 18:42, Adrián Larumbe wrote: > In the event of a job timeout, debug dump information will be written into > /sys/class/devcoredump. > > Inspired by etnaviv's similar feature. > > Signed-off-by: Adrián Larumbe Nice! Some comments below. > --- > drivers/gpu/drm/panfrost/Kconfig

Re: [PATCH v5 01/17] drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error

2022-04-28 Thread Steven Price
ot;drm/panfrost: Add the panfrost_gem_mapping concept") Reviewed-by: Steven Price Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c > b/drivers/gpu/drm/p

Re: [PATCH] drm/plane: Move range check for format_count earlier

2022-04-28 Thread Steven Price
On 03/12/2021 13:08, Liviu Dudau wrote: > On Fri, Dec 03, 2021 at 10:28:15AM +0000, Steven Price wrote: >> While the check for format_count > 64 in __drm_universal_plane_init() >> shouldn't be hit (it's a WARN_ON), in its current position it will then >> leak the plane->

Re: [PATCH v6 1/2] dt-bindings: Add DT schema for Arm Mali Valhall GPU

2022-04-14 Thread Steven Price
On 14/04/2022 12:51, AngeloGioacchino Del Regno wrote: > Il 14/04/22 04:50, Nick Fan ha scritto: >> Add devicetree schema for Arm Mali Valhall GPU >> >> Define a compatible string for the Mali Valhall GPU >> for MediaTek's SoC platform. >> >> Signed-off-by: Nick Fan > > Hello Nick, >

Re: [PATCH v1] drm/scheduler: Don't kill jobs in interrupt context

2022-04-13 Thread Steven Price
here is no good reason for releasing scheduler's jobs in IRQ > context, hence use normal context to fix the trouble. > > Cc: sta...@vger.kernel.org > Fixes: 542cff7893a3 ("drm/sched: Avoid lockdep spalt on killing a processes") > Signed-off-by: Dmitry Osipenko Revie

Re: [PATCH v2 8/8] drm/panfrost: Switch to generic memory shrinker

2022-03-18 Thread Steven Price
On 18/03/2022 14:41, Dmitry Osipenko wrote: > > On 3/17/22 02:04, Dmitry Osipenko wrote: >> >> On 3/16/22 18:04, Steven Price wrote: >>> On 14/03/2022 22:42, Dmitry Osipenko wrote: >>>> Replace Panfrost's memory shrinker with a generic DRM memory shrinker. &

Re: [PATCH v2 8/8] drm/panfrost: Switch to generic memory shrinker

2022-03-16 Thread Steven Price
On 14/03/2022 22:42, Dmitry Osipenko wrote: > Replace Panfrost's memory shrinker with a generic DRM memory shrinker. > > Signed-off-by: Dmitry Osipenko > --- I gave this a spin on my Firefly-RK3288 board and everything seems to work. So feel free to add a: Tested-by: Steven Price

Re: [PATCH v2 6/8] drm/shmem-helper: Add generic memory shrinker

2022-03-16 Thread Steven Price
On 14/03/2022 22:42, Dmitry Osipenko wrote: > Introduce a common DRM SHMEM shrinker. It allows to reduce code > duplication among DRM drivers, it also handles complicated lockings > for the drivers. This is initial version of the shrinker that covers > basic needs of GPU drivers. > > This patch

Re: [PATCH v2] drm/panfrost: cleanup comments

2022-03-02 Thread Steven Price
On 02/03/2022 12:45, t...@redhat.com wrote: > From: Tom Rix > > For spdx > change tab to space delimiter > Use // for *.c > > Replacements > commited to committed > regsiters to registers > initialze to initialize > > Signed-off-by: Tom Rix Reviewed-b

Re: [PATCH] drm/panfrost: cleanup comments

2022-03-02 Thread Steven Price
On 01/03/2022 12:43, t...@redhat.com wrote: > From: Tom Rix > > For spdx > change tab to space delimiter > Use // for *.c > > Replacements > commited to committed, use multiline comment style > regsiters to registers > initialze to initialize > > Signed-off-by: Tom Rix Thanks, most of the

Re: [PATCH 6/9] drm/panfrost: Add "clean only safe" feature bit

2022-02-16 Thread Steven Price
useful >>> to have the bit to record the feature bit when adding new models. >>> >>> Signed-off-by: Alyssa Rosenzweig >> >> Reviewed-by: Steven Price >> >> Sadly I don't have the hardware to try this out on, but it should be a >> simple cas

Re: [PATCH 4/9] drm/panfrost: Handle HW_ISSUE_TTRX_3076

2022-02-16 Thread Steven Price
On 14/02/2022 17:06, Alyssa Rosenzweig wrote: > On Mon, Feb 14, 2022 at 04:23:18PM +0000, Steven Price wrote: >> On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: >>> From: Alyssa Rosenzweig >>> >>> Some Valhall GPUs require resets when encountering b

Re: [PATCH 9/9] drm/panfrost: Handle arm,mali-valhall compatible

2022-02-14 Thread Steven Price
On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: > From: Alyssa Rosenzweig > > The most important Valhall-specific quirks have been handled, so add the > Valhall compatible and probe. > > Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price > --- >

Re: [PATCH 8/9] drm/panfrost: Add Mali-G57 "Natt" support

2022-02-14 Thread Steven Price
On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: > From: Alyssa Rosenzweig > > Add the features, issues, and GPU ID for Mali-G57, a first-generation > Valhall GPU. Other first- and second-generation Valhall GPUs should be > similar. > > Signed-off-by: Alyssa Rosenzweig > --- >

Re: [PATCH 7/9] drm/panfrost: Don't set L2_MMU_CONFIG quirks

2022-02-14 Thread Steven Price
set to non-zero values. When > left as zero, reads and writes are not throttled. > > Both kbase and panfrost always zero these registers. Per discussion with > Steven Price, there are two reasons these quirks may be used: > > 1. Simulating slower memory subsystems. This use case i

Re: [PATCH 6/9] drm/panfrost: Add "clean only safe" feature bit

2022-02-14 Thread Steven Price
y details. It's still useful > to have the bit to record the feature bit when adding new models. > > Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price Sadly I don't have the hardware to try this out on, but it should be a simple case of the below (untested): 8< d

Re: [PATCH 5/9] drm/panfrost: Add HW_ISSUE_TTRX_3485 quirk

2022-02-14 Thread Steven Price
g has to be 'just right' to hit the bug. That said I think we should probably add pre-emption support sometime at which point this could become an issue. > Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_issues.h | 3 +++ > 1 fi

Re: [PATCH 4/9] drm/panfrost: Handle HW_ISSUE_TTRX_3076

2022-02-14 Thread Steven Price
On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: > From: Alyssa Rosenzweig > > Some Valhall GPUs require resets when encountering bus faults due to > occlusion query writes. Add the issue bit for this and handle it. > > Signed-off-by: Alyssa Rosenzweig Reviewe

Re: [PATCH 3/9] drm/panfrost: Constify argument to has_hw_issue

2022-02-14 Thread Steven Price
On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: > From: Alyssa Rosenzweig > > Logically, this function is free of side effects, so any pointers it > takes should be const. Needed to avoid a warning in the next patch. > > Signed-off-by: Alyssa Rosenzweig Reviewe

Re: [PATCH 2/9] drm/panfrost: Handle HW_ISSUE_TTRX_2968_TTRX_3162

2022-02-14 Thread Steven Price
On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: > From: Alyssa Rosenzweig > > Add handling for the HW_ISSUE_TTRX_2968_TTRX_3162 quirk. Logic ported > from kbase. kbase lists this workaround as used on Mali-G57. > > Signed-off-by: Alyssa Rosenzweig Reviewe

Re: [PATCH 1/9] dt-bindings: Add arm,mali-valhall compatible

2022-02-14 Thread Steven Price
On 11/02/2022 20:27, alyssa.rosenzw...@collabora.com wrote: > From: Alyssa Rosenzweig > > From the kernel's perspective, pre-CSF Valhall is more or less > compatible with Bifrost, although they differ to userspace. Add a > compatible for Valhall to the existing Bifrost bindings documentation. >

Re: [PATCH v2] drm/panfrost: Handle IDVS_GROUP_SIZE feature

2022-02-11 Thread Steven Price
ature mimicking kbase's behaviour. > > Tuning this register slightly improves performance of index-driven vertex > shading. On Mali-G52 (with Mesa), overall glmark2 score is improved from 1026 > to > 1037. Geometry-heavy scenes like -bshading are improved from 1068 to 1098. > > Signed

Re: [PATCH v2 1/2] drm/gem-shmem: Set vm_ops in static initializer

2022-02-10 Thread Steven Price
update the drivers that build upon GEM SHMEM > > Signed-off-by: Thomas Zimmermann Reviewed-by: Steven Price > --- > drivers/gpu/drm/drm_gem_shmem_helper.c | 5 +++-- > drivers/gpu/drm/lima/lima_gem.c | 1 + > drivers/gpu/drm/panfrost/panfrost_gem.c | 1 + > driv

Re: [PATCH] drm/arm: arm hdlcd select DRM_GEM_CMA_HELPER

2022-01-24 Thread Steven Price
NFIG_DRM_KMS_CMA_HELPER option") and with that... Reviewed-by: Steven Price Steve > --- > drivers/gpu/drm/arm/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/arm/Kconfig b/drivers/gpu/drm/arm/Kconfig > index 58a242871b28..6e3f1d600541 100644 > -

Re: [PATCH v2] drm/panfrost: initial dual core group GPUs support

2022-01-17 Thread Steven Price
On 15/01/2022 16:06, Alexey Sheplyakov wrote: > On a dual core group GPUs (such as T628) fragment shading can be > performed over all cores (because a fragment shader job doesn't > need coherency between threads), however vertex shading requires > to be run on the same core group as the tiler

Re: [PATCH 2/2] drm/panfrost: adjusted job affinity for dual core group GPUs

2022-01-13 Thread Steven Price
On 13/01/2022 10:01, Alexey Sheplyakov wrote: > Hi, Steven! > > Thanks for such a detailed explanation of T628 peculiarities. > > On Wed, Jan 12, 2022 at 05:03:15PM +0000, Steven Price wrote: >> On 10/01/2022 17:42, Alyssa Rosenzweig wrote: >>>> Whether it's wo

Re: [PATCH 2/2] drm/panfrost: Merge some feature lists

2022-01-13 Thread Steven Price
On 12/01/2022 19:20, Alyssa Rosenzweig wrote: >>> Now that we only list features of interest to kernel space, lots of GPUs >>> have the same feature bits. To cut down on the repetition in the file, >>> merge feature lists that are identical between similar GPUs. >>> >>> Note that this leaves some

Re: [PATCH 2/2] drm/panfrost: adjusted job affinity for dual core group GPUs

2022-01-12 Thread Steven Price
On 10/01/2022 17:42, Alyssa Rosenzweig wrote: >> Whether it's worth the effort depends on whether anyone really cares >> about getting the full performance out of this particular GPU. >> >> At this stage I think the main UABI change would be to add the opposite >> flag to kbase, (e.g.

Re: [PATCH 2/2] drm/panfrost: Merge some feature lists

2022-01-12 Thread Steven Price
On 09/01/2022 17:09, Alyssa Rosenzweig wrote: > Now that we only list features of interest to kernel space, lots of GPUs > have the same feature bits. To cut down on the repetition in the file, > merge feature lists that are identical between similar GPUs. > > Note that this leaves some unmerged

Re: [PATCH 1/2] drm/panfrost: Remove features meant for userspace

2022-01-12 Thread Steven Price
rnel, leaving only those which do affect the > register-level operation of the chip. > > Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price (although it's a good thing kbase never did this cleanup - it's a useful source of public information ;) ) Steve > --- > drivers

Re: [PATCH] drm/panfrost: Check for error num after setting mask

2022-01-12 Thread Steven Price
: Set DMA masks earlier") That commit just moved the code around, the actual missing error handling dates from the very beginning (f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")). But I can fix that up when merging. > Signed-off-by: Jiasheng Jiang Reviewed-by: Steven

Re: [RFC PATCH] drm/panfrost: Handle IDVS_GROUP_SIZE feature

2022-01-10 Thread Steven Price
performance (although for individual test content this can vary). AFAICT the performance impact isn't massive either. > Applies on top of my feature clean up series which should go in first. > (That's pure cleaunp, this is a behaviour change RFC needing > discussion.) > > Signed-off-

Re: [PATCH] drm/panfrost: Update create_bo flags comment

2022-01-10 Thread Steven Price
On 09/01/2022 16:37, Alyssa Rosenzweig wrote: > Update a comment stating create_bo took no flags, since it now takes a > bit mask of optional flags NOEXEC and HEAP. > > Signed-off-by: Alyssa Rosenzweig Reviewed-by: Steven Price I'll push this to drm-misc-next. Th

Re: [PATCH 2/2] drm/panfrost: adjusted job affinity for dual core group GPUs

2022-01-10 Thread Steven Price
On 24/12/2021 08:56, Alexey Sheplyakov wrote: > Hi, > > On 23.12.2021 18:11, Alyssa Rosenzweig wrote: >>> The kernel driver itself can't guess which jobs need a such a strict >>> affinity, so setting proper requirements is the responsibility of >>> the userspace (Mesa). However the userspace is

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-17 Thread Steven Price
On 17/12/2021 09:28, Dan Carpenter wrote: > On Fri, Dec 17, 2021 at 09:16:19AM +0000, Steven Price wrote: >> On 17/12/2021 09:10, Dan Carpenter wrote: >>> On Fri, Dec 17, 2021 at 08:55:50AM +, Steven Price wrote: >>>> However this one is harder to fix wi

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-17 Thread Steven Price
On 17/12/2021 09:10, Dan Carpenter wrote: > On Fri, Dec 17, 2021 at 08:55:50AM +0000, Steven Price wrote: >> However this one is harder to fix without setting an arbitrary cap on >> the number of BOs during a sumbit. I'm not sure how other drivers handle >> this - the ones

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-17 Thread Steven Price
On 16/12/2021 17:49, Alyssa Rosenzweig wrote: >> This provides an easy method for user >> space to trigger the OOM killer (by temporarily allocating large amounts >> of kernel memory) > > panfrost user space has a lot of easy ways to trigger to the OOM killer > unfortunately if this is

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-17 Thread Steven Price
On 16/12/2021 17:12, Rob Herring wrote: > On Thu, Dec 16, 2021 at 10:16 AM Steven Price wrote: >> >> panfrost_copy_in_sync() takes the number of fences from user space >> (in_sync_count) and used to kvmalloc() an array to hold that number of >> fences before processing

[PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-16 Thread Steven Price
Reported-by: Dan Carpenter Signed-off-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 44 - 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 96bb5a465627..12

Re: [bug report] new kvmalloc() WARN() triggered by DRM ioctls tracking

2021-12-16 Thread Steven Price
On 16/12/2021 14:15, Boris Brezillon wrote: > Hi Steve, > > On Thu, 16 Dec 2021 14:02:25 + > Steven Price wrote: > >> + Boris >> >> On 16/12/2021 12:08, Dan Carpenter wrote: >>> Hi DRM Devs, >>> >>> In commit 7661809d493b ("

Re: [bug report] new kvmalloc() WARN() triggered by DRM ioctls tracking

2021-12-16 Thread Steven Price
+ Boris On 16/12/2021 12:08, Dan Carpenter wrote: > Hi DRM Devs, > > In commit 7661809d493b ("mm: don't allow oversized kvmalloc() calls") > from July, Linus added a WARN_ONCE() for "crazy" allocations over 2GB. > I have a static checker warning for this and most of the warnings are > from DRM

Re: [PATCH v3 1/3] dt-bindings: gpu: mali-bifrost: Document RZ/G2L support

2021-12-13 Thread Steven Price
on: GPU interrupt > + - description: Event interrupt > >interrupt-names: > +minItems: 3 > items: >- const: job >- const: mmu >- const: gpu > + - const: event FWIW: I think it's fair to add the "event" interrup

[PATCH] drm/plane: Move range check for format_count earlier

2021-12-03 Thread Steven Price
nction to avoid allocating those resources in the first place. Signed-off-by: Steven Price --- drivers/gpu/drm/drm_plane.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 82afb854141b..fd0bf90fb4c2

Re: [PATCH] drm/komeda: return early if drm_universal_plane_init() fails.

2021-12-03 Thread Steven Price
> the common code. > > Reported-by: Steven Price > Signed-off-by: Liviu Dudau Reviewed-by: Steven Price Looks correct, although I note there is a path in __drm_universal_plane_init() which doesn't clean up properly. I'll send a patch for that too. Thanks, Steve > --- > driv

Re: [PATCH] drm/komeda: Fix an undefined behavior bug in komeda_plane_add()

2021-12-02 Thread Steven Price
On 01/12/2021 21:15, Liviu Dudau wrote: > On Wed, Dec 01, 2021 at 03:44:03PM +0000, Steven Price wrote: >> On 30/11/2021 14:25, Zhou Qingyang wrote: >>> In komeda_plane_add(), komeda_get_layer_fourcc_list() is assigned to >>> formats and used

Re: [PATCH] drm/komeda: Fix an undefined behavior bug in komeda_plane_add()

2021-12-01 Thread Steven Price
On 30/11/2021 14:25, Zhou Qingyang wrote: > In komeda_plane_add(), komeda_get_layer_fourcc_list() is assigned to > formats and used in drm_universal_plane_init(). > drm_universal_plane_init() passes formats to > __drm_universal_plane_init(). __drm_universal_plane_init() further > passes formats to

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-01 Thread Steven Price
ligns the callback with its callers. Fixes the ingenic driver, > which already returns an error pointer. > > Also update the callers to handle the involved types more strictly. > > Signed-off-by: Thomas Zimmermann Reviewed-by: Steven Price > --- > There is an alternat

Re: dri/drm/kms question with regards to minor faults

2021-11-03 Thread Steven Price
On 01/11/2021 05:20, Bert Schiettecatte wrote: > Hi John > >> Coincidentally, I've been looking at Panfrost on RK3288 this week as >> well! I'm testing it with a project that has been using the binary blob >> driver for several years and unfortunately Panfrost seems to use ~15% >> more CPU. >>

Re: [PATCH v5 6/8] drm/panfrost: Support synchronization jobs

2021-10-04 Thread Steven Price
On 04/10/2021 13:24, Boris Brezillon wrote: > On Mon, 4 Oct 2021 12:30:42 +0100 > Steven Price wrote: [...] >> >> It took me a while to convince myself that the reference counting for >> the PM reference is correct. Before panfrost_job_hw_submit() always >> re

Re: [PATCH v5 6/8] drm/panfrost: Support synchronization jobs

2021-10-04 Thread Steven Price
hen this is clearly better. A couple of minor points below, but as far as I can tell this is functionally correct. Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_drv.c | 9 +++-- > drivers/gpu/drm/panfrost/panfrost_job.c | 6 ++ > include/uapi/drm/panfrost

Re: [PATCH v5 5/8] drm/panfrost: Add a new ioctl to submit batches

2021-10-04 Thread Steven Price
fields by a version field which is mapped to > a tuple internally > > v3: > * Re-use panfrost_get_job_bos() and panfrost_get_job_in_syncs() in the > old submit path > > Signed-off-by: Boris Brezillon Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panf

Re: [PATCH v2 4/5] drm/panfrost: Add a PANFROST_BO_GPUONLY flag

2021-10-01 Thread Steven Price
On 01/10/2021 15:34, Boris Brezillon wrote: > This lets the driver reduce shareability domain of the MMU mapping, > which can in turn reduce access time and save power on cache-coherent > systems. > > Signed-off-by: Boris Brezillon This seems reasonable to me - it matches the kbase

Re: [PATCH] drm/panfrost: Add PANFROST_BO_NO{READ,WRITE} flags

2021-10-01 Thread Steven Price
t looks like you're correct here - I've never looked closely into exactly how pilot shaders work. It would appear that the DDK checks (in user space) for the GPU-executable + GPU-writable condition and moans. So this obviously isn't used by the DDK as it stands. For the actual patch: Reviewed-by: S

Re: [PATCH v2 2/3] drm/i915/utils: do not depend on config being defined

2021-09-30 Thread Steven Price
On 29/09/2021 19:33, Lucas De Marchi wrote: > Like the IS_ENABLED() counterpart, we can make IS_CONFIG_NONZERO() to > return the right thing when the config is not defined rather than a > build error, with the limitation that it can't be used on preprocessor > context. > > The trick here is that

Re: [PATCH] panfrost: make mediatek_mt8183_supplies and mediatek_mt8183_pm_domains static

2021-09-20 Thread Steven Price
hould it be static? > > drivers/gpu/drm/panfrost/panfrost_drv.c:642:12: warning: symbol > 'mediatek_mt8183_pm_domains' was not declared. Should it be static? > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong Reviewed-by: Steven Price I'll push to drm-misc-next. Than

Re: [PATCH 5/9] drm/panfrost: simplify getting .driver_data

2021-09-20 Thread Steven Price
On 20/09/2021 10:05, Wolfram Sang wrote: > We should get 'driver_data' from 'struct device' directly. Going via > platform_device is an unneeded step back and forth. > > Signed-off-by: Wolfram Sang > --- Reviewed-by: Steven Price I'll push this to drm-misc-next. Thanks, St

Re: [PATCH v2] drm/panfrost: Calculate lock region size correctly

2021-09-17 Thread Steven Price
On 03/09/2021 10:49, Steven Price wrote: > It turns out that when locking a region, the region must be a naturally > aligned power of 2. The upshot of this is that if the desired region > crosses a 'large boundary' the region size must be increased > significantly to ensure that the l

[PATCH v2] drm/panfrost: Calculate lock region size correctly

2021-09-03 Thread Steven Price
from the end because the end address is exclusive). The start address is then aligned based on the size (this is technically unnecessary as the hardware will ignore these bits, but the spec advises to do this "to avoid confusion"). Reviewed-by: Boris Brezillon Signed-off-by: St

Re: [PATCH] drm/panfrost: Calculate lock region size correctly

2021-09-03 Thread Steven Price
On 03/09/2021 09:51, Boris Brezillon wrote: > On Thu, 2 Sep 2021 15:00:38 +0100 > Steven Price wrote: > >> It turns out that when locking a region, the region must be a naturally >> aligned power of 2. The upshot of this is that if the desired region >> crosses a

[PATCH] drm/panfrost: Calculate lock region size correctly

2021-09-02 Thread Steven Price
from the end because the end address is exclusive). The start address is then aligned based on the size (this is technically unnecessary as the hardware will ignore these bits, but the spec advises to do this "to avoid confusion"). Signed-off-by: Steven Price --- See previous di

Re: [PATCH] drm/panfrost: Make use of the helper function devm_platform_ioremap_resource()

2021-09-02 Thread Steven Price
On 31/08/2021 08:53, Cai Huoqing wrote: > Use the devm_platform_ioremap_resource() helper instead of > calling platform_get_resource() and devm_ioremap_resource() > separately > > Signed-off-by: Cai Huoqing Reviewed-by: Steven Price I'll push this to drm-misc-next.

Re: [PATCH] panfrost: Don't cleanup the job if it was successfully queued

2021-09-01 Thread Steven Price
do the same mistake again. > > Fixes: 53516280cc38 ("drm/panfrost: use scheduler dependency tracking") > Signed-off-by: Boris Brezillon Reviewed-by: Steven Price And also unlike last time... Tested-by: Steven Price Thanks for the clean up - I should have actually tested the pr

Re: [PATCH v2] drm/panfrost: Use upper/lower_32_bits helpers

2021-08-26 Thread Steven Price
ly "creative" way of writing upper_32_bits. > > v2: Use helpers for one more call site and add review tag (Steven). > > Signed-off-by: Alyssa Rosenzweig > Reviewed-by: Rob Herring (v1) > Reviewed-by: Steven Price Pushed to drm-misc-next Thanks, Steve > ---

Re: [PATCH v2 4/4] drm/panfrost: Handle non-aligned lock addresses

2021-08-25 Thread Steven Price
On 25/08/2021 15:07, Alyssa Rosenzweig wrote: >>> In practice, the current callers pass PAGE_SIZE aligned inputs, avoiding >>> the bug. Therefore this doesn't need to be backported. Still, that's a >>> happy accident and not a precondition of lock_region, so we let's do the >>> right thing to

Re: [PATCH] drm/panfrost: Use upper/lower_32_bits helpers

2021-08-25 Thread Steven Price
er_32_bits(gpuva)); gpu_write(pfdev, GPU_INT_CLEAR, GPU_IRQ_CLEAN_CACHES_COMPLETED | GPU_IRQ_PERFCNT_SAMPLE_COMPLETED); ---8<-- With that squashed in: Reviewed-by: Steven Price Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_

Re: [PATCH v2 4/4] drm/panfrost: Handle non-aligned lock addresses

2021-08-25 Thread Steven Price
oundary) requires locking *at least* 0x-0x2 (i.e. locking the first 8GB). This appears to be broken in kbase (which actually does zero out the low bits of the address) - I've raised a bug internally so hopefully someone will tell me if I've read the spec completely wrong here. Steve > Signed

Re: [PATCH v2 1/4] drm/panfrost: Simplify lock_region calculation

2021-08-25 Thread Steven Price
ed. > > The new form of the calculation corrects this special case and avoids > the undefined behaviour. > > Signed-off-by: Alyssa Rosenzweig > Reported-and-tested-by: Chris Morgan > Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") > Cc:

Re: [PATCH 3/3] drm/panfrost: Clamp lock region to Bifrost minimum

2021-08-23 Thread Steven Price
On 23 August 2021 22:13:45 BST, Alyssa Rosenzweig wrote: >> > When locking a region, we currently clamp to a PAGE_SIZE as the minimum >> > lock region. While this is valid for Midgard, it is invalid for Bifrost, >> >> While the spec does seem to state it's invalid for Bifrost - kbase >> didn't

Re: [PATCH 2/3] drm/panfrost: Use u64 for size in lock_region

2021-08-23 Thread Steven Price
On 23 August 2021 22:11:09 BST, Alyssa Rosenzweig wrote: >> > Mali virtual addresses are 48-bit. Use a u64 instead of size_t to ensure >> > we can express the "lock everything" condition as ~0ULL without relying >> > on platform-specific behaviour. >> >> 'platform-specific behaviour' makes it

Re: [PATCH 1/3] drm/panfrost: Simplify lock_region calculation

2021-08-23 Thread Steven Price
On 23 August 2021 22:09:08 BST, Alyssa Rosenzweig wrote: >> > In lock_region, simplify the calculation of the region_width parameter. >> > This field is the size, but encoded as log2(ceil(size)) - 1. >> > log2(ceil(size)) may be computed directly as fls(size - 1). However, we >> > want to use the

Re: [PATCH 3/3] drm/panfrost: Clamp lock region to Bifrost minimum

2021-08-23 Thread Steven Price
e 4k page size. Add a > hardware definition for the minimum lock region size (corresponding to > KBASE_LOCK_REGION_MIN_SIZE_LOG2 in kbase) and respect it. > > Signed-off-by: Alyssa Rosenzweig > Tested-by: Chris Morgan > Cc: Reviewed-by: Steven Price > --- > drivers/gpu

Re: [PATCH 2/3] drm/panfrost: Use u64 for size in lock_region

2021-08-23 Thread Steven Price
itial panfrost driver") Reviewed-by: Steven Price Steve > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c > b/drivers/gpu/drm/panfrost/

Re: [PATCH 1/3] drm/panfrost: Simplify lock_region calculation

2021-08-23 Thread Steven Price
gger issue with it being completely wrong when size == ~0 (see below). > Signed-off-by: Alyssa Rosenzweig > Reported-and-tested-by: Chris Morgan > Cc: However, I've confirmed this returns the same values and is certainly more simple, so: Reviewed-by: Steven Price > --- > drive

Re: [PATCH] drm/panfrost: devfreq: Don't display error for EPROBE_DEFER

2021-07-23 Thread Steven Price
r would also allow us to use dev_err_probe(). But as a point fix this patch is fine and correct. Thanks! > Signed-off-by: Chris Morgan Reviewed-by: Steven Price I'll apply this to drm-misc-next. Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++- > 1 f

Re: [PATCH v2] drm/of: free the iterator object on failure

2021-07-15 Thread Steven Price
On 14/07/2021 16:26, Laurent Pinchart wrote: > Hi Steven, > > Thank you for the patch. > > On Wed, Jul 14, 2021 at 03:33:00PM +0100, Steven Price wrote: >> When bailing out due to the sanity check the iterator value needs to be >> freed because the early return prev

[PATCH v2] drm/of: free the iterator object on failure

2021-07-14 Thread Steven Price
When bailing out due to the sanity check the iterator value needs to be freed because the early return prevents for_each_child_of_node() from doing the dereference itself. Fixes: 6529007522de ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order") Signed-off-by: Steven Price --- drive

Re: [PATCH] drm/of: free the iterator object on failure

2021-07-13 Thread Steven Price
On 12/07/2021 22:55, Laurent Pinchart wrote: > Hi Steven, Hi Laurent, > On Mon, Jul 12, 2021 at 10:31:52PM +0100, Steven Price wrote: >> On 12/07/2021 17:50, Laurent Pinchart wrote: >>> On Mon, Jul 12, 2021 at 04:57:58PM +0100, Steven Price wrote: >>>> When ba

Re: [PATCH] drm/of: free the iterator object on failure

2021-07-12 Thread Steven Price
On 12/07/2021 17:50, Laurent Pinchart wrote: > Hi Steven, > > Thank you for the patch. > > On Mon, Jul 12, 2021 at 04:57:58PM +0100, Steven Price wrote: >> When bailing out due to the sanity check the iterator value needs to be >> freed because the early return prev

[PATCH] drm/of: free the iterator object on failure

2021-07-12 Thread Steven Price
When bailing out due to the sanity check the iterator value needs to be freed because the early return prevents for_each_child_of_node() from doing the dereference itself. Fixes: 4ee48cc5586b ("drm: of: Fix double-free bug") Signed-off-by: Steven Price --- drivers/gpu/drm/drm_of.c |

Re: [PATCH v3] drm/panfrost:fix the exception name always "UNKNOWN"

2021-07-12 Thread Steven Price
value > to custom,so it's better fault_status don't (& 0xFF). > > Signed-off-by: ChunyouTang Reviewed-by: Steven Price Boris's change has actually modified panfrost_exception_name() to no longer take pfdev in drm-misc-next. However, I'll just fix this up when I apply it. Thanks, St

<    1   2   3   4   5   6   7   8   >