From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A0E6352C57 for ; Mon, 12 Jan 2026 11:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768215606; cv=none; b=T+NPUSAKIdxu6fF0LhsMUKrr9zcGH5ArfTq5RC5FLgMluRN3dVno4qKCqBjRnuDMewuBiZbn73BYqVDt/mj+GYzqZzWAD/nXkeZRyNiX/kqsGJ89YaMTviE6zTe2HmK53DsOniiyK8q2jOl0QM7QydpIV+P99iBaNoOcP/j3P6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768215606; c=relaxed/simple; bh=66BKk/4ygt6/qommiW1LbYtM+Gz37jh1jetETCOXjX4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=txoAl3/Tf0q4R95cfLfwpURfRWhPTk/kx8FUzUKurtI8hY9zzv+VE0KUuu648taHGwDYNgsZrRHWxrX4DWuqkV6zYR96CpZ6QEDysi1JoqqDm706TQ5na4iDyVp0U51ZK/V/wnbcbTLEgLx9Kv2GrNWJ2YgiYsIeJ1+j7Zxe5Fw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R4ZhjcUw; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R4ZhjcUw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768215605; x=1799751605; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=66BKk/4ygt6/qommiW1LbYtM+Gz37jh1jetETCOXjX4=; b=R4ZhjcUwLM4+gQugC+s4YmLMUFdbFxCoYsIl49d89VMc0EO1kMBWhjjt aPNA+F0JIM/BsrlyeVkFb8gQqoLHOlnkhI+eklot5tb+C5UfpuZ+hVsAT DOu/LLBMyTd+VAnBeVKWpNyk9TKnWZgyrWSbaoX2pyVIVXVNAM71heNix lr2D9Yt1OalU9PowgVi+KITPjW72Mvn1IKJJf163XtppgWVUDJ4kAOUjr DhE8JX8cIqutVh+CTDk99y7ewZtK7leDahX2Plyxabod2EJoVKaB7w3ac E0DaYFLf2L8MCyfeabGLw0tLwbdNPU0bF13K5+Mj2BUZ+C8MIeHmWg7iv w==; X-CSE-ConnectionGUID: KYrOCS1kTyqLqFN0Ilel6g== X-CSE-MsgGUID: nMC6ScoLSaepNeryral78Q== X-IronPort-AV: E=McAfee;i="6800,10657,11668"; a="69471588" X-IronPort-AV: E=Sophos;i="6.21,219,1763452800"; d="scan'208";a="69471588" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2026 03:00:05 -0800 X-CSE-ConnectionGUID: zU0uUBbaSD+i1HG6/RAbwA== X-CSE-MsgGUID: swhQPFCPQpeLCiXWg3TI3g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,219,1763452800"; d="scan'208";a="204079907" Received: from zzombora-mobl1 (HELO kekkonen.fi.intel.com) ([10.245.245.52]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2026 03:00:03 -0800 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 570E41229EA; Mon, 12 Jan 2026 13:00:00 +0200 (EET) Date: Mon, 12 Jan 2026 13:00:00 +0200 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: Karthikey D Kadati Cc: Hans de Goede , Mauro Carvalho Chehab , Andy Shevchenko , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: atomisp: remove private white balance IOCTLs Message-ID: References: <20251231052427.58840-1-karthikey3608@gmail.com> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251231052427.58840-1-karthikey3608@gmail.com> Hi Karthikey, On Wed, Dec 31, 2025 at 10:54:27AM +0530, Karthikey D Kadati wrote: > This patch resolves a MUST-FIX graduation blocker identified in the > atomisp TODO by removing the private ATOMISP_IOC_G_ISP_WHITE_BALANCE > and ATOMISP_IOC_S_ISP_WHITE_BALANCE and replacing them with standard > V4L2 control handling. > > The private IOCTLs were used to set white balance parameters. This > functionality is now mapped to the standard V4L2 controls > V4L2_CID_RED_BALANCE and V4L2_CID_BLUE_BALANCE. > > A helper function `atomisp_v4l2_set_wb` is introduced to translate the > V4L2 control values to the driver's internal configuration format. > > Signed-off-by: Karthikey D Kadati > --- > .../media/atomisp/include/linux/atomisp.h | 5 +- > .../staging/media/atomisp/pci/atomisp_ioctl.c | 49 ++++++++++++++++--- > 2 files changed, 44 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h > index 3c8fa3f58..fcf116cc4 100644 > --- a/drivers/staging/media/atomisp/include/linux/atomisp.h > +++ b/drivers/staging/media/atomisp/include/linux/atomisp.h > @@ -741,10 +741,7 @@ enum atomisp_burst_capture_options { > _IOW('v', BASE_VIDIOC_PRIVATE + 15, struct atomisp_ctc_table) > > /* white balance Correction */ > -#define ATOMISP_IOC_G_ISP_WHITE_BALANCE \ > - _IOR('v', BASE_VIDIOC_PRIVATE + 16, struct atomisp_wb_config) > -#define ATOMISP_IOC_S_ISP_WHITE_BALANCE \ > - _IOW('v', BASE_VIDIOC_PRIVATE + 16, struct atomisp_wb_config) > + > > /* fpn table loading */ > #define ATOMISP_IOC_S_ISP_FPN_TABLE \ > diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c > index bb8b2f221..5c0a1d92b 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c > @@ -1083,6 +1083,38 @@ static int atomisp_g_ctrl(struct file *file, void *fh, > * applications initialize the id and value fields of a struct v4l2_control > * and call this ioctl. > */ > +static int atomisp_v4l2_set_wb(struct atomisp_sub_device *asd, int id, > + int value) > +{ > + struct atomisp_device *isp = asd->isp; > + struct atomisp_wb_config config; > + int ret; > + > + if (atomisp_css_get_wb_config(asd, &config)) { I'm not sure this makes sense. How will the caller know the value of integer_bits? I'd think the IOCTL interface of this driver should probably be largely removed, to be replaced by the parameter buffer. > + dev_err(isp->dev, "%s: can't get wb config\n", __func__); > + return -EINVAL; > + } > + > + switch (id) { > + case V4L2_CID_BLUE_BALANCE: > + config.b = value << (16 - 8 - config.integer_bits + 1); > + break; > + case V4L2_CID_RED_BALANCE: > + config.r = value << (16 - 8 - config.integer_bits + 1); > + break; > + default: > + return -EINVAL; > + } > + > + ret = atomisp_white_balance_param(asd, 1, &config); > + if (ret) { > + dev_err(isp->dev, "%s: set wb config failed\n", __func__); > + return ret; > + } > + > + return 0; > +} > + > static int atomisp_s_ctrl(struct file *file, void *fh, > struct v4l2_control *control) > { > @@ -1122,6 +1154,17 @@ static int atomisp_s_ctrl(struct file *file, void *fh, > case V4L2_CID_ATOMISP_LOW_LIGHT: > ret = atomisp_low_light(asd, 1, &control->value); > break; > + case V4L2_CID_AUTO_WHITE_BALANCE: > + /* > + * TODO: Auto White Balance is not supported yet. > + * It is currently handled by the ISP. > + */ > + ret = 0; > + break; > + case V4L2_CID_RED_BALANCE: > + case V4L2_CID_BLUE_BALANCE: > + ret = atomisp_v4l2_set_wb(asd, control->id, control->value); > + break; > default: > ret = -EINVAL; > break; > @@ -1484,13 +1527,7 @@ static long atomisp_vidioc_default(struct file *file, void *fh, > err = atomisp_ctc(asd, 1, arg); > break; > > - case ATOMISP_IOC_G_ISP_WHITE_BALANCE: > - err = atomisp_white_balance_param(asd, 0, arg); > - break; > > - case ATOMISP_IOC_S_ISP_WHITE_BALANCE: > - err = atomisp_white_balance_param(asd, 1, arg); > - break; > > case ATOMISP_IOC_G_3A_CONFIG: > err = atomisp_3a_config_param(asd, 0, arg); -- Regards, Sakari Ailus