* [PATCH 0/2] Miscellaneous mode set and page flip fixes
@ 2012-05-31 16:26 Laurent Pinchart
2012-05-31 16:26 ` [PATCH 1/2] drm: Don't allow page flip to change pixel format Laurent Pinchart
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Laurent Pinchart @ 2012-05-31 16:26 UTC (permalink / raw)
To: dri-devel
Hi everybody,
Here are two small fixes that disallow format changes in page flip operations,
and perform a full mode set instead of a mode set base in the CRTC helper set
config handler if the pixel format changed.
Laurent Pinchart (2):
drm: Don't allow page flip to change pixel format
drm: Perform a full mode set when the pixel format changed
drivers/gpu/drm/drm_crtc.c | 8 ++++++++
drivers/gpu/drm/drm_crtc_helper.c | 3 +++
2 files changed, 11 insertions(+), 0 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 1/2] drm: Don't allow page flip to change pixel format 2012-05-31 16:26 [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart @ 2012-05-31 16:26 ` Laurent Pinchart 2012-05-31 19:44 ` Singh, Satyeshwar 2012-05-31 16:26 ` [PATCH 2/2] drm: Perform a full mode set when the pixel format changed Laurent Pinchart 2012-07-19 11:55 ` [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart 2 siblings, 1 reply; 10+ messages in thread From: Laurent Pinchart @ 2012-05-31 16:26 UTC (permalink / raw) To: dri-devel A page flip is not a mode set, changing the frame buffer pixel format doesn't make sense and isn't handled by most drivers anyway. Disallow it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- drivers/gpu/drm/drm_crtc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 92cea9d..0d15b56 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, goto out; } + if (crtc->fb->pixel_format != fb->pixel_format || + crtc->fb->bits_per_pixel != crtc->fb->bits_per_pixel || + crtc->fb->depth != fb->depth) { + DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); + ret = -EINVAL; + goto out; + } + if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { ret = -ENOMEM; spin_lock_irqsave(&dev->event_lock, flags); -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [PATCH 1/2] drm: Don't allow page flip to change pixel format 2012-05-31 16:26 ` [PATCH 1/2] drm: Don't allow page flip to change pixel format Laurent Pinchart @ 2012-05-31 19:44 ` Singh, Satyeshwar 2012-05-31 19:54 ` Alex Deucher 0 siblings, 1 reply; 10+ messages in thread From: Singh, Satyeshwar @ 2012-05-31 19:44 UTC (permalink / raw) To: dri-devel@lists.freedesktop.org Does this by extension mean that stride changes should also not be allowed while page flipping? Thanks, Satyeshwar -----Original Message----- From: dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org [mailto:dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org] On Behalf Of Laurent Pinchart Sent: Thursday, May 31, 2012 9:26 AM To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm: Don't allow page flip to change pixel format A page flip is not a mode set, changing the frame buffer pixel format doesn't make sense and isn't handled by most drivers anyway. Disallow it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- drivers/gpu/drm/drm_crtc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 92cea9d..0d15b56 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, goto out; } + if (crtc->fb->pixel_format != fb->pixel_format || + crtc->fb->bits_per_pixel != crtc->fb->bits_per_pixel || + crtc->fb->depth != fb->depth) { + DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); + ret = -EINVAL; + goto out; + } + if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { ret = -ENOMEM; spin_lock_irqsave(&dev->event_lock, flags); -- 1.7.3.4 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] drm: Don't allow page flip to change pixel format 2012-05-31 19:44 ` Singh, Satyeshwar @ 2012-05-31 19:54 ` Alex Deucher 2012-06-01 11:46 ` Ville Syrjälä 2012-06-04 20:46 ` Jesse Barnes 0 siblings, 2 replies; 10+ messages in thread From: Alex Deucher @ 2012-05-31 19:54 UTC (permalink / raw) To: Singh, Satyeshwar; +Cc: dri-devel@lists.freedesktop.org On Thu, May 31, 2012 at 3:44 PM, Singh, Satyeshwar <satyeshwar.singh@intel.com> wrote: > Does this by extension mean that stride changes should also not be allowed while page flipping? Everything beyond a crtc base address change should require a full modeset. Alex > Thanks, > Satyeshwar > > -----Original Message----- > From: dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org [mailto:dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org] On Behalf Of Laurent Pinchart > Sent: Thursday, May 31, 2012 9:26 AM > To: dri-devel@lists.freedesktop.org > Subject: [PATCH 1/2] drm: Don't allow page flip to change pixel format > > A page flip is not a mode set, changing the frame buffer pixel format doesn't make sense and isn't handled by most drivers anyway. Disallow it. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > drivers/gpu/drm/drm_crtc.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 92cea9d..0d15b56 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, > goto out; > } > > + if (crtc->fb->pixel_format != fb->pixel_format || > + crtc->fb->bits_per_pixel != crtc->fb->bits_per_pixel || > + crtc->fb->depth != fb->depth) { > + DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); > + ret = -EINVAL; > + goto out; > + } > + > if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { > ret = -ENOMEM; > spin_lock_irqsave(&dev->event_lock, flags); > -- > 1.7.3.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] drm: Don't allow page flip to change pixel format 2012-05-31 19:54 ` Alex Deucher @ 2012-06-01 11:46 ` Ville Syrjälä 2012-06-04 20:46 ` Jesse Barnes 1 sibling, 0 replies; 10+ messages in thread From: Ville Syrjälä @ 2012-06-01 11:46 UTC (permalink / raw) To: Alex Deucher; +Cc: dri-devel@lists.freedesktop.org On Thu, May 31, 2012 at 03:54:03PM -0400, Alex Deucher wrote: > On Thu, May 31, 2012 at 3:44 PM, Singh, Satyeshwar > <satyeshwar.singh@intel.com> wrote: > > Does this by extension mean that stride changes should also not be allowed while page flipping? > > Everything beyond a crtc base address change should require a full modeset. That's a rather silly limitation on decent hardware, but perhaps it makes sense with the current API. My recent patch for i915 just rejected pixel format, pitch and offset changes on the driver side. The hardware can actually handle such things, except currently the driver uses pipelined flips instead of direct register banging, which imposes these limitations. For the atomic mode setting API I don't plan to special case page flips in generic code at all. I'll leave it up to the driver to decide what operations it can perform atomically and/or asynchronously. > > -----Original Message----- > > From: dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org [mailto:dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org] On Behalf Of Laurent Pinchart > > Sent: Thursday, May 31, 2012 9:26 AM > > To: dri-devel@lists.freedesktop.org > > Subject: [PATCH 1/2] drm: Don't allow page flip to change pixel format > > > > A page flip is not a mode set, changing the frame buffer pixel format doesn't make sense and isn't handled by most drivers anyway. Disallow it. > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > drivers/gpu/drm/drm_crtc.c | 8 ++++++++ > > 1 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 92cea9d..0d15b56 100644 > > --- a/drivers/gpu/drm/drm_crtc.c > > +++ b/drivers/gpu/drm/drm_crtc.c > > @@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, > > goto out; > > } > > > > + if (crtc->fb->pixel_format != fb->pixel_format || > > + crtc->fb->bits_per_pixel != crtc->fb->bits_per_pixel || > > + crtc->fb->depth != fb->depth) { The bits_per_pixel and depth comparisons are pointless. I'm thinking we should perhaps just remove them from the structure, so that drivers would be forced to actually use pixel_format. I'm not sure if all the drivers have already been fixed to actually check the requested pixel_format or not, or can you ask for example RGBA8888 and have the hardware scan it out as ARGB8888 instead. -- Ville Syrjälä Intel OTC ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] drm: Don't allow page flip to change pixel format 2012-05-31 19:54 ` Alex Deucher 2012-06-01 11:46 ` Ville Syrjälä @ 2012-06-04 20:46 ` Jesse Barnes 1 sibling, 0 replies; 10+ messages in thread From: Jesse Barnes @ 2012-06-04 20:46 UTC (permalink / raw) To: Alex Deucher; +Cc: dri-devel@lists.freedesktop.org That's probably safest, however on Intel we can change the stride and tiling format for sync flips at least. But I'm ok with this patch; we generally need to recalculate bw requirements and watermarks when adjusting depth and such. On Thu, 31 May 2012 15:54:03 -0400 Alex Deucher <alexdeucher@gmail.com> wrote: > On Thu, May 31, 2012 at 3:44 PM, Singh, Satyeshwar > <satyeshwar.singh@intel.com> wrote: > > Does this by extension mean that stride changes should also not be allowed while page flipping? > > Everything beyond a crtc base address change should require a full modeset. > > Alex > > > Thanks, > > Satyeshwar > > > > -----Original Message----- > > From: dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org [mailto:dri-devel-bounces+satyeshwar.singh=intel.com@lists.freedesktop.org] On Behalf Of Laurent Pinchart > > Sent: Thursday, May 31, 2012 9:26 AM > > To: dri-devel@lists.freedesktop.org > > Subject: [PATCH 1/2] drm: Don't allow page flip to change pixel format > > > > A page flip is not a mode set, changing the frame buffer pixel format doesn't make sense and isn't handled by most drivers anyway. Disallow it. > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > drivers/gpu/drm/drm_crtc.c | 8 ++++++++ > > 1 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 92cea9d..0d15b56 100644 > > --- a/drivers/gpu/drm/drm_crtc.c > > +++ b/drivers/gpu/drm/drm_crtc.c > > @@ -3530,6 +3530,14 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, > > goto out; > > } > > > > + if (crtc->fb->pixel_format != fb->pixel_format || > > + crtc->fb->bits_per_pixel != crtc->fb->bits_per_pixel || > > + crtc->fb->depth != fb->depth) { > > + DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); > > + ret = -EINVAL; > > + goto out; > > + } > > + > > if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { > > ret = -ENOMEM; > > spin_lock_irqsave(&dev->event_lock, flags); > > -- > > 1.7.3.4 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel > -- Jesse Barnes, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] drm: Perform a full mode set when the pixel format changed 2012-05-31 16:26 [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart 2012-05-31 16:26 ` [PATCH 1/2] drm: Don't allow page flip to change pixel format Laurent Pinchart @ 2012-05-31 16:26 ` Laurent Pinchart 2012-07-19 11:55 ` [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart 2 siblings, 0 replies; 10+ messages in thread From: Laurent Pinchart @ 2012-05-31 16:26 UTC (permalink / raw) To: dri-devel Test whether the pixel format changes in the mode set handler, and perform a full mode set instead of a mode set base if it does. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- drivers/gpu/drm/drm_crtc_helper.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 3252e70..0e8cd89 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -609,6 +609,9 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) } else if (set->fb->bits_per_pixel != set->crtc->fb->bits_per_pixel) { mode_changed = true; + } else if (set->fb->pixel_format != + set->crtc->fb->pixel_format) { + mode_changed = true; } else fb_changed = true; } -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] Miscellaneous mode set and page flip fixes 2012-05-31 16:26 [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart 2012-05-31 16:26 ` [PATCH 1/2] drm: Don't allow page flip to change pixel format Laurent Pinchart 2012-05-31 16:26 ` [PATCH 2/2] drm: Perform a full mode set when the pixel format changed Laurent Pinchart @ 2012-07-19 11:55 ` Laurent Pinchart 2012-08-23 10:05 ` Laurent Pinchart 2 siblings, 1 reply; 10+ messages in thread From: Laurent Pinchart @ 2012-07-19 11:55 UTC (permalink / raw) To: dri-devel On Thursday 31 May 2012 18:26:14 Laurent Pinchart wrote: > Hi everybody, > > Here are two small fixes that disallow format changes in page flip > operations, and perform a full mode set instead of a mode set base in the > CRTC helper set config handler if the pixel format changed. Ping ? Can those two patches be applied ? > Laurent Pinchart (2): > drm: Don't allow page flip to change pixel format > drm: Perform a full mode set when the pixel format changed > > drivers/gpu/drm/drm_crtc.c | 8 ++++++++ > drivers/gpu/drm/drm_crtc_helper.c | 3 +++ > 2 files changed, 11 insertions(+), 0 deletions(-) -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] Miscellaneous mode set and page flip fixes 2012-07-19 11:55 ` [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart @ 2012-08-23 10:05 ` Laurent Pinchart 2013-03-28 15:14 ` Laurent Pinchart 0 siblings, 1 reply; 10+ messages in thread From: Laurent Pinchart @ 2012-08-23 10:05 UTC (permalink / raw) To: dri-devel, Dave Airlie On Thursday 19 July 2012 13:55:37 Laurent Pinchart wrote: > On Thursday 31 May 2012 18:26:14 Laurent Pinchart wrote: > > Hi everybody, > > > > Here are two small fixes that disallow format changes in page flip > > operations, and perform a full mode set instead of a mode set base in the > > CRTC helper set config handler if the pixel format changed. > > Ping ? Can those two patches be applied ? Ping again ? > > Laurent Pinchart (2): > > drm: Don't allow page flip to change pixel format > > drm: Perform a full mode set when the pixel format changed > > > > drivers/gpu/drm/drm_crtc.c | 8 ++++++++ > > drivers/gpu/drm/drm_crtc_helper.c | 3 +++ > > 2 files changed, 11 insertions(+), 0 deletions(-) -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] Miscellaneous mode set and page flip fixes 2012-08-23 10:05 ` Laurent Pinchart @ 2013-03-28 15:14 ` Laurent Pinchart 0 siblings, 0 replies; 10+ messages in thread From: Laurent Pinchart @ 2013-03-28 15:14 UTC (permalink / raw) To: dri-devel On Thursday 23 August 2012 12:05:27 Laurent Pinchart wrote: > On Thursday 19 July 2012 13:55:37 Laurent Pinchart wrote: > > On Thursday 31 May 2012 18:26:14 Laurent Pinchart wrote: > > > Hi everybody, > > > > > > Here are two small fixes that disallow format changes in page flip > > > operations, and perform a full mode set instead of a mode set base in > > > the > > > CRTC helper set config handler if the pixel format changed. > > > > Ping ? Can those two patches be applied ? > > Ping again ? And again ? :-) > > > Laurent Pinchart (2): > > > drm: Don't allow page flip to change pixel format > > > drm: Perform a full mode set when the pixel format changed > > > > > > drivers/gpu/drm/drm_crtc.c | 8 ++++++++ > > > drivers/gpu/drm/drm_crtc_helper.c | 3 +++ > > > 2 files changed, 11 insertions(+), 0 deletions(-) -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-03-28 15:13 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-05-31 16:26 [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart 2012-05-31 16:26 ` [PATCH 1/2] drm: Don't allow page flip to change pixel format Laurent Pinchart 2012-05-31 19:44 ` Singh, Satyeshwar 2012-05-31 19:54 ` Alex Deucher 2012-06-01 11:46 ` Ville Syrjälä 2012-06-04 20:46 ` Jesse Barnes 2012-05-31 16:26 ` [PATCH 2/2] drm: Perform a full mode set when the pixel format changed Laurent Pinchart 2012-07-19 11:55 ` [PATCH 0/2] Miscellaneous mode set and page flip fixes Laurent Pinchart 2012-08-23 10:05 ` Laurent Pinchart 2013-03-28 15:14 ` Laurent Pinchart
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.