From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 535A833F8BB for ; Wed, 7 Jan 2026 14:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767795614; cv=none; b=DXINlXyThbOLgoLvZYV39e8hTBXmmQCV2k+svjsEsOMkbv/apKIQPE+Rfpc8YjpCFFDpdtZNPhvk3nInxd0g620FhdnK0+gNEkiwMAfrukPKm1lj8bbIeNP6gS/l4OzRIMAkUrF34NGX7t6wW7IPevc9/tO3SC1MOMHulTrqk0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767795614; c=relaxed/simple; bh=RP6yrOmfkgG1pSCCp/KgSQ837psbCw1sb+DDsPfjTA0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qL6Zg95h72q0B5oopUUfBJ8CgboNTmJWToyXrtyw9QhpFAcbqdAJReoxZMsVZhenHByDGeGXA0A1OPLVP4dD2N/04ms0lpzH3z93jnZRlaXJepVfPSFM8DWMpUMTKgLCoCSvYleCoi+AibUaUd0Kax2GR12lUleCDaKO1jVuNIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FjAmDuZl; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FjAmDuZl" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-42fb4eeb482so1158705f8f.0 for ; Wed, 07 Jan 2026 06:20:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767795611; x=1768400411; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/3EuWWmPchcdKXlx3oZPsaTz80UKO5qPXs+yQV6vLYk=; b=FjAmDuZlSZE5kI+yW/BorTqN0MGGTsR0db90eFSlkd18rEgZXF/9Q+IJrjIVOPVbWI goVrwAiwmjuGybZyplrEX4TAMPDG6KXxzORDcJ6p7n8ATSRBgNstvuwO3PhB1O6HYodi oJcaEXRDkKpxcGOVA0src+6a+dzq5YFmcvcj2v1K8uKBNJKms/UQGG3pLB457kCi3Czl rJBAeRPbANvXE27bJjr2XQZm/FGBuArF1iVzZTLk0Fp6yJK0Vm+Aq4ksLwZ8vjFKjN0w bW7RaQ3mi8rrxkeu8+TQ0V+Utgyn29Zq0Pbl2vkTJ3PbT91t9j/8FquOWJC+7EvR+ewM RSHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767795611; x=1768400411; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/3EuWWmPchcdKXlx3oZPsaTz80UKO5qPXs+yQV6vLYk=; b=poPS/t5qR34JGimBP31cn4YMdvNSZK62ri5eOSu15+VFrl3lskzhGe9ukv+h7Gn/PE qf4I+36T0sqO1e6siA8Gdz/74JD5c23HtoFv2T0HBlXHTZWXdiL7EHfwj9wgpLU0SQCD xNXtnjppBsEuqVC3Ms9RyZdeibBCsz/vssbkg7JebhXEfBVHzGkOKwNdwyfC4ARkpsuK l2h5dc3bShON+MGT2c2q3bhlyL1CC67HWy6Q6upb+XCykoQC6rmOvwglr0l1KK4GKkd1 YRFgE9F9wk/24E8tkYIwCzBrOC0EHrJVJxBBEK3ca5VO9HWleml63hhz3h/S0SzfjaI4 HtTw== X-Forwarded-Encrypted: i=1; AJvYcCXeI1i/tXTxEjVtUmKWkv6lhGe8ZWG+2XRFdc1zEnTTE7M37zVPsarsqiM0hsrT2RfZeICftbwbVp/7n9M=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2TgGaMHtmIDK+XYxkOR/hjW7RqwFhIni9dD+zZHi3V1zXS2bI gR2VrzwyBo8MMgQVkNx26cpFWR960aCXHTQQSt/PT6ewrPMSlnS2G24rM7VVVa/Uztk= X-Gm-Gg: AY/fxX7tHmCzFCSLJ+OzK985mILPlr10EJS8BBOH3FBGe1i1FxVXvNqlEDFKJzjiL4z hNdA2SgxITstMfKCAALjHKmbn2JOcqSmp1AxKt+Lg02SuWUnyAB279Quzb1r9x5ty0F+bO7wmMR JXYH4t/RRu2YE1uEYi15ZNY3Ci8iFqPDxOkd07VB/6c+EP/8vkoYfd8viCjAQy9tORv9Z3lPDKj X8NDm1mQrPHLAjNv33zOhbjK07tUaBHLszZ0+XRGXUFRs1yXBfA5xFAuJZ8SdyG/c5YfjvoAOvA AkaFQ35fG0AcM6/4ICnbg0soBhp4lwxfd7dUNyKxUw9lpO0W1pjO16AYMRhyHYwIw9r5RmDomW5 Lh3tbZRvM0yFPSYLt3CH2TOkycJtrZkJALMAjPvn1V3LIxBO2TijFKtNYzQVM41oo+qO6goh5sE CnskxQgDTQ7yixQoHcWcrekIU6h8Y= X-Google-Smtp-Source: AGHT+IHUqb1cXUtZCpRJ8P4UFLSIpAgDZ36o1m7wd/K9meyda/t653aOMHHTvrT9/dtiigGlLK+MGQ== X-Received: by 2002:a05:6000:2302:b0:431:316:920a with SMTP id ffacd0b85a97d-432c3628fdemr2605337f8f.8.1767795610407; Wed, 07 Jan 2026 06:20:10 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd5ff319sm10689604f8f.43.2026.01.07.06.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 06:20:09 -0800 (PST) Date: Wed, 7 Jan 2026 17:20:06 +0300 From: Dan Carpenter To: Karthikey D Kadati Cc: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 RESEND v2 1/3] media: atomisp: replace shadow zoom structs with v4l2_rect Message-ID: References: <81e2d12c-342b-4b88-88a0-3e24115541aa@kernel.org> <20260107134844.68074-1-karthikey3608@gmail.com> <20260107134844.68074-2-karthikey3608@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260107134844.68074-2-karthikey3608@gmail.com> On Wed, Jan 07, 2026 at 07:18:42PM +0530, Karthikey D Kadati wrote: > Remove custom atomisp_zoom_point and atomisp_zoom_region structs and > > usage in favor of standard v4l2_rect within atomisp_dz_config. > > This aligns the driver with V4L2 standards and removes unnecessary > > custom types. > > Also standardizes the internal ia_css_region struct members to match > > V4L2 naming conventions (left, top, width, height) to facilitate the > > bridge mapping. > > Updates atomisp_cmd.c and sh_css_params.c to use the new member names > > and ensures safe math using long long casts to prevent overflow during > > resolution scaling. > The commit message has extra new lines obviously. > diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c > index 327836372..4ed6b8aea 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c > @@ -1764,15 +1764,13 @@ int atomisp_calculate_real_zoom_region(struct atomisp_sub_device *asd, > return -EINVAL; > } > > - if (dz_config->zoom_region.resolution.width > - == asd->sensor_array_res.width > - || dz_config->zoom_region.resolution.height > - == asd->sensor_array_res.height) { > + if (dz_config->zoom_region.width == asd->sensor_array_res.width || > + dz_config->zoom_region.height == asd->sensor_array_res.height) { > /*no need crop region*/ > - dz_config->zoom_region.origin.x = 0; > - dz_config->zoom_region.origin.y = 0; > - dz_config->zoom_region.resolution.width = eff_res.width; > - dz_config->zoom_region.resolution.height = eff_res.height; > + dz_config->zoom_region.left = 0; > + dz_config->zoom_region.top = 0; > + dz_config->zoom_region.width = eff_res.width; > + dz_config->zoom_region.height = eff_res.height; > return 0; > } > > @@ -1783,18 +1781,18 @@ int atomisp_calculate_real_zoom_region(struct atomisp_sub_device *asd, > */ > > if (!IS_ISP2401) { > - dz_config->zoom_region.origin.x = dz_config->zoom_region.origin.x > - * eff_res.width > - / asd->sensor_array_res.width; > - dz_config->zoom_region.origin.y = dz_config->zoom_region.origin.y > - * eff_res.height > - / asd->sensor_array_res.height; > - dz_config->zoom_region.resolution.width = dz_config->zoom_region.resolution.width > - * eff_res.width > - / asd->sensor_array_res.width; > - dz_config->zoom_region.resolution.height = dz_config->zoom_region.resolution.height > - * eff_res.height > - / asd->sensor_array_res.height; > + dz_config->zoom_region.left = > + (s32)((long long)dz_config->zoom_region.left * > + eff_res.width / asd->sensor_array_res.width); > + dz_config->zoom_region.top = > + (s32)((long long)dz_config->zoom_region.top * > + eff_res.height / asd->sensor_array_res.height); > + dz_config->zoom_region.width = > + (u32)((long long)dz_config->zoom_region.width * > + eff_res.width / asd->sensor_array_res.width); > + dz_config->zoom_region.height = > + (u32)((long long)dz_config->zoom_region.height * > + eff_res.height / asd->sensor_array_res.height); Why do we need this new casting? Is it a bugfix? I don't love the casts to s32 and u32. Those are unnecessary. Also width and height are s32 so why are we casting to u32? Same comments for the other casts later on. There are more style changes than strictly necessary to just rename the struct members. regards, dan carpenter