Message ID | 20220728-rpi-analog-tv-properties-v1-6-3d53ae722097@cerno.tech (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Neil Armstrong |
Headers | show |
Series | drm: Analog TV Improvements | expand |
Den 29.07.2022 18.34, skrev Maxime Ripard: > The drm_create_tv_properties() will create the TV mode property > unconditionally. > > However, since we'll gradually phase it out, let's register it only if we > have a list passed as an argument. This will make the transition easier. > > Signed-off-by: Maxime Ripard <maxime@cerno.tech> > I don't understand why this makes the transition easier, but if you think so: Acked-by: Noralf Trønnes <noralf@tronnes.org> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c > index 68a4e47f85a9..d73a68764b6e 100644 > --- a/drivers/gpu/drm/drm_connector.c > +++ b/drivers/gpu/drm/drm_connector.c > @@ -1684,7 +1684,6 @@ int drm_mode_create_tv_properties(struct drm_device *dev, > struct drm_property *tv_selector; > struct drm_property *tv_subconnector; > struct drm_property *tv_norm; > - unsigned int i; > > if (dev->mode_config.tv_select_subconnector_property) > return 0; > @@ -1723,15 +1722,19 @@ int drm_mode_create_tv_properties(struct drm_device *dev, > goto nomem; > dev->mode_config.tv_norm_property = tv_norm; > > - dev->mode_config.tv_mode_property = > - drm_property_create(dev, DRM_MODE_PROP_ENUM, > - "mode", num_modes); > - if (!dev->mode_config.tv_mode_property) > - goto nomem; > + if (num_modes) { > + unsigned int i; > > - for (i = 0; i < num_modes; i++) > - drm_property_add_enum(dev->mode_config.tv_mode_property, > - i, modes[i]); > + dev->mode_config.tv_mode_property = > + drm_property_create(dev, DRM_MODE_PROP_ENUM, > + "mode", num_modes); > + if (!dev->mode_config.tv_mode_property) > + goto nomem; > + > + for (i = 0; i < num_modes; i++) > + drm_property_add_enum(dev->mode_config.tv_mode_property, > + i, modes[i]); > + } > > dev->mode_config.tv_brightness_property = > drm_property_create_range(dev, 0, "brightness", 0, 100); >
Hi, On Mon, Aug 08, 2022 at 02:49:08PM +0200, Noralf Trønnes wrote: > Den 29.07.2022 18.34, skrev Maxime Ripard: > > The drm_create_tv_properties() will create the TV mode property > > unconditionally. > > > > However, since we'll gradually phase it out, let's register it only if we > > have a list passed as an argument. This will make the transition easier. > > > > Signed-off-by: Maxime Ripard <maxime@cerno.tech> > > > > I don't understand why this makes the transition easier, but if you > think so: So the basic idea behind this series was to introduce the new property, gradually convert the old drivers to the new one, and finally remove the old one. In order to keep the backward compatibility, we need to add to the drivers some custom get/set_property hook to expose the old property and fill the new one if needed. That means that each driver would have to create the old property, which will conflict with that code Maxime
Den 15.08.2022 12.40, skrev Maxime Ripard: > Hi, > > On Mon, Aug 08, 2022 at 02:49:08PM +0200, Noralf Trønnes wrote: >> Den 29.07.2022 18.34, skrev Maxime Ripard: >>> The drm_create_tv_properties() will create the TV mode property >>> unconditionally. >>> >>> However, since we'll gradually phase it out, let's register it only if we >>> have a list passed as an argument. This will make the transition easier. >>> >>> Signed-off-by: Maxime Ripard <maxime@cerno.tech> >>> >> >> I don't understand why this makes the transition easier, but if you >> think so: > > So the basic idea behind this series was to introduce the new property, > gradually convert the old drivers to the new one, and finally remove the > old one. > > In order to keep the backward compatibility, we need to add to the > drivers some custom get/set_property hook to expose the old property and > fill the new one if needed. > > That means that each driver would have to create the old property, which > will conflict with that code > Got it. Noralf.
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 68a4e47f85a9..d73a68764b6e 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1684,7 +1684,6 @@ int drm_mode_create_tv_properties(struct drm_device *dev, struct drm_property *tv_selector; struct drm_property *tv_subconnector; struct drm_property *tv_norm; - unsigned int i; if (dev->mode_config.tv_select_subconnector_property) return 0; @@ -1723,15 +1722,19 @@ int drm_mode_create_tv_properties(struct drm_device *dev, goto nomem; dev->mode_config.tv_norm_property = tv_norm; - dev->mode_config.tv_mode_property = - drm_property_create(dev, DRM_MODE_PROP_ENUM, - "mode", num_modes); - if (!dev->mode_config.tv_mode_property) - goto nomem; + if (num_modes) { + unsigned int i; - for (i = 0; i < num_modes; i++) - drm_property_add_enum(dev->mode_config.tv_mode_property, - i, modes[i]); + dev->mode_config.tv_mode_property = + drm_property_create(dev, DRM_MODE_PROP_ENUM, + "mode", num_modes); + if (!dev->mode_config.tv_mode_property) + goto nomem; + + for (i = 0; i < num_modes; i++) + drm_property_add_enum(dev->mode_config.tv_mode_property, + i, modes[i]); + } dev->mode_config.tv_brightness_property = drm_property_create_range(dev, 0, "brightness", 0, 100);
The drm_create_tv_properties() will create the TV mode property unconditionally. However, since we'll gradually phase it out, let's register it only if we have a list passed as an argument. This will make the transition easier. Signed-off-by: Maxime Ripard <maxime@cerno.tech>