|
@@ -371,6 +371,7 @@ struct fimc_pix_limit {
|
|
|
* @pix_hoff: indicate whether horizontal offset is in pixels or in bytes
|
|
|
* @has_inp_rot: set if has input rotator
|
|
|
* @has_out_rot: set if has output rotator
|
|
|
+ * @has_cistatus2: 1 if CISTATUS2 register is present in this IP revision
|
|
|
* @pix_limit: pixel size constraints for the scaler
|
|
|
* @min_inp_pixsize: minimum input pixel size
|
|
|
* @min_out_pixsize: minimum output pixel size
|
|
@@ -381,6 +382,7 @@ struct samsung_fimc_variant {
|
|
|
unsigned int pix_hoff:1;
|
|
|
unsigned int has_inp_rot:1;
|
|
|
unsigned int has_out_rot:1;
|
|
|
+ unsigned int has_cistatus2:1;
|
|
|
struct fimc_pix_limit *pix_limit;
|
|
|
u16 min_inp_pixsize;
|
|
|
u16 min_out_pixsize;
|
|
@@ -556,11 +558,19 @@ static inline struct fimc_frame *ctx_get_frame(struct fimc_ctx *ctx,
|
|
|
return frame;
|
|
|
}
|
|
|
|
|
|
+/* Return an index to the buffer actually being written. */
|
|
|
static inline u32 fimc_hw_get_frame_index(struct fimc_dev *dev)
|
|
|
{
|
|
|
- u32 reg = readl(dev->regs + S5P_CISTATUS);
|
|
|
- return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>
|
|
|
- S5P_CISTATUS_FRAMECNT_SHIFT;
|
|
|
+ u32 reg;
|
|
|
+
|
|
|
+ if (dev->variant->has_cistatus2) {
|
|
|
+ reg = readl(dev->regs + S5P_CISTATUS2) & 0x3F;
|
|
|
+ return reg > 0 ? --reg : reg;
|
|
|
+ } else {
|
|
|
+ reg = readl(dev->regs + S5P_CISTATUS);
|
|
|
+ return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>
|
|
|
+ S5P_CISTATUS_FRAMECNT_SHIFT;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* -----------------------------------------------------*/
|