OMAP: DSS2: Add Zorder Support on OMAP4
Subsystems (3)
cover OMAP: DSS2: Add Zorder Support on OMAP4
From: Sumit Semwal <[email protected]>
This patch series adds Zorder Support on OMAP4, this feature allows deciding the visibility order of the overlays based on the Zorder value given to a sysfs attribute of the overlay object.
Since this feature is not supported on OMAP3 and OMAP2, the sysfs attibutes always return Zorder as 0 and do not write to dispc registers for non OMAP4 architectures.
This patch series applies over the submitted series:
https://patchwork.kernel.org/patch/112648/
Sumit Semwal (3):
OMAP: DSS2: Zorder enum in display.h
OMAP: DSS2: Zorder functions for DISPC
OMAP: DSS2: Zorder sysfs attributes, out of bound checks and initialization
--- arch/arm/plat-omap/include/plat/display.h | 8 ++++ drivers/video/omap2/dss/dispc.c | 23 +++++++++++++ drivers/video/omap2/dss/dss.h | 3 ++ drivers/video/omap2/dss/manager.c | 4 ++ drivers/video/omap2/dss/overlay.c | 51 +++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 0 deletions(-)
PATCH 1/3 OMAP: DSS2: Zorder enum in display.h
From: Sumit Semwal <[email protected]>
Add Zorder enum in display.h
--- arch/arm/plat-omap/include/plat/display.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/plat-omap/include/plat/display.h +8 -0
@@ -206,6 +206,13 @@ enum omap_overlay_manager_caps { OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, }; +enum omap_overlay_zorder { +OMAP_DSS_OVL_ZORDER_0 =0x0 , +OMAP_DSS_OVL_ZORDER_1 =0x1 , +OMAP_DSS_OVL_ZORDER_2 =0x2 , +OMAP_DSS_OVL_ZORDER_3 =0x3 , +}; +/* RFBI */ struct rfbi_timings {
@@ -308,6 +315,7 @@ struct omap_overlay_info {u16 out_width;/* if 0, out_width == width */ u16 out_height;/* if 0, out_height == height */ u8 global_alpha; +enum omap_overlay_zorder zorder; };struct omap_overlay {
Signature · 1 line
1.6.3.3
PATCH 2/3 OMAP: DSS2: Zorder functions for DISPC
From: Sumit Semwal <[email protected]>
Adds OMAP4 Zorder support by introducing Zorder set and enable functions in dispc.
--- drivers/video/omap2/dss/dispc.c | 23 +++++++++++++++++++++++ drivers/video/omap2/dss/dss.h | 3 +++ drivers/video/omap2/dss/manager.c | 4 ++++ 3 files changed, 30 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/dispc.c +23 -0
@@ -1174,6 +1174,29 @@ void dispc_set_burst_size(enum omap_plane plane,enable_clocks (0 ); } +void dispc_set_zorder (enum omap_plane plane, +enum omap_overlay_zorder zorder) +{ +u32 val; + +if (!cpu_is_omap44xx ()) +return ; + val =dispc_read_reg (dispc_reg_att[plane]); + val =FLD_MOD (val, zorder,27 ,26 ); +dispc_write_reg (dispc_reg_att[plane], val); +} + +void dispc_enable_zorder (enum omap_plane plane,bool enable) +{ +u32 val; + +if (!cpu_is_omap44xx ()) +return ; + val =dispc_read_reg (dispc_reg_att[plane]); + val =FLD_MOD (val, enable,25 ,25 ); +dispc_write_reg (dispc_reg_att[plane], val); +} +static void _dispc_set_vid_color_conv (enum omap_plane plane,bool enable) {u32 val;
drivers/video/omap2/dss/dss.h +3 -0
@@ -343,6 +343,9 @@ void dispc_setup_plane_fifo(enum omap_plane plane, u32 low, u32 high);void dispc_enable_fifomerge (bool enable);void dispc_set_burst_size (enum omap_plane plane,enum omap_burst_size burst_size); +void dispc_set_zorder (enum omap_plane plane, +enum omap_overlay_zorder zorder); +void dispc_enable_zorder (enum omap_plane plane,bool enable);void dispc_set_plane_ba0 (enum omap_plane plane,u32 paddr);void dispc_set_plane_ba1 (enum omap_plane plane,u32 paddr);
drivers/video/omap2/dss/manager.c +4 -0
@@ -417,6 +417,7 @@ struct overlay_cache_data {u32 fifo_high;bool manual_update; +enum omap_overlay_zorder zorder; };struct manager_cache_data {
@@ -864,6 +865,8 @@ static int configure_overlay(enum omap_plane plane)dispc_enable_replication (plane, c->replication);dispc_set_burst_size (plane, c->burst_size); +dispc_set_zorder (plane, c->zorder); +dispc_enable_zorder (plane,1 );dispc_setup_plane_fifo (plane, c->fifo_low, c->fifo_high);dispc_enable_plane (plane,1 );
@@ -1276,6 +1279,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) oc->out_width = ovl->info.out_width; oc->out_height = ovl->info.out_height; oc->global_alpha = ovl->info.global_alpha; + oc->zorder = ovl->info.zorder; oc->replication =dss_use_replication (dssdev, ovl->info.color_mode);
Signature · 1 line
1.5.4.7
PATCH 3/3 OMAP: DSS2: Zorder sysfs attributes, out of bound checks and initialization
Add Zorder as a overlay sysfs attribute, check for out of bound entries and initialize Zorder values for overlay objects.
--- drivers/video/omap2/dss/overlay.c | 51 +++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/overlay.c +51 -0
@@ -257,6 +257,38 @@ static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,return size; } +static ssize_t overlay_zorder_show (struct omap_overlay *ovl,char *buf) +{ +return snprintf (buf,PAGE_SIZE ,"%d\n" , + ovl->info.zorder); +} + +static ssize_t overlay_zorder_store (struct omap_overlay *ovl, +const char *buf,size_t size) +{ +int r; +struct omap_overlay_info info; + +if (!cpu_is_omap44xx ()) +return size; + + ovl->get_overlay_info (ovl, &info); + + info.zorder =simple_strtoul (buf,NULL ,10 ); + + r = ovl->set_overlay_info (ovl, &info); +if (r) +return r; + +if (ovl->manager) { + r = ovl->manager->apply (ovl->manager); +if (r) +return r; + } + +return size; +} +struct overlay_attribute {struct attribute attr;ssize_t (*show)(struct omap_overlay *,char *);
@@ -280,6 +312,8 @@ static OVERLAY_ATTR(enabled, S_IRUGO|S_IWUSR, overlay_enabled_show, overlay_enabled_store); static OVERLAY_ATTR(global_alpha, S_IRUGO|S_IWUSR, overlay_global_alpha_show, overlay_global_alpha_store); +static OVERLAY_ATTR(zorder, S_IRUGO|S_IWUSR, + overlay_zorder_show, overlay_zorder_store);static struct attribute *overlay_sysfs_attrs[] = { &overlay_attr_name.attr,
@@ -290,6 +324,7 @@ static struct attribute *overlay_sysfs_attrs[] = { &overlay_attr_output_size.attr, &overlay_attr_enabled.attr, &overlay_attr_global_alpha.attr, + &overlay_attr_zorder.attr, NULL };
@@ -394,6 +429,12 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)return -EINVAL ; } +if ((info->zorder <OMAP_DSS_OVL_ZORDER_0 ) || + (info->zorder >OMAP_DSS_OVL_ZORDER_3 )) { +DSSERR ("overlay doesn't support zorder %d\n" , info->zorder); +return -EINVAL ; + } +return 0 ; }
@@ -552,6 +593,7 @@ void dss_init_overlays(struct platform_device *pdev)OMAP_DSS_COLOR_GFX_OMAP2 ; ovl->caps =OMAP_DSS_OVL_CAP_DISPC ; ovl->info.global_alpha =255 ; + ovl->info.zorder =OMAP_DSS_OVL_ZORDER_0 ;break ;case 1 : ovl->name ="vid1" ;
@@ -562,6 +604,9 @@ void dss_init_overlays(struct platform_device *pdev) ovl->caps =OMAP_DSS_OVL_CAP_SCALE |OMAP_DSS_OVL_CAP_DISPC ; ovl->info.global_alpha =255 ; + ovl->info.zorder =cpu_is_omap44xx () ? +OMAP_DSS_OVL_ZORDER_3 : +OMAP_DSS_OVL_ZORDER_0 ;break ;case 2 : ovl->name ="vid2" ;
@@ -572,6 +617,9 @@ void dss_init_overlays(struct platform_device *pdev) ovl->caps =OMAP_DSS_OVL_CAP_SCALE |OMAP_DSS_OVL_CAP_DISPC ; ovl->info.global_alpha =255 ; + ovl->info.zorder =cpu_is_omap44xx () ? +OMAP_DSS_OVL_ZORDER_2 : +OMAP_DSS_OVL_ZORDER_0 ;break ;case 3 : ovl->name ="vid3" ;
@@ -580,6 +628,9 @@ void dss_init_overlays(struct platform_device *pdev) ovl->caps =OMAP_DSS_OVL_CAP_SCALE |OMAP_DSS_OVL_CAP_DISPC ; ovl->info.global_alpha =255 ; + ovl->info.zorder =cpu_is_omap44xx () ? +OMAP_DSS_OVL_ZORDER_1 : +OMAP_DSS_OVL_ZORDER_0 ;break ; }
Signature · 1 line
1.5.4.7
RE: [PATCH 1/3] OMAP: DSS2: Zorder enum in display.h
In reply to Archit TanejaQuoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Archit Taneja
Sent: Monday, July 19, 2010 5:40 PM
To: [email protected]
Cc: [email protected]; Semwal, Sumit; Nilofer, Samreen; Taneja, Archit
Subject: [PATCH 1/3] OMAP: DSS2: Zorder enum indisplay.h
Quoted 4 lines
From: Sumit Semwal <[email protected]>
Add Zorder enum in
display.h
Patches 1 and 2 in the series can easily be conbined into one. Separating few line changes in header file from implementation across 2 patches isn't useful.
Quoted 13 lines
Signed-off-by Sumit Semwal <[email protected]>Signed-off-by Samreen <[email protected]>Signed-off-by Archit Taneja <[email protected]>--- arch/arm/plat-omap/include/plat/display.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)arch/arm/plat-omap/include/plat/display.h +0
-0
arch/arm/plat-omap/include/plat/display.h enum omap_overlay_manager_caps { · line 214
Quoted 9 lines
arch/arm/plat-omap/include/plat/display.h +6
-0@@ -206,6 +206,13 @@ enum omap_overlay_manager_caps { OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, }; +enum omap_overlay_zorder { +OMAP_DSS_OVL_ZORDER_0 =0x0 , +OMAP_DSS_OVL_ZORDER_1 =0x1 , +OMAP_DSS_OVL_ZORDER_2 =0x2 , +OMAP_DSS_OVL_ZORDER_3 =0x3 , +};
Is "_DSS_" really needed in these emums? considering that enum itself doesn't contain "_dss_" in its name.
~sanjeev
Quoted 21 lines
arch/arm/plat-omap/include/plat/display.h +2
-0+/* RFBI */ struct rfbi_timings {@@ -308,6 +315,7 @@ struct omap_overlay_info {u16 out_width;/* if 0, out_width == width */ u16 out_height;/* if 0, out_height == height */ u8 global_alpha; +enum omap_overlay_zorder zorder; };struct omap_overlay {Signature · 7 lines
1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 1/3] OMAP: DSS2: Zorder enum in display.h
Quoted 19 lines
-----Original Message-----
From: Premi, Sanjeev
Sent: Wednesday, July 21, 2010 7:47 PM
To: Taneja, Archit; [email protected]
Cc: [email protected]; Semwal, Sumit; Nilofer, Samreen; Taneja, Archit
Subject: RE: [PATCH 1/3] OMAP: DSS2: Zorder enum indisplay.hQuoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Archit Taneja
Sent: Monday, July 19, 2010 5:40 PM
To: [email protected]
Cc: [email protected]; Semwal, Sumit; Nilofer, Samreen; Taneja, Archit
Subject: [PATCH 1/3] OMAP: DSS2: Zorder enum indisplay.h
Quoted 8 lines
Quoted 4 lines
From: Sumit Semwal <[email protected]>
Add Zorder enum in
display.hPatches 1 and 2 in the series can easily be conbined into one. Separating few line changes in header file from implementation across 2 patches isn't useful.
[archit] We are introducing a new DSS feature for OMAP4 in every patch series. In order to clearly explain the feature introduced, the first patch of every series makes changes on in the display.h header which is central to the DSS2 code.
If this is not a accepted norm or a strong enough reason to have a separate small patch, I can rework these series, I would need more comments from others though.
<snap>
Quoted 10 lines
arch/arm/plat-omap/include/plat/display.h enum omap_overlay_manager_caps { · line 214
Quoted 6 lines
arch/arm/plat-omap/include/plat/display.h +6
-0+enum omap_overlay_zorder { +OMAP_DSS_OVL_ZORDER_0 =0x0 , +OMAP_DSS_OVL_ZORDER_1 =0x1 , +OMAP_DSS_OVL_ZORDER_2 =0x2 , +OMAP_DSS_OVL_ZORDER_3 =0x3 , +};Is "_DSS_" really needed in these emums? considering that enum itself doesn't contain "_dss_" in its name.
[archit] I agree with this, but the present header is inconsistent with the point you have made, there are other enums which don't have "_dss_" but have "_DSS_" in its enum members. We should try to make this uniform (unless there is a motive behind it).
Quoted 2 lines
~sanjeev
Regards,
Archit
RE: [PATCH 1/3] OMAP: DSS2: Zorder enum in display.h
Quoted 36 lines
-----Original Message-----
From: Taneja, Archit
Sent: Thursday, July 22, 2010 9:42 AM
To: Premi, Sanjeev; [email protected]
Cc: [email protected]; Semwal, Sumit; Nilofer, Samreen
Subject: RE: [PATCH 1/3] OMAP: DSS2: Zorder enum indisplay.hQuoted 11 lines
-----Original Message-----
From: Premi, Sanjeev
Sent: Wednesday, July 21, 2010 7:47 PM
To: Taneja, Archit; [email protected]
Cc: [email protected]; Semwal, Sumit; Nilofer, Samreen; Taneja, Archit
Subject: RE: [PATCH 1/3] OMAP: DSS2: Zorder enum indisplay.hQuoted 3 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfArchit Taneja
Quoted 6 lines
Quoted 6 lines
Sent: Monday, July 19, 2010 5:40 PM
To: [email protected]
Cc: [email protected]; Semwal, Sumit; Nilofer, Samreen; Taneja, Archit
Subject: [PATCH 1/3] OMAP: DSS2: Zorder enum indisplay.hQuoted 8 lines
Quoted 4 lines
From: Sumit Semwal <[email protected]>
Add Zorder enum in
display.hPatches 1 and 2 in the series can easily be conbined into one. Separating few line changes in header file from implementation across 2 patches isn't useful.
Quoted 8 lines
[archit] We are introducing a new DSS feature for OMAP4 in every patch series. In order to clearly explain the feature introduced, the first patch of every series makes changes on in the
display.hheader which is central to the DSS2 code.If this is not a accepted norm or a strong enough reason to have a separate small patch, I can rework these series, I would need more comments from others though.
[sp] I understand the festure intoduction, but spliting patches across
headers and implementation doesn't seem to be logical.
~sanjeev
Quoted 26 lines
<snap>
Quoted 10 lines
arch/arm/plat-omap/include/plat/display.h enum omap_overlay_manager_caps { · line 214
Quoted 6 lines
arch/arm/plat-omap/include/plat/display.h +6
-0+enum omap_overlay_zorder { +OMAP_DSS_OVL_ZORDER_0 =0x0 , +OMAP_DSS_OVL_ZORDER_1 =0x1 , +OMAP_DSS_OVL_ZORDER_2 =0x2 , +OMAP_DSS_OVL_ZORDER_3 =0x3 , +};Is "_DSS_" really needed in these emums? considering that enum itself doesn't contain "_dss_" in its name.
[archit] I agree with this, but the present header is inconsistent with the point you have made, there are other enums which don't have "_dss_" but have "_DSS_" in its enum members. We should try to make this uniform (unless there is a motive behind it).
Quoted 2 lines
~sanjeev
Regards,
Archit
Quoted 21 lines
-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Archit Taneja
Sent: Monday, July 19, 2010 5:40 PM
To: [email protected]
Cc: [email protected]; Semwal, Sumit
Subject: [PATCH 0/3] OMAP: DSS2: Add Zorder Support on OMAP4From: Sumit Semwal <[email protected]>
This patch series adds Zorder Support on OMAP4, this feature allows deciding the visibility order of the overlays based on the Zorder value given to a sysfs attribute of the overlay object.
Since this feature is not supported on OMAP3 and OMAP2, the sysfs attibutes always return Zorder as 0 and do not write to dispc registers for non OMAP4 architectures.
This patch series applies over the submitted series:
Quoted 7 lines
https://patchwork.kernel.org/patch/112648/
Sumit Semwal (3):
OMAP: DSS2: Zorder enum indisplay.h
OMAP: DSS2: Zorder functions for DISPC
OMAP: DSS2: Zorder sysfs attributes, out of bound checks and
initialization
[Hiremath, Vaibhav] Archit,
Here also I think we can merge all of these patches into single patch, something like,
OMAP: DSS2: Add support for Zorder feature (applicable for OMAP4 & more)
OR, worst case you can split it into 2 patches, something like,
OMAP: DSS2: Add support for Zorder feature (applicable for OMAP4 & more)
OMAP: DSS2: Add set/enable SYFS interface for Zorder feature
Thanks,
Vaibhav
Quoted 12 lines
--- arch/arm/plat-omap/include/plat/display.h | 8 ++++ drivers/video/omap2/dss/dispc.c | 23 +++++++++++++ drivers/video/omap2/dss/dss.h | 3 ++ drivers/video/omap2/dss/manager.c | 4 ++ drivers/video/omap2/dss/overlay.c | 51 +++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 0 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · ext Archit Taneja
From: Sumit Semwal <[email protected]>
This patch series adds Zorder Support on OMAP4, this feature allows deciding the visibility order of the overlays based on the Zorder value given to a sysfs attribute of the overlay object.
Since this feature is not supported on OMAP3 and OMAP2, the sysfs attibutes always return Zorder as 0 and do not write to dispc registers for non OMAP4 architectures.
It would be better if the sysfs file only appears on OMAP4. I know that method is not currently used for any other DSS sysfs files, but it's long been in the todo list...
Tomi