Skip to content
  1. Oct 04, 2023
    • Tomi Valkeinen's avatar
      media: rp1: fe: Use ~0, not -1, when working with unsigned values · 455c4ae2
      Tomi Valkeinen authored
      
      
      Use ~0, not -1, when working with unsigned values (-1 is not unsigned).
      
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      455c4ae2
    • Tomi Valkeinen's avatar
      media: rp1: csi2: Fix missing reg writes · 62e8ab88
      Tomi Valkeinen authored
      
      
      The driver has two places where it writes a register based on a
      condition, and when that condition is false, the driver presumes that
      the register has the reset value. This is not a good idea, so fix those
      places to always write the register.
      
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      62e8ab88
    • Tomi Valkeinen's avatar
      media: rp1: cfe: Fix width & height in cfe_start_channel() · 84c9958d
      Tomi Valkeinen authored
      
      
      The logic for handling width & height in cfe_start_channel() is somewhat
      odd and, afaics, broken. The code reads:
      
      bool start_fe = is_fe_enabled(cfe) &&
                      test_all_nodes(cfe, NODE_ENABLED, NODE_STREAMING);
      
      if (start_fe || is_image_output_node(node)) {
              width = node->fmt.fmt.pix.width;
              height = node->fmt.fmt.pix.height;
      }
      
      cfe_start_channel() is called for all video nodes that will be used. So
      this means that if, say, fe_stats is enabled as the last node, start_fe
      will be true, and width and height will be taken from fe_stats' node.
      The width and height will thus contain garbage, which then gets
      programmed to the csi2 registers.
      
      It seems that this often still works fine, though, probably if the width
      & height are large enough.
      
      Drop the above code, and instead get the width & height from the csi2
      subdev's sink pad for the csi2 channel that is used. For metadata the
      width & height will be 0 as before.
      
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      84c9958d
    • Tomi Valkeinen's avatar
      media: rp1: cfe: Fix use of freed memory on errors · 3922bebc
      Tomi Valkeinen authored
      
      
      cfe_probe_complete() calls cfe_put() on both success and fail code paths.
      This works for the success path, but causes the cfe_device struct to be
      freed, even if it will be used later in the teardown code.
      
      Fix this by making the ref handling a bit saner: Let the video nodes
      have the refs as they do now, but also keep a ref in the "main" driver,
      released only at cfe_remove() time. This way the driver does not depend
      on the video nodes keeping the refs.
      
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      3922bebc
  2. Oct 03, 2023
  3. Sep 30, 2023
  4. Sep 29, 2023