Dhinakaran Pandiyan
2016-Dec-21 20:12 UTC
[Nouveau] [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
This check is useful for drivers that do not have DRIVER_ATOMIC set but have atomic modesetting internally implemented. Wrap the check into a function since this is used in many places and as a bonus, the function name helps to document what the check is for. v2: Change return type to bool (Ville) Move the function drm_atomic.h (Daniel) Suggested-by: Daniel Vetter <daniel.vetter at ffwll.ch> Cc: Daniel Vetter <daniel.vetter at ffwll.ch> Cc: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> --- drivers/gpu/drm/drm_fb_helper.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_connector.c | 5 +++-- drivers/gpu/drm/nouveau/nouveau_display.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 3 ++- include/drm/drm_atomic.h | 11 +++++++++++ 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 145d55f..730342c 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -405,7 +405,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper) drm_warn_on_modeset_not_all_locked(dev); - if (dev->mode_config.funcs->atomic_commit) + if (drm_drv_uses_atomic_modeset(dev)) return restore_fbdev_mode_atomic(fb_helper); drm_for_each_plane(plane, dev) { @@ -1444,7 +1444,7 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, return -EBUSY; } - if (dev->mode_config.funcs->atomic_commit) { + if (drm_drv_uses_atomic_modeset(dev)) { ret = pan_display_atomic(var, info); goto unlock; } @@ -2060,7 +2060,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, * NULL we fallback to the default drm_atomic_helper_best_encoder() * helper. */ - if (fb_helper->dev->mode_config.funcs->atomic_commit && + if (drm_drv_uses_atomic_modeset(fb_helper->dev) && !connector_funcs->best_encoder) encoder = drm_atomic_helper_best_encoder(connector); else diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 947c200..966d20a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -33,6 +33,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_edid.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_atomic.h> #include "nouveau_reg.h" #include "nouveau_drv.h" @@ -769,7 +770,7 @@ nouveau_connector_set_property(struct drm_connector *connector, struct drm_encoder *encoder = to_drm_encoder(nv_encoder); int ret; - if (connector->dev->mode_config.funcs->atomic_commit) + if (drm_drv_uses_atomic_modeset(connector->dev)) return drm_atomic_helper_connector_set_property(connector, property, value); ret = connector->funcs->atomic_set_property(&nv_connector->base, @@ -1074,7 +1075,7 @@ nouveau_connector_helper_funcs = { static int nouveau_connector_dpms(struct drm_connector *connector, int mode) { - if (connector->dev->mode_config.funcs->atomic_commit) + if (drm_drv_uses_atomic_modeset(connector->dev)) return drm_atomic_helper_connector_dpms(connector, mode); return drm_helper_connector_dpms(connector, mode); } diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index c5cf888..add353e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -162,7 +162,7 @@ nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { if (nouveau_crtc(crtc)->index == pipe) { struct drm_display_mode *mode; - if (dev->mode_config.funcs->atomic_commit) + if (drm_drv_uses_atomic_modeset(dev)) mode = &crtc->state->adjusted_mode; else mode = &crtc->hwmode; @@ -738,7 +738,7 @@ nouveau_display_suspend(struct drm_device *dev, bool runtime) struct nouveau_display *disp = nouveau_display(dev); struct drm_crtc *crtc; - if (dev->mode_config.funcs->atomic_commit) { + if (drm_drv_uses_atomic_modeset(dev)) { if (!runtime) { disp->suspend = nouveau_atomic_suspend(dev); if (IS_ERR(disp->suspend)) { @@ -784,7 +784,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) struct drm_crtc *crtc; int ret; - if (dev->mode_config.funcs->atomic_commit) { + if (drm_drv_uses_atomic_modeset(dev)) { nouveau_display_init(dev); if (disp->suspend) { drm_atomic_helper_resume(dev, disp->suspend); diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 5600f6c..9de6abb 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -41,6 +41,7 @@ #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_atomic.h> #include "nouveau_drv.h" #include "nouveau_gem.h" @@ -524,7 +525,7 @@ nouveau_fbcon_init(struct drm_device *dev) preferred_bpp = 32; /* disable all the possible outputs/crtcs before entering KMS mode */ - if (!dev->mode_config.funcs->atomic_commit) + if (!drm_drv_uses_atomic_modeset(dev)) drm_helper_disable_unused_functions(dev); ret = drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp); diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index 8cc7ca2..43db162 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -419,5 +419,16 @@ drm_atomic_crtc_needs_modeset(const struct drm_crtc_state *state) state->connectors_changed; } +/* drm_drv_uses_atomic_modeset - check if the driver implements + * atomic_commit() + * @dev: DRM device + * + * This check is useful if drivers do not have DRIVER_ATOMIC set but + * have atomic modesetting internally implemented. + */ +static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) +{ + return dev->mode_config.funcs->atomic_commit ? true : false; +} #endif /* DRM_ATOMIC_H_ */ -- 2.7.4
Dhinakaran Pandiyan
2016-Dec-21 20:12 UTC
[Nouveau] [PATCH v2 2/2] drm: Get atomic property value even if DRIVER_ATOMIC is not set
i915 does not set DRIVER_ATOMIC by default yet but uses atomic_check and atomic_commit. drm_object_property_get_value() does not read the correct value of atomic properties if DRIVER_ATOMIC is not set. Checking whether the driver uses atomic modeset is a better check instead as the property values are tracked in the state structures. v2: Included header Cc: Daniel Vetter <daniel.vetter at ffwll.ch> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> --- drivers/gpu/drm/drm_mode_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c index 9f17085..14543ff 100644 --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -23,6 +23,7 @@ #include <linux/export.h> #include <drm/drmP.h> #include <drm/drm_mode_object.h> +#include <drm/drm_atomic.h> #include "drm_crtc_internal.h" @@ -273,7 +274,7 @@ int drm_object_property_get_value(struct drm_mode_object *obj, * their value in obj->properties->values[].. mostly to avoid * having to deal w/ EDID and similar props in atomic paths: */ - if (drm_core_check_feature(property->dev, DRIVER_ATOMIC) && + if (drm_drv_uses_atomic_modeset(property->dev) && !(property->flags & DRM_MODE_PROP_IMMUTABLE)) return drm_atomic_get_property(obj, property, val); -- 2.7.4
Daniel Vetter
2016-Dec-22 07:11 UTC
[Nouveau] [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
On Wed, Dec 21, 2016 at 12:12:08PM -0800, Dhinakaran Pandiyan wrote:> This check is useful for drivers that do not have DRIVER_ATOMIC set but > have atomic modesetting internally implemented. Wrap the check into a > function since this is used in many places and as a bonus, the function > name helps to document what the check is for. > > v2: > Change return type to bool (Ville) > Move the function drm_atomic.h (Daniel) > > Suggested-by: Daniel Vetter <daniel.vetter at ffwll.ch> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch> > Cc: Ben Skeggs <bskeggs at redhat.com> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> > --- > drivers/gpu/drm/drm_fb_helper.c | 6 +++--- > drivers/gpu/drm/nouveau/nouveau_connector.c | 5 +++-- > drivers/gpu/drm/nouveau/nouveau_display.c | 6 +++--- > drivers/gpu/drm/nouveau/nouveau_fbcon.c | 3 ++- > include/drm/drm_atomic.h | 11 +++++++++++ > 5 files changed, 22 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 145d55f..730342c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -405,7 +405,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper) > > drm_warn_on_modeset_not_all_locked(dev); > > - if (dev->mode_config.funcs->atomic_commit) > + if (drm_drv_uses_atomic_modeset(dev)) > return restore_fbdev_mode_atomic(fb_helper); > > drm_for_each_plane(plane, dev) { > @@ -1444,7 +1444,7 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, > return -EBUSY; > } > > - if (dev->mode_config.funcs->atomic_commit) { > + if (drm_drv_uses_atomic_modeset(dev)) { > ret = pan_display_atomic(var, info); > goto unlock; > } > @@ -2060,7 +2060,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, > * NULL we fallback to the default drm_atomic_helper_best_encoder() > * helper. > */ > - if (fb_helper->dev->mode_config.funcs->atomic_commit && > + if (drm_drv_uses_atomic_modeset(fb_helper->dev) && > !connector_funcs->best_encoder) > encoder = drm_atomic_helper_best_encoder(connector); > else > diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c > index 947c200..966d20a 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_connector.c > +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c > @@ -33,6 +33,7 @@ > #include <drm/drm_atomic_helper.h> > #include <drm/drm_edid.h> > #include <drm/drm_crtc_helper.h> > +#include <drm/drm_atomic.h> > > #include "nouveau_reg.h" > #include "nouveau_drv.h" > @@ -769,7 +770,7 @@ nouveau_connector_set_property(struct drm_connector *connector, > struct drm_encoder *encoder = to_drm_encoder(nv_encoder); > int ret; > > - if (connector->dev->mode_config.funcs->atomic_commit) > + if (drm_drv_uses_atomic_modeset(connector->dev)) > return drm_atomic_helper_connector_set_property(connector, property, value); > > ret = connector->funcs->atomic_set_property(&nv_connector->base, > @@ -1074,7 +1075,7 @@ nouveau_connector_helper_funcs = { > static int > nouveau_connector_dpms(struct drm_connector *connector, int mode) > { > - if (connector->dev->mode_config.funcs->atomic_commit) > + if (drm_drv_uses_atomic_modeset(connector->dev)) > return drm_atomic_helper_connector_dpms(connector, mode); > return drm_helper_connector_dpms(connector, mode); > } > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c > index c5cf888..add353e 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_display.c > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c > @@ -162,7 +162,7 @@ nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, > list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { > if (nouveau_crtc(crtc)->index == pipe) { > struct drm_display_mode *mode; > - if (dev->mode_config.funcs->atomic_commit) > + if (drm_drv_uses_atomic_modeset(dev)) > mode = &crtc->state->adjusted_mode; > else > mode = &crtc->hwmode; > @@ -738,7 +738,7 @@ nouveau_display_suspend(struct drm_device *dev, bool runtime) > struct nouveau_display *disp = nouveau_display(dev); > struct drm_crtc *crtc; > > - if (dev->mode_config.funcs->atomic_commit) { > + if (drm_drv_uses_atomic_modeset(dev)) { > if (!runtime) { > disp->suspend = nouveau_atomic_suspend(dev); > if (IS_ERR(disp->suspend)) { > @@ -784,7 +784,7 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) > struct drm_crtc *crtc; > int ret; > > - if (dev->mode_config.funcs->atomic_commit) { > + if (drm_drv_uses_atomic_modeset(dev)) { > nouveau_display_init(dev); > if (disp->suspend) { > drm_atomic_helper_resume(dev, disp->suspend); > diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > index 5600f6c..9de6abb 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c > +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c > @@ -41,6 +41,7 @@ > #include <drm/drm_crtc.h> > #include <drm/drm_crtc_helper.h> > #include <drm/drm_fb_helper.h> > +#include <drm/drm_atomic.h> > > #include "nouveau_drv.h" > #include "nouveau_gem.h" > @@ -524,7 +525,7 @@ nouveau_fbcon_init(struct drm_device *dev) > preferred_bpp = 32; > > /* disable all the possible outputs/crtcs before entering KMS mode */ > - if (!dev->mode_config.funcs->atomic_commit) > + if (!drm_drv_uses_atomic_modeset(dev)) > drm_helper_disable_unused_functions(dev); > > ret = drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp); > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > index 8cc7ca2..43db162 100644 > --- a/include/drm/drm_atomic.h > +++ b/include/drm/drm_atomic.h > @@ -419,5 +419,16 @@ drm_atomic_crtc_needs_modeset(const struct drm_crtc_state *state) > state->connectors_changed; > } > > +/* drm_drv_uses_atomic_modeset - check if the driver implements > + * atomic_commit() > + * @dev: DRM device > + * > + * This check is useful if drivers do not have DRIVER_ATOMIC set but > + * have atomic modesetting internally implemented. > + */ > +static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) > +{ > + return dev->mode_config.funcs->atomic_commit ? true : false;You forgot the part from Ville's review that the entire "?:" at the end is redundant: A pointer in bool context automatically converts to a bool like this, and we use this _everywhere_. Please remove and respin. Also when you resend the entire patch series, pls start a new thread. CI otherwise assumes that you're only partially resend patches and tries to merge old&new series, which doesn't apply ofc. Since it's already a mess you new to start a new series even if only patch 1 changed. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
kbuild test robot
2016-Dec-22 08:07 UTC
[Nouveau] [Intel-gfx] [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
Hi Dhinakaran, [auto build test ERROR on drm/drm-next] [also build test ERROR on next-20161222] [cannot apply to v4.9] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Dhinakaran-Pandiyan/drm-Wrap-the-check-for-atomic_commit-implementation/20161222-153523 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: i386-randconfig-s1-201651 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): In file included from drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c:19:0: include/drm/drm_atomic.h: In function 'drm_drv_uses_atomic_modeset':>> include/drm/drm_atomic.h:436:12: error: dereferencing pointer to incomplete type 'struct drm_device'return dev->mode_config.funcs->atomic_commit ? true : false; ^~ vim +436 include/drm/drm_atomic.h 430 * 431 * This check is useful if drivers do not have DRIVER_ATOMIC set but 432 * have atomic modesetting internally implemented. 433 */ 434 static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) 435 { > 436 return dev->mode_config.funcs->atomic_commit ? true : false; 437 } 438 439 #endif /* DRM_ATOMIC_H_ */ --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/gzip Size: 33192 bytes Desc: not available URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20161222/17e99ae1/attachment-0001.gz>
Ander Conselvan De Oliveira
2016-Dec-22 08:36 UTC
[Nouveau] [Intel-gfx] [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
On Wed, 2016-12-21 at 12:12 -0800, Dhinakaran Pandiyan wrote:> This check is useful for drivers that do not have DRIVER_ATOMIC set but > have atomic modesetting internally implemented. Wrap the check into a > function since this is used in many places and as a bonus, the function > name helps to document what the check is for. > > v2: > Change return type to bool (Ville) > Move the function drm_atomic.h (Daniel) > > Suggested-by: Daniel Vetter <daniel.vetter at ffwll.ch> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch> > Cc: Ben Skeggs <bskeggs at redhat.com> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> > --- > drivers/gpu/drm/drm_fb_helper.c | 6 +++--- > drivers/gpu/drm/nouveau/nouveau_connector.c | 5 +++-- > drivers/gpu/drm/nouveau/nouveau_display.c | 6 +++--- > drivers/gpu/drm/nouveau/nouveau_fbcon.c | 3 ++- > include/drm/drm_atomic.h | 11 +++++++++++ > 5 files changed, 22 insertions(+), 9 deletions(-) >...> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > index 8cc7ca2..43db162 100644 > --- a/include/drm/drm_atomic.h > +++ b/include/drm/drm_atomic.h > @@ -419,5 +419,16 @@ drm_atomic_crtc_needs_modeset(const struct drm_crtc_state > *state) > state->connectors_changed; > } > > +/* drm_drv_uses_atomic_modeset - check if the driver implementsShouldn't this be /** * drm_drv_uses_atomic_modeset - ... so it is included in the generated documentation? Ander> + * atomic_commit() > + * @dev: DRM device > + * > + * This check is useful if drivers do not have DRIVER_ATOMIC set but > + * have atomic modesetting internally implemented. > + */ > +static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) > +{ > + return dev->mode_config.funcs->atomic_commit ? true : false; > +} > > #endif /* DRM_ATOMIC_H_ */
Daniel Vetter
2016-Dec-22 08:52 UTC
[Nouveau] [Intel-gfx] [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
On Thu, Dec 22, 2016 at 10:36:01AM +0200, Ander Conselvan De Oliveira wrote:> On Wed, 2016-12-21 at 12:12 -0800, Dhinakaran Pandiyan wrote: > > This check is useful for drivers that do not have DRIVER_ATOMIC set but > > have atomic modesetting internally implemented. Wrap the check into a > > function since this is used in many places and as a bonus, the function > > name helps to document what the check is for. > > > > v2: > > Change return type to bool (Ville) > > Move the function drm_atomic.h (Daniel) > > > > Suggested-by: Daniel Vetter <daniel.vetter at ffwll.ch> > > Cc: Daniel Vetter <daniel.vetter at ffwll.ch> > > Cc: Ben Skeggs <bskeggs at redhat.com> > > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> > > --- > > drivers/gpu/drm/drm_fb_helper.c | 6 +++--- > > drivers/gpu/drm/nouveau/nouveau_connector.c | 5 +++-- > > drivers/gpu/drm/nouveau/nouveau_display.c | 6 +++--- > > drivers/gpu/drm/nouveau/nouveau_fbcon.c | 3 ++- > > include/drm/drm_atomic.h | 11 +++++++++++ > > 5 files changed, 22 insertions(+), 9 deletions(-) > > > > ... > > > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > > index 8cc7ca2..43db162 100644 > > --- a/include/drm/drm_atomic.h > > +++ b/include/drm/drm_atomic.h > > @@ -419,5 +419,16 @@ drm_atomic_crtc_needs_modeset(const struct drm_crtc_state > > *state) > > state->connectors_changed; > > } > > > > +/* drm_drv_uses_atomic_modeset - check if the driver implements > > Shouldn't this be > > /** > * drm_drv_uses_atomic_modeset - ... > > so it is included in the generated documentation?Yup. I'm blind this week it seems. DK, please run $ make DOCBOOKS="" htmldocs and make sure your new documentation does get rendered correctly and shows up in the output. -Daniel> > Ander > > > > + * atomic_commit() > > + * @dev: DRM device > > + * > > + * This check is useful if drivers do not have DRIVER_ATOMIC set but > > + * have atomic modesetting internally implemented. > > + */ > > +static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) > > +{ > > + return dev->mode_config.funcs->atomic_commit ? true : false; > > +} > > > > #endif /* DRM_ATOMIC_H_ */-- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Alex Deucher
2017-Jan-03 16:06 UTC
[Nouveau] [PATCH v2 2/2] drm: Get atomic property value even if DRIVER_ATOMIC is not set
On Wed, Dec 21, 2016 at 3:12 PM, Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> wrote:> i915 does not set DRIVER_ATOMIC by default yet but uses atomic_check and > atomic_commit. drm_object_property_get_value() does not read the correct > value of atomic properties if DRIVER_ATOMIC is not set. Checking whether > the driver uses atomic modeset is a better check instead as the property > values are tracked in the state structures. >I think we are in the same boat. Adding Andrey and Harry. Alex> v2: Included header > > Cc: Daniel Vetter <daniel.vetter at ffwll.ch> > Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com> > --- > drivers/gpu/drm/drm_mode_object.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c > index 9f17085..14543ff 100644 > --- a/drivers/gpu/drm/drm_mode_object.c > +++ b/drivers/gpu/drm/drm_mode_object.c > @@ -23,6 +23,7 @@ > #include <linux/export.h> > #include <drm/drmP.h> > #include <drm/drm_mode_object.h> > +#include <drm/drm_atomic.h> > > #include "drm_crtc_internal.h" > > @@ -273,7 +274,7 @@ int drm_object_property_get_value(struct drm_mode_object *obj, > * their value in obj->properties->values[].. mostly to avoid > * having to deal w/ EDID and similar props in atomic paths: > */ > - if (drm_core_check_feature(property->dev, DRIVER_ATOMIC) && > + if (drm_drv_uses_atomic_modeset(property->dev) && > !(property->flags & DRM_MODE_PROP_IMMUTABLE)) > return drm_atomic_get_property(obj, property, val); > > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reasonably Related Threads
- [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
- [PATCH v4 1/2] drm: Wrap the check for atomic_commit implementation
- [PATCH v3 1/2] drm: Wrap the check for atomic_commit implementation
- [Intel-gfx] [PATCH v2 1/2] drm: Wrap the check for atomic_commit implementation
- [Intel-gfx] [PATCH v3 1/2] drm: Wrap the check for atomic_commit implementation