summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Lofthouse <a0741364@ti.com>2012-07-06 17:12:38 -0500
committerJason Simmons <jsimmons@google.com>2012-10-22 15:14:07 -0700
commit58aa32dc9d23875627e39f16831ffb471baf7890 (patch)
tree70ad804a451cfe74cf9f6c95adf86784da9c5085
parentf1eab7b129ea2cf4bbbbfbec717a07b4419313c6 (diff)
downloadomap4-aah-58aa32dc9d23875627e39f16831ffb471baf7890.tar.gz
hwc: fix max_hw_overlay calculation in mirroring mode
When the protected content is present, we need to have minimum two external overlays to achieve mirroring. Rebase from p-ics-mr1 76f23bf HWC: Fix for max_hw_overlay calcualtion during mirroring mode Change-Id: Ibf95232e5f5d3b11eb05b4b4506fceb118dbfdd9 Signed-off-by: Sunita Nadampalli <sunitan@ti.com> Signed-off-by: Tony Lofthouse <a0741364@ti.com> (cherry picked from commit cb9e6c8c4a37e5e1835cec8a10c774bbcc156637) Conflicts: hwc/hwc.c
-rw-r--r--hwc/hwc.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 419e3fd..03d73e2 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -136,6 +136,22 @@ struct omap4_hwc_module {
};
typedef struct omap4_hwc_module omap4_hwc_module_t;
+struct counts {
+ unsigned int possible_overlay_layers;
+ unsigned int composited_layers;
+ unsigned int scaled_layers;
+ unsigned int RGB;
+ unsigned int BGR;
+ unsigned int NV12;
+ unsigned int dockable;
+ unsigned int protected;
+
+ unsigned int max_hw_overlays;
+ unsigned int max_scaling_overlays;
+ unsigned int mem;
+ unsigned int s3d;
+};
+
struct omap4_hwc_device {
/* static data */
hwc_composer_device_1_t base;
@@ -184,6 +200,7 @@ struct omap4_hwc_device {
int blit_num;
struct omap_hwc_data comp_data; /* This is a kernel data structure */
struct rgz_blt_entry blit_ops[RGZ_MAX_BLITS];
+ struct counts stats;
/* fake vsync event state */
pthread_mutex_t vsync_lock;
@@ -1112,21 +1129,6 @@ static int omap4_hwc_set_best_hdmi_mode(omap4_hwc_device_t *hwc_dev, __u32 xres,
return 0;
}
-struct counts {
- unsigned int possible_overlay_layers;
- unsigned int composited_layers;
- unsigned int scaled_layers;
- unsigned int RGB;
- unsigned int BGR;
- unsigned int NV12;
- unsigned int dockable;
- unsigned int protected;
-
- unsigned int max_hw_overlays;
- unsigned int max_scaling_overlays;
- unsigned int mem;
-};
-
static void gather_layer_statistics(omap4_hwc_device_t *hwc_dev, struct counts *num, hwc_display_contents_1_t *list)
{
unsigned int i;
@@ -1161,6 +1163,7 @@ static void gather_layer_statistics(omap4_hwc_device_t *hwc_dev, struct counts *
num->mem += mem1d(handle);
}
}
+ hwc_dev->stats = *num;
}
static void decide_supported_cloning(omap4_hwc_device_t *hwc_dev, struct counts *num)
@@ -1214,7 +1217,7 @@ static void decide_supported_cloning(omap4_hwc_device_t *hwc_dev, struct counts
/* if mirroring, we are limited by both internal and external overlays. However,
ext_ovls is always <= MAX_HW_OVERLAYS / 2 <= max_hw_overlays */
- if (hwc_dev->ext_ovls && ext->current.enabled && !ext->current.docking)
+ if (!num->protected && hwc_dev->ext_ovls && ext->current.enabled && !ext->current.docking)
num->max_hw_overlays = hwc_dev->ext_ovls;
/* If FB is not same resolution as LCD don't use GFX pipe line*/
@@ -1848,7 +1851,8 @@ static int omap4_hwc_set(struct hwc_composer_device_1 *dev,
if (!hwc_dev->on_tv)
omap4_hwc_reset_screen(hwc_dev);
- invalidate = hwc_dev->ext_ovls_wanted && !hwc_dev->ext_ovls;
+ invalidate = hwc_dev->ext_ovls_wanted && (hwc_dev->ext_ovls < hwc_dev->ext_ovls_wanted) &&
+ (hwc_dev->stats.protected || !hwc_dev->ext_ovls);
if (debug)
dump_set_info(hwc_dev, list);