From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 6EC4535770B for ; Wed, 7 Jan 2026 14:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767797544; cv=none; b=iavfpcQCUd8V/u68d7xDq5way+kYSMrii4vaXtMMmyjHAAGghDHTMC7aSsoxHxKdhfRtVKlNnrCiF1HWowvSFWPNWNQ97sipkQkUXNkPCI4XTrbYW4U6OSlDsvn2TBt6TCxCe8AKDWiCCgno9CVoHtDLoW9krqBdzWxsDtnnYZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767797544; c=relaxed/simple; bh=rEI4N32RTUkp6hm6LhzSfgzxDUsDYJqv7mwhnacev+0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Pc0HVGvzYWxPkaubxdviW6KVLKP4Yv2V3nNjG1CmnIuOPcVUVYIychmCEeO6hdzC9B64wcZ2eUbM31O6PttaXsy0MbmCkmYqsw1gGZkq1cUEycyY9QcrIDEG2fcb1XepnKj/grMmlJk1IkkVRXY3JE66olBGDRwskbauougopNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1vdUtK-0002O9-IV; Wed, 07 Jan 2026 15:52:06 +0100 Message-ID: <1f4720ea-fa9c-41b7-9a6c-24abffa4bd77@pengutronix.de> Date: Wed, 7 Jan 2026 15:52:04 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 18/22] media: rockchip: rga: move rga_fmt to rga-hw.h To: Nicolas Dufresne , Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de References: <20251203-spu-rga3-v2-0-989a67947f71@pengutronix.de> <20251203-spu-rga3-v2-18-989a67947f71@pengutronix.de> Content-Language: en-US From: =?UTF-8?Q?Sven_P=C3=BCschel?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: s.pueschel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hi, On 12/24/25 4:59 PM, Nicolas Dufresne wrote: > Le mercredi 03 décembre 2025 à 16:52 +0100, Sven Püschel a écrit : >> Move rga_fmt to rga-hw in preparation of the RGA3 addition, as the struct >> contains many RGA2 specific values. They are used to write the correct >> register values quickly based on the chosen format. Therefore the >> pointer to the rga_fmt struct is kept but changed to an opaque void >> pointer outside of the rga-hw.h. [...] >> diff --git a/drivers/media/platform/rockchip/rga/rga-hw.h b/drivers/media/platform/rockchip/rga/rga-hw.h >> index fffcab0131225..3bc4b1f5acba2 100644 >> --- a/drivers/media/platform/rockchip/rga/rga-hw.h >> +++ b/drivers/media/platform/rockchip/rga/rga-hw.h >> @@ -6,6 +6,8 @@ >>  #ifndef __RGA_HW_H__ >>  #define __RGA_HW_H__ >> >> +#include >> + >>  #define RGA_CMDBUF_SIZE 0x20 >> >>  /* Hardware limits */ >> @@ -431,4 +433,14 @@ union rga_pat_con { >>   } data; >>  }; >> >> +struct rga_fmt { >> + u32 fourcc; >> + int depth; >> + u8 uv_factor; >> + u8 y_div; >> + u8 x_div; >> + u8 color_swap; >> + u8 hw_format; >> +}; [...] >> >> -struct rga_fmt { >> - u32 fourcc; >> - int depth; >> - u8 uv_factor; >> - u8 y_div; >> - u8 x_div; >> - u8 color_swap; >> - u8 hw_format; >> -}; > Ah! here's the removal of the unused variable. Not review friendly, but at last > removed. I've just moved it, so your review comments are still right. x_div/y_div is still used at one place in rga_hw.c, but I'll remove it too in my v3 (and have these removals in the other commits to keep this reviewed-by). Sincerely     Sven > > Reviewed-by: Nicolas Dufresne > >> - >>  struct rga_frame { >>   /* Crop */ >>   struct v4l2_rect crop; >> >>   /* Image format */ >> - struct rga_fmt *fmt; >> + void *fmt; >>   struct v4l2_pix_format_mplane pix; >>  }; >> >> @@ -145,8 +135,6 @@ static inline void rga_mod(struct rockchip_rga *rga, u32 reg, u32 val, u32 mask) >>  struct rga_hw { >>   const char *card_type; >>   bool has_internal_iommu; >> - struct rga_fmt *formats; >> - u32 num_formats; >>   size_t cmdbuf_size; >>   u32 min_width, min_height; >>   u32 max_width, max_height; >> @@ -158,6 +146,9 @@ struct rga_hw { >>         struct rga_vb_buffer *src, struct rga_vb_buffer *dst); >>   bool (*handle_irq)(struct rockchip_rga *rga); >>   void (*get_version)(struct rockchip_rga *rga); >> + void *(*adjust_and_map_format)(struct v4l2_pix_format_mplane *format, >> +        bool is_output); >> + int (*enum_format)(struct v4l2_fmtdesc *f); >>  }; >> >>  static inline bool rga_has_internal_iommu(const struct rockchip_rga *rga)