Commit ed8d1975 authored by Keith Packard's avatar Keith Packard Committed by Dave Airlie

drm: Pass page flip ioctl flags to driver

This lets drivers see the flags requested by the application

[airlied: fixup for rcar/imx/msm]
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarDave Airlie <airlied@gmail.com>
parent e1e9c90e
...@@ -3581,7 +3581,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, ...@@ -3581,7 +3581,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
} }
old_fb = crtc->fb; old_fb = crtc->fb;
ret = crtc->funcs->page_flip(crtc, fb, e); ret = crtc->funcs->page_flip(crtc, fb, e, page_flip->flags);
if (ret) { if (ret) {
if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
spin_lock_irqsave(&dev->event_lock, flags); spin_lock_irqsave(&dev->event_lock, flags);
......
...@@ -185,7 +185,8 @@ static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { ...@@ -185,7 +185,8 @@ static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct exynos_drm_private *dev_priv = dev->dev_private; struct exynos_drm_private *dev_priv = dev->dev_private;
......
...@@ -380,7 +380,8 @@ struct drm_i915_display_funcs { ...@@ -380,7 +380,8 @@ struct drm_i915_display_funcs {
void (*init_clock_gating)(struct drm_device *dev); void (*init_clock_gating)(struct drm_device *dev);
int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc, int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj); struct drm_i915_gem_object *obj,
uint32_t flags);
int (*update_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb, int (*update_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb,
int x, int y); int x, int y);
void (*hpd_irq_setup)(struct drm_device *dev); void (*hpd_irq_setup)(struct drm_device *dev);
......
...@@ -7481,7 +7481,8 @@ inline static void intel_mark_page_flip_active(struct intel_crtc *intel_crtc) ...@@ -7481,7 +7481,8 @@ inline static void intel_mark_page_flip_active(struct intel_crtc *intel_crtc)
static int intel_gen2_queue_flip(struct drm_device *dev, static int intel_gen2_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj,
uint32_t flags)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
...@@ -7525,7 +7526,8 @@ static int intel_gen2_queue_flip(struct drm_device *dev, ...@@ -7525,7 +7526,8 @@ static int intel_gen2_queue_flip(struct drm_device *dev,
static int intel_gen3_queue_flip(struct drm_device *dev, static int intel_gen3_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj,
uint32_t flags)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
...@@ -7566,7 +7568,8 @@ static int intel_gen3_queue_flip(struct drm_device *dev, ...@@ -7566,7 +7568,8 @@ static int intel_gen3_queue_flip(struct drm_device *dev,
static int intel_gen4_queue_flip(struct drm_device *dev, static int intel_gen4_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj,
uint32_t flags)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
...@@ -7614,7 +7617,8 @@ static int intel_gen4_queue_flip(struct drm_device *dev, ...@@ -7614,7 +7617,8 @@ static int intel_gen4_queue_flip(struct drm_device *dev,
static int intel_gen6_queue_flip(struct drm_device *dev, static int intel_gen6_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj,
uint32_t flags)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
...@@ -7664,7 +7668,8 @@ static int intel_gen6_queue_flip(struct drm_device *dev, ...@@ -7664,7 +7668,8 @@ static int intel_gen6_queue_flip(struct drm_device *dev,
static int intel_gen7_queue_flip(struct drm_device *dev, static int intel_gen7_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj,
uint32_t flags)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
...@@ -7714,14 +7719,16 @@ static int intel_gen7_queue_flip(struct drm_device *dev, ...@@ -7714,14 +7719,16 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
static int intel_default_queue_flip(struct drm_device *dev, static int intel_default_queue_flip(struct drm_device *dev,
struct drm_crtc *crtc, struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj,
uint32_t flags)
{ {
return -ENODEV; return -ENODEV;
} }
static int intel_crtc_page_flip(struct drm_crtc *crtc, static int intel_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -7791,7 +7798,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -7791,7 +7798,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
atomic_inc(&intel_crtc->unpin_work_count); atomic_inc(&intel_crtc->unpin_work_count);
intel_crtc->reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter); intel_crtc->reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
ret = dev_priv->display.queue_flip(dev, crtc, fb, obj); ret = dev_priv->display.queue_flip(dev, crtc, fb, obj, page_flip_flags);
if (ret) if (ret)
goto cleanup_pending; goto cleanup_pending;
......
...@@ -371,7 +371,8 @@ static void mdp4_crtc_load_lut(struct drm_crtc *crtc) ...@@ -371,7 +371,8 @@ static void mdp4_crtc_load_lut(struct drm_crtc *crtc)
static int mdp4_crtc_page_flip(struct drm_crtc *crtc, static int mdp4_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *new_fb, struct drm_framebuffer *new_fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
......
...@@ -521,7 +521,8 @@ nouveau_page_flip_emit(struct nouveau_channel *chan, ...@@ -521,7 +521,8 @@ nouveau_page_flip_emit(struct nouveau_channel *chan,
int int
nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
......
...@@ -61,7 +61,8 @@ void nouveau_display_repin(struct drm_device *dev); ...@@ -61,7 +61,8 @@ void nouveau_display_repin(struct drm_device *dev);
void nouveau_display_resume(struct drm_device *dev); void nouveau_display_resume(struct drm_device *dev);
int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event); struct drm_pending_vblank_event *event,
uint32_t page_flip_flags);
int nouveau_finish_page_flip(struct nouveau_channel *, int nouveau_finish_page_flip(struct nouveau_channel *,
struct nouveau_page_flip_state *); struct nouveau_page_flip_state *);
......
...@@ -331,7 +331,8 @@ static void page_flip_cb(void *arg) ...@@ -331,7 +331,8 @@ static void page_flip_cb(void *arg)
static int omap_crtc_page_flip_locked(struct drm_crtc *crtc, static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
......
...@@ -345,7 +345,8 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) ...@@ -345,7 +345,8 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
static int radeon_crtc_page_flip(struct drm_crtc *crtc, static int radeon_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
......
...@@ -497,7 +497,8 @@ static irqreturn_t rcar_du_crtc_irq(int irq, void *arg) ...@@ -497,7 +497,8 @@ static irqreturn_t rcar_du_crtc_irq(int irq, void *arg)
static int rcar_du_crtc_page_flip(struct drm_crtc *crtc, static int rcar_du_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
struct drm_device *dev = rcrtc->crtc.dev; struct drm_device *dev = rcrtc->crtc.dev;
......
...@@ -465,7 +465,8 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) ...@@ -465,7 +465,8 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc)
static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc);
struct drm_device *dev = scrtc->crtc.dev; struct drm_device *dev = scrtc->crtc.dev;
......
...@@ -148,7 +148,8 @@ static void tilcdc_crtc_destroy(struct drm_crtc *crtc) ...@@ -148,7 +148,8 @@ static void tilcdc_crtc_destroy(struct drm_crtc *crtc)
static int tilcdc_crtc_page_flip(struct drm_crtc *crtc, static int tilcdc_crtc_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
......
...@@ -1706,7 +1706,8 @@ int vmw_du_update_layout(struct vmw_private *dev_priv, unsigned num, ...@@ -1706,7 +1706,8 @@ int vmw_du_update_layout(struct vmw_private *dev_priv, unsigned num,
int vmw_du_page_flip(struct drm_crtc *crtc, int vmw_du_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct vmw_private *dev_priv = vmw_priv(crtc->dev); struct vmw_private *dev_priv = vmw_priv(crtc->dev);
struct drm_framebuffer *old_fb = crtc->fb; struct drm_framebuffer *old_fb = crtc->fb;
......
...@@ -123,7 +123,8 @@ struct vmw_display_unit { ...@@ -123,7 +123,8 @@ struct vmw_display_unit {
void vmw_display_unit_cleanup(struct vmw_display_unit *du); void vmw_display_unit_cleanup(struct vmw_display_unit *du);
int vmw_du_page_flip(struct drm_crtc *crtc, int vmw_du_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event); struct drm_pending_vblank_event *event,
uint32_t page_flip_flags);
void vmw_du_crtc_save(struct drm_crtc *crtc); void vmw_du_crtc_save(struct drm_crtc *crtc);
void vmw_du_crtc_restore(struct drm_crtc *crtc); void vmw_du_crtc_restore(struct drm_crtc *crtc);
void vmw_du_crtc_gamma_set(struct drm_crtc *crtc, void vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
......
...@@ -129,7 +129,8 @@ static void ipu_crtc_dpms(struct drm_crtc *crtc, int mode) ...@@ -129,7 +129,8 @@ static void ipu_crtc_dpms(struct drm_crtc *crtc, int mode)
static int ipu_page_flip(struct drm_crtc *crtc, static int ipu_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event) struct drm_pending_vblank_event *event,
uint32_t page_flip_flags)
{ {
struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
int ret; int ret;
......
...@@ -363,7 +363,8 @@ struct drm_crtc_funcs { ...@@ -363,7 +363,8 @@ struct drm_crtc_funcs {
*/ */
int (*page_flip)(struct drm_crtc *crtc, int (*page_flip)(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event); struct drm_pending_vblank_event *event,
uint32_t flags);
int (*set_property)(struct drm_crtc *crtc, int (*set_property)(struct drm_crtc *crtc,
struct drm_property *property, uint64_t val); struct drm_property *property, uint64_t val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment