]> git.dujemihanovic.xyz Git - linux.git/commitdiff
media: atomisp: Fix streaming no longer working on BYT / ISP2400 devices
authorHans de Goede <hdegoede@redhat.com>
Sun, 21 Jul 2024 15:38:40 +0000 (17:38 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 14 Aug 2024 06:06:07 +0000 (08:06 +0200)
Commit a0821ca14bb8 ("media: atomisp: Remove test pattern generator (TPG)
support") broke BYT support because it removed a seemingly unused field
from struct sh_css_sp_config and a seemingly unused value from enum
ia_css_input_mode.

But these are part of the ABI between the kernel and firmware on ISP2400
and this part of the TPG support removal changes broke ISP2400 support.

ISP2401 support was not affected because on ISP2401 only a part of
struct sh_css_sp_config is used.

Restore the removed field and enum value to fix this.

Fixes: a0821ca14bb8 ("media: atomisp: Remove test pattern generator (TPG) support")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/staging/media/atomisp/pci/ia_css_stream_public.h
drivers/staging/media/atomisp/pci/sh_css_internal.h

index 961c612880833a807366bed58d35a68f5a871d2f..aad860e54d3a71b7b9a443c152ad4f02bdac949a 100644 (file)
 #include "ia_css_prbs.h"
 #include "ia_css_input_port.h"
 
-/* Input modes, these enumerate all supported input modes.
- *  Note that not all ISP modes support all input modes.
+/*
+ * Input modes, these enumerate all supported input modes.
+ * This enum is part of the atomisp firmware ABI and must
+ * NOT be changed!
+ * Note that not all ISP modes support all input modes.
  */
 enum ia_css_input_mode {
        IA_CSS_INPUT_MODE_SENSOR, /** data from sensor */
        IA_CSS_INPUT_MODE_FIFO,   /** data from input-fifo */
+       IA_CSS_INPUT_MODE_TPG,    /** data from test-pattern generator */
        IA_CSS_INPUT_MODE_PRBS,   /** data from pseudo-random bit stream */
        IA_CSS_INPUT_MODE_MEMORY, /** data from a frame in memory */
        IA_CSS_INPUT_MODE_BUFFERED_SENSOR /** data is sent through mipi buffer */
index a2d972ea3fa084dd2070666219c66aff6155bf36..959e7f549641c10f5243a734d69ea89b2a412c8d 100644 (file)
@@ -344,7 +344,14 @@ struct sh_css_sp_input_formatter_set {
 
 #define IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT (3)
 
-/* SP configuration information */
+/*
+ * SP configuration information
+ *
+ * This struct is part of the atomisp firmware ABI and is directly copied
+ * to ISP DRAM by sh_css_store_sp_group_to_ddr()
+ *
+ * Do NOT change this struct's layout or remove seemingly unused fields!
+ */
 struct sh_css_sp_config {
        u8                      no_isp_sync; /* Signal host immediately after start */
        u8                      enable_raw_pool_locking; /** Enable Raw Buffer Locking for HALv3 Support */
@@ -354,6 +361,10 @@ struct sh_css_sp_config {
             host (true) or when they are passed to the preview/video pipe
             (false). */
 
+        /*
+         * Note the fields below are only used on the ISP2400 not on the ISP2401,
+         * sh_css_store_sp_group_to_ddr() skip copying these when run on the ISP2401.
+         */
        struct {
                u8                                      a_changed;
                u8                                      b_changed;
@@ -363,11 +374,13 @@ struct sh_css_sp_config {
        } input_formatter;
 
        sync_generator_cfg_t    sync_gen;
+       tpg_cfg_t               tpg;
        prbs_cfg_t              prbs;
        input_system_cfg_t      input_circuit;
        u8                      input_circuit_cfg_changed;
-       u32             mipi_sizes_for_check[N_CSI_PORTS][IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT];
-       u8                 enable_isys_event_queue;
+       u32                     mipi_sizes_for_check[N_CSI_PORTS][IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT];
+       /* These last 2 fields are used on both the ISP2400 and the ISP2401 */
+       u8                      enable_isys_event_queue;
        u8                      disable_cont_vf;
 };