linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/msm/mdp5: Add pingpong entry to mdp5 config table
@ 2015-03-05 20:20 Hai Li
  2015-03-05 20:20 ` [PATCH 2/4] drm/msm/mdp5: Update generated mdp5 header file with DSI support Hai Li
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hai Li @ 2015-03-05 20:20 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-arm-msm, linux-kernel, robdclark, Hai Li

Pingpong register base addresses are different across platforms.
This change adds this information to config table and initialize
the values for 8x74 and 8084.

Signed-off-by: Hai Li <hali@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c | 8 ++++++++
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
index 8bee023..6c467fb 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
@@ -58,6 +58,10 @@ const struct mdp5_cfg_hw msm8x74_config = {
 		.count = 2,
 		.base = { 0x13100, 0x13300 }, /* NOTE: no ad in v1.0 */
 	},
+	.pp = {
+		.count = 3,
+		.base = { 0x12d00, 0x12e00, 0x12f00 },
+	},
 	.intf = {
 		.count = 4,
 		.base = { 0x12500, 0x12700, 0x12900, 0x12b00 },
@@ -111,6 +115,10 @@ const struct mdp5_cfg_hw apq8084_config = {
 		.count = 3,
 		.base = { 0x13500, 0x13700, 0x13900 },
 	},
+	.pp = {
+		.count = 4,
+		.base = { 0x12f00, 0x13000, 0x13100, 0x13200 },
+	},
 	.intf = {
 		.count = 5,
 		.base = { 0x12500, 0x12700, 0x12900, 0x12b00, 0x12d00 },
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.h b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.h
index 4e91f14..c2d4498 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.h
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.h
@@ -71,6 +71,7 @@ struct mdp5_cfg_hw {
 	struct mdp5_lm_block  lm;
 	struct mdp5_sub_block dspp;
 	struct mdp5_sub_block ad;
+	struct mdp5_sub_block pp;
 	struct mdp5_sub_block intf;
 
 	u32 intfs[MDP5_INTF_NUM_MAX]; /* array of enum mdp5_intf_type */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] drm/msm/mdp5: Update generated mdp5 header file with DSI support
  2015-03-05 20:20 [PATCH 1/4] drm/msm/mdp5: Add pingpong entry to mdp5 config table Hai Li
@ 2015-03-05 20:20 ` Hai Li
  2015-03-05 20:20 ` [PATCH 3/4] drm/msm/mdp5: Fix PIPE source image size settings Hai Li
  2015-03-05 20:20 ` [PATCH 4/4] drm/msm: Fix default fb var width and height Hai Li
  2 siblings, 0 replies; 7+ messages in thread
From: Hai Li @ 2015-03-05 20:20 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-arm-msm, linux-kernel, robdclark, Hai Li

This change adds the registers in mdp5 ping pong blocks
and split display control registers.

Signed-off-by: Hai Li <hali@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h | 105 ++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h b/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h
index d8360a5..e86bcf0 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5.xml.h
@@ -235,6 +235,9 @@ static inline uint32_t MDP5_DISP_INTF_SEL_INTF3(enum mdp5_intf_type val)
 
 #define REG_MDP5_HIST_INTR_CLEAR				0x00000124
 
+#define REG_MDP5_SPARE_0					0x00000128
+#define MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN			0x00000001
+
 static inline uint32_t REG_MDP5_SMP_ALLOC_W(uint32_t i0) { return 0x00000180 + 0x4*i0; }
 
 static inline uint32_t REG_MDP5_SMP_ALLOC_W_REG(uint32_t i0) { return 0x00000180 + 0x4*i0; }
@@ -305,6 +308,20 @@ static inline uint32_t MDP5_IGC_LUT_REG_VAL(uint32_t val)
 #define MDP5_IGC_LUT_REG_DISABLE_PIPE_1				0x20000000
 #define MDP5_IGC_LUT_REG_DISABLE_PIPE_2				0x40000000
 
+#define REG_MDP5_SPLIT_DPL_EN					0x000003f4
+
+#define REG_MDP5_SPLIT_DPL_UPPER				0x000003f8
+#define MDP5_SPLIT_DPL_UPPER_SMART_PANEL			0x00000002
+#define MDP5_SPLIT_DPL_UPPER_SMART_PANEL_FREE_RUN		0x00000004
+#define MDP5_SPLIT_DPL_UPPER_INTF1_SW_TRG_MUX			0x00000010
+#define MDP5_SPLIT_DPL_UPPER_INTF2_SW_TRG_MUX			0x00000100
+
+#define REG_MDP5_SPLIT_DPL_LOWER				0x000004f0
+#define MDP5_SPLIT_DPL_LOWER_SMART_PANEL			0x00000002
+#define MDP5_SPLIT_DPL_LOWER_SMART_PANEL_FREE_RUN		0x00000004
+#define MDP5_SPLIT_DPL_LOWER_INTF1_TG_SYNC			0x00000010
+#define MDP5_SPLIT_DPL_LOWER_INTF2_TG_SYNC			0x00000100
+
 static inline uint32_t __offset_CTL(uint32_t idx)
 {
 	switch (idx) {
@@ -1114,6 +1131,94 @@ static inline uint32_t REG_MDP5_DSPP_GAMUT_BASE(uint32_t i0) { return 0x000002dc
 
 static inline uint32_t REG_MDP5_DSPP_GC_BASE(uint32_t i0) { return 0x000002b0 + __offset_DSPP(i0); }
 
+static inline uint32_t __offset_PP(uint32_t idx)
+{
+	switch (idx) {
+		case 0: return (mdp5_cfg->pp.base[0]);
+		case 1: return (mdp5_cfg->pp.base[1]);
+		case 2: return (mdp5_cfg->pp.base[2]);
+		case 3: return (mdp5_cfg->pp.base[3]);
+		default: return INVALID_IDX(idx);
+	}
+}
+static inline uint32_t REG_MDP5_PP(uint32_t i0) { return 0x00000000 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_TEAR_CHECK_EN(uint32_t i0) { return 0x00000000 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_SYNC_CONFIG_VSYNC(uint32_t i0) { return 0x00000004 + __offset_PP(i0); }
+#define MDP5_PP_SYNC_CONFIG_VSYNC_COUNT__MASK			0x0007ffff
+#define MDP5_PP_SYNC_CONFIG_VSYNC_COUNT__SHIFT			0
+static inline uint32_t MDP5_PP_SYNC_CONFIG_VSYNC_COUNT(uint32_t val)
+{
+	return ((val) << MDP5_PP_SYNC_CONFIG_VSYNC_COUNT__SHIFT) & MDP5_PP_SYNC_CONFIG_VSYNC_COUNT__MASK;
+}
+#define MDP5_PP_SYNC_CONFIG_VSYNC_COUNTER_EN			0x00080000
+#define MDP5_PP_SYNC_CONFIG_VSYNC_IN_EN				0x00100000
+
+static inline uint32_t REG_MDP5_PP_SYNC_CONFIG_HEIGHT(uint32_t i0) { return 0x00000008 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_SYNC_WRCOUNT(uint32_t i0) { return 0x0000000c + __offset_PP(i0); }
+#define MDP5_PP_SYNC_WRCOUNT_LINE_COUNT__MASK			0x0000ffff
+#define MDP5_PP_SYNC_WRCOUNT_LINE_COUNT__SHIFT			0
+static inline uint32_t MDP5_PP_SYNC_WRCOUNT_LINE_COUNT(uint32_t val)
+{
+	return ((val) << MDP5_PP_SYNC_WRCOUNT_LINE_COUNT__SHIFT) & MDP5_PP_SYNC_WRCOUNT_LINE_COUNT__MASK;
+}
+#define MDP5_PP_SYNC_WRCOUNT_FRAME_COUNT__MASK			0xffff0000
+#define MDP5_PP_SYNC_WRCOUNT_FRAME_COUNT__SHIFT			16
+static inline uint32_t MDP5_PP_SYNC_WRCOUNT_FRAME_COUNT(uint32_t val)
+{
+	return ((val) << MDP5_PP_SYNC_WRCOUNT_FRAME_COUNT__SHIFT) & MDP5_PP_SYNC_WRCOUNT_FRAME_COUNT__MASK;
+}
+
+static inline uint32_t REG_MDP5_PP_VSYNC_INIT_VAL(uint32_t i0) { return 0x00000010 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_INT_COUNT_VAL(uint32_t i0) { return 0x00000014 + __offset_PP(i0); }
+#define MDP5_PP_INT_COUNT_VAL_LINE_COUNT__MASK			0x0000ffff
+#define MDP5_PP_INT_COUNT_VAL_LINE_COUNT__SHIFT			0
+static inline uint32_t MDP5_PP_INT_COUNT_VAL_LINE_COUNT(uint32_t val)
+{
+	return ((val) << MDP5_PP_INT_COUNT_VAL_LINE_COUNT__SHIFT) & MDP5_PP_INT_COUNT_VAL_LINE_COUNT__MASK;
+}
+#define MDP5_PP_INT_COUNT_VAL_FRAME_COUNT__MASK			0xffff0000
+#define MDP5_PP_INT_COUNT_VAL_FRAME_COUNT__SHIFT		16
+static inline uint32_t MDP5_PP_INT_COUNT_VAL_FRAME_COUNT(uint32_t val)
+{
+	return ((val) << MDP5_PP_INT_COUNT_VAL_FRAME_COUNT__SHIFT) & MDP5_PP_INT_COUNT_VAL_FRAME_COUNT__MASK;
+}
+
+static inline uint32_t REG_MDP5_PP_SYNC_THRESH(uint32_t i0) { return 0x00000018 + __offset_PP(i0); }
+#define MDP5_PP_SYNC_THRESH_START__MASK				0x0000ffff
+#define MDP5_PP_SYNC_THRESH_START__SHIFT			0
+static inline uint32_t MDP5_PP_SYNC_THRESH_START(uint32_t val)
+{
+	return ((val) << MDP5_PP_SYNC_THRESH_START__SHIFT) & MDP5_PP_SYNC_THRESH_START__MASK;
+}
+#define MDP5_PP_SYNC_THRESH_CONTINUE__MASK			0xffff0000
+#define MDP5_PP_SYNC_THRESH_CONTINUE__SHIFT			16
+static inline uint32_t MDP5_PP_SYNC_THRESH_CONTINUE(uint32_t val)
+{
+	return ((val) << MDP5_PP_SYNC_THRESH_CONTINUE__SHIFT) & MDP5_PP_SYNC_THRESH_CONTINUE__MASK;
+}
+
+static inline uint32_t REG_MDP5_PP_START_POS(uint32_t i0) { return 0x0000001c + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_RD_PTR_IRQ(uint32_t i0) { return 0x00000020 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_WR_PTR_IRQ(uint32_t i0) { return 0x00000024 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_OUT_LINE_COUNT(uint32_t i0) { return 0x00000028 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_PP_LINE_COUNT(uint32_t i0) { return 0x0000002c + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_AUTOREFRESH_CONFIG(uint32_t i0) { return 0x00000030 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_FBC_MODE(uint32_t i0) { return 0x00000034 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_FBC_BUDGET_CTL(uint32_t i0) { return 0x00000038 + __offset_PP(i0); }
+
+static inline uint32_t REG_MDP5_PP_FBC_LOSSY_MODE(uint32_t i0) { return 0x0000003c + __offset_PP(i0); }
+
 static inline uint32_t __offset_INTF(uint32_t idx)
 {
 	switch (idx) {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] drm/msm/mdp5: Fix PIPE source image size settings
  2015-03-05 20:20 [PATCH 1/4] drm/msm/mdp5: Add pingpong entry to mdp5 config table Hai Li
  2015-03-05 20:20 ` [PATCH 2/4] drm/msm/mdp5: Update generated mdp5 header file with DSI support Hai Li
@ 2015-03-05 20:20 ` Hai Li
  2015-03-05 20:20 ` [PATCH 4/4] drm/msm: Fix default fb var width and height Hai Li
  2 siblings, 0 replies; 7+ messages in thread
From: Hai Li @ 2015-03-05 20:20 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-arm-msm, linux-kernel, robdclark, Hai Li

The width and height in SSPP_SRC_IMG_SIZE register should be the
size of the entire source framebuffer, not the fetch size.

Signed-off-by: Hai Li <hali@codeaurora.org>
---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index 05cf9ab..37fef77 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -505,8 +505,8 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
 	spin_lock_irqsave(&mdp5_plane->pipe_lock, flags);
 
 	mdp5_write(mdp5_kms, REG_MDP5_PIPE_SRC_IMG_SIZE(pipe),
-			MDP5_PIPE_SRC_IMG_SIZE_WIDTH(src_w) |
-			MDP5_PIPE_SRC_IMG_SIZE_HEIGHT(src_h));
+			MDP5_PIPE_SRC_IMG_SIZE_WIDTH(fb->width) |
+			MDP5_PIPE_SRC_IMG_SIZE_HEIGHT(fb->height));
 
 	mdp5_write(mdp5_kms, REG_MDP5_PIPE_SRC_SIZE(pipe),
 			MDP5_PIPE_SRC_SIZE_WIDTH(src_w) |
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] drm/msm: Fix default fb var width and height
  2015-03-05 20:20 [PATCH 1/4] drm/msm/mdp5: Add pingpong entry to mdp5 config table Hai Li
  2015-03-05 20:20 ` [PATCH 2/4] drm/msm/mdp5: Update generated mdp5 header file with DSI support Hai Li
  2015-03-05 20:20 ` [PATCH 3/4] drm/msm/mdp5: Fix PIPE source image size settings Hai Li
@ 2015-03-05 20:20 ` Hai Li
  2015-03-06 18:12   ` Rob Clark
  2 siblings, 1 reply; 7+ messages in thread
From: Hai Li @ 2015-03-05 20:20 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-arm-msm, linux-kernel, robdclark, Hai Li

The framebuffer var width and height should reflect the size of
framebuffer memory allocated, which is the entire surface size.

In case of dual DSI connectors with TILE properties, this change
makes the whole image show on the dual DSI panel, instead of
duplicated images on both sides.

Signed-off-by: Hai Li <hali@codeaurora.org>
---
 drivers/gpu/drm/msm/msm_fbdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index df60f65..d3e8b14 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -169,7 +169,8 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
 	}
 
 	drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
-	drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
+	drm_fb_helper_fill_var(fbi, helper,
+			sizes->surface_width, sizes->surface_height);
 
 	dev->mode_config.fb_base = paddr;
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] drm/msm: Fix default fb var width and height
  2015-03-05 20:20 ` [PATCH 4/4] drm/msm: Fix default fb var width and height Hai Li
@ 2015-03-06 18:12   ` Rob Clark
  2015-03-06 18:21     ` Rob Clark
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Clark @ 2015-03-06 18:12 UTC (permalink / raw)
  To: Hai Li
  Cc: dri-devel, linux-arm-msm, Linux Kernel Mailing List,
	Daniel Vetter, Dave Airlie

On Thu, Mar 5, 2015 at 3:20 PM, Hai Li <hali@codeaurora.org> wrote:
> The framebuffer var width and height should reflect the size of
> framebuffer memory allocated, which is the entire surface size.
>
> In case of dual DSI connectors with TILE properties, this change
> makes the whole image show on the dual DSI panel, instead of
> duplicated images on both sides.
>
> Signed-off-by: Hai Li <hali@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/msm_fbdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
> index df60f65..d3e8b14 100644
> --- a/drivers/gpu/drm/msm/msm_fbdev.c
> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
> @@ -169,7 +169,8 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>         }
>
>         drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
> -       drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
> +       drm_fb_helper_fill_var(fbi, helper,
> +                       sizes->surface_width, sizes->surface_height);
>

so, I believe the intention for separation if surface_width/height and
fb_width/height, it to allocate a buffer that is big enough (width and
height) for all connected displays (so as to not leave some display
scanning out too small of a buffer), but size the fbdev buffer small
enough that text would be visible on all screens.  Using
surface_width/height here instead of fb_width/height would break that.

But I think I have a different idea.. we could implement fb helper
func initial_config() to just call drm_pick_crtcs() (which we'd have
to export), and then for each of the crtcs[n] connected to a connector
with TILE property, populate the offsets[n].x/y.  Or possibly we
should just make drm_setup_crtcs() clever enough to do that
automatically.. that would result in larger fb_size and the two crtc's
scanning out their own parts of the buffer.

BR,
-R

>         dev->mode_config.fb_base = paddr;
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] drm/msm: Fix default fb var width and height
  2015-03-06 18:12   ` Rob Clark
@ 2015-03-06 18:21     ` Rob Clark
  2015-03-06 19:35       ` hali
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Clark @ 2015-03-06 18:21 UTC (permalink / raw)
  To: Hai Li
  Cc: dri-devel, linux-arm-msm, Linux Kernel Mailing List,
	Daniel Vetter, Dave Airlie

On Fri, Mar 6, 2015 at 1:12 PM, Rob Clark <robdclark@gmail.com> wrote:
> On Thu, Mar 5, 2015 at 3:20 PM, Hai Li <hali@codeaurora.org> wrote:
>> The framebuffer var width and height should reflect the size of
>> framebuffer memory allocated, which is the entire surface size.
>>
>> In case of dual DSI connectors with TILE properties, this change
>> makes the whole image show on the dual DSI panel, instead of
>> duplicated images on both sides.
>>
>> Signed-off-by: Hai Li <hali@codeaurora.org>
>> ---
>>  drivers/gpu/drm/msm/msm_fbdev.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
>> index df60f65..d3e8b14 100644
>> --- a/drivers/gpu/drm/msm/msm_fbdev.c
>> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
>> @@ -169,7 +169,8 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>>         }
>>
>>         drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
>> -       drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
>> +       drm_fb_helper_fill_var(fbi, helper,
>> +                       sizes->surface_width, sizes->surface_height);
>>
>
> so, I believe the intention for separation if surface_width/height and
> fb_width/height, it to allocate a buffer that is big enough (width and
> height) for all connected displays (so as to not leave some display
> scanning out too small of a buffer), but size the fbdev buffer small
> enough that text would be visible on all screens.  Using
> surface_width/height here instead of fb_width/height would break that.
>
> But I think I have a different idea.. we could implement fb helper
> func initial_config() to just call drm_pick_crtcs() (which we'd have
> to export), and then for each of the crtcs[n] connected to a connector
> with TILE property, populate the offsets[n].x/y.  Or possibly we
> should just make drm_setup_crtcs() clever enough to do that
> automatically.. that would result in larger fb_size and the two crtc's
> scanning out their own parts of the buffer.

Oh, I spoke too soon.. looks like Dave already added it in
drm_get_tile_offsets()..

BR,
-R

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] drm/msm: Fix default fb var width and height
  2015-03-06 18:21     ` Rob Clark
@ 2015-03-06 19:35       ` hali
  0 siblings, 0 replies; 7+ messages in thread
From: hali @ 2015-03-06 19:35 UTC (permalink / raw)
  To: Rob Clark
  Cc: Hai Li, dri-devel, linux-arm-msm, Linux Kernel Mailing List,
	Daniel Vetter, Dave Airlie

Hi Rob,

> On Fri, Mar 6, 2015 at 1:12 PM, Rob Clark <robdclark@gmail.com> wrote:
>> On Thu, Mar 5, 2015 at 3:20 PM, Hai Li <hali@codeaurora.org> wrote:
>>> The framebuffer var width and height should reflect the size of
>>> framebuffer memory allocated, which is the entire surface size.
>>>
>>> In case of dual DSI connectors with TILE properties, this change
>>> makes the whole image show on the dual DSI panel, instead of
>>> duplicated images on both sides.
>>>
>>> Signed-off-by: Hai Li <hali@codeaurora.org>
>>> ---
>>>  drivers/gpu/drm/msm/msm_fbdev.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c
>>> b/drivers/gpu/drm/msm/msm_fbdev.c
>>> index df60f65..d3e8b14 100644
>>> --- a/drivers/gpu/drm/msm/msm_fbdev.c
>>> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
>>> @@ -169,7 +169,8 @@ static int msm_fbdev_create(struct drm_fb_helper
>>> *helper,
>>>         }
>>>
>>>         drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
>>> -       drm_fb_helper_fill_var(fbi, helper, sizes->fb_width,
>>> sizes->fb_height);
>>> +       drm_fb_helper_fill_var(fbi, helper,
>>> +                       sizes->surface_width, sizes->surface_height);
>>>
>>
>> so, I believe the intention for separation if surface_width/height and
>> fb_width/height, it to allocate a buffer that is big enough (width and
>> height) for all connected displays (so as to not leave some display
>> scanning out too small of a buffer), but size the fbdev buffer small
>> enough that text would be visible on all screens.  Using
>> surface_width/height here instead of fb_width/height would break that.
>>
>> But I think I have a different idea.. we could implement fb helper
>> func initial_config() to just call drm_pick_crtcs() (which we'd have
>> to export), and then for each of the crtcs[n] connected to a connector
>> with TILE property, populate the offsets[n].x/y.  Or possibly we
>> should just make drm_setup_crtcs() clever enough to do that
>> automatically.. that would result in larger fb_size and the two crtc's
>> scanning out their own parts of the buffer.
>
> Oh, I spoke too soon.. looks like Dave already added it in
> drm_get_tile_offsets()..
>

As discussed in IRC, the TILE information has been set and the framebuffer
is allocated with the full size, not the half.

The problem is, we create the full size framebuffer but only tell the user
(fbcon here, but may be real user space application who will use the
default framebuffer.) the half resolution. I think this mismatch will
cause trouble not only in the case of TILE connectors.

For our specific case of TILE connectors, since the right crtc offset.x
has been set to the half width, while the framebuffer width set to plane
is 0~half_width-1 (got from fb var info), the PIPE takes it wrong settings
and will not fetch the image data from framebuffer.
> BR,
> -R
>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-06 19:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 20:20 [PATCH 1/4] drm/msm/mdp5: Add pingpong entry to mdp5 config table Hai Li
2015-03-05 20:20 ` [PATCH 2/4] drm/msm/mdp5: Update generated mdp5 header file with DSI support Hai Li
2015-03-05 20:20 ` [PATCH 3/4] drm/msm/mdp5: Fix PIPE source image size settings Hai Li
2015-03-05 20:20 ` [PATCH 4/4] drm/msm: Fix default fb var width and height Hai Li
2015-03-06 18:12   ` Rob Clark
2015-03-06 18:21     ` Rob Clark
2015-03-06 19:35       ` hali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).