summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2026-06-02 19:53:05 +0100
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-07-28 11:36:45 +0200
commitfb9b87145624eedaf3d50edac9b11d707494cb5b (patch)
tree0230a548499d76f8a56cc7bb641e841e00c3f0f8 /drivers/media
parent4f26c8345dbfa92f19078c788be1b9bfd425ed60 (diff)
downloadlinux-next-fb9b87145624eedaf3d50edac9b11d707494cb5b.tar.gz
linux-next-fb9b87145624eedaf3d50edac9b11d707494cb5b.zip
media: mali-c55: fix dropped last AEC histogram zone weight
The 15x15 AEC histogram metering grid has 225 per-zone weights, packed by userspace as a u8 array. The driver writes the first 56 registers (zones 0 through 223) in a loop, then handles the final register on its own to keep static analysers from flagging the array access. That separate path computes the address and value for the 225th weight (the bottom-right zone) but never issues the register write, so the zone keeps its stale or default weight. Any non-default weight userspace sets for the last zone is silently ignored, skewing auto-exposure metering. Both the AEXP_HIST_WEIGHTS and AEXP_IHIST_WEIGHTS blocks are affected as they share this handler. Issue the missing write, masking the value as the loop does. Fixes: 01535ea08674 ("media: platform: Add mali-c55 parameters video node") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-8 Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/arm/mali-c55/mali-c55-params.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/drivers/media/platform/arm/mali-c55/mali-c55-params.c
index de0e9d898db7..33e2232ec8f5 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c
@@ -212,6 +212,7 @@ mali_c55_params_aexp_hist_weights(struct mali_c55 *mali_c55,
val = params->zone_weights[MALI_C55_MAX_ZONES - 1];
addr = base + MALI_C55_AEXP_HIST_ZONE_WEIGHTS_OFFSET + (4 * 56);
+ mali_c55_ctx_write(mali_c55, addr, val & MALI_C55_AEXP_HIST_ZONE_WEIGHT_MASK);
}
static void mali_c55_params_digital_gain(struct mali_c55 *mali_c55,