msm: sde: add format enumeration based on rotator version

Current pixel format enumeration reports pixel format supported
by driver, and may include formats not supported by underlying
hardware.  This patch reorganizes pixel format enumeration to
report hardware supported pixel formats based on hardware version
as well I/O port direction.

CRs-Fixed: 1054825
Change-Id: I1e42b11b43f69dba4a5ac68cfdfb8305136a307c
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_core.h b/drivers/media/platform/msm/sde/rotator/sde_rotator_core.h
index 2476309..3633114 100644
--- a/drivers/media/platform/msm/sde/rotator/sde_rotator_core.h
+++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_core.h
@@ -302,10 +302,32 @@
 			struct dentry *debugfs_root);
 	int (*ops_hw_validate_entry)(struct sde_rot_mgr *mgr,
 			struct sde_rot_entry *entry);
+	u32 (*ops_hw_get_pixfmt)(struct sde_rot_mgr *mgr, int index,
+			bool input);
+	int (*ops_hw_is_valid_pixfmt)(struct sde_rot_mgr *mgr, u32 pixfmt,
+			bool input);
 
 	void *hw_data;
 };
 
+static inline int sde_rotator_is_valid_pixfmt(struct sde_rot_mgr *mgr,
+		u32 pixfmt, bool input)
+{
+	if (mgr && mgr->ops_hw_is_valid_pixfmt)
+		return mgr->ops_hw_is_valid_pixfmt(mgr, pixfmt, input);
+
+	return false;
+}
+
+static inline u32 sde_rotator_get_pixfmt(struct sde_rot_mgr *mgr,
+		int index, bool input)
+{
+	if (mgr && mgr->ops_hw_get_pixfmt)
+		return mgr->ops_hw_get_pixfmt(mgr, index, input);
+
+	return 0;
+}
+
 static inline int __compare_session_item_rect(
 	struct sde_rotation_buf_info *s_rect,
 	struct sde_rect *i_rect, uint32_t i_fmt, bool src)