[PATCH v7 5/9] drm: Handle aspect-ratio info in getblob

Ville Syrjälä ville.syrjala at linux.intel.com
Mon Mar 12 14:10:04 UTC 2018


On Mon, Mar 12, 2018 at 01:32:48PM +0530, Nautiyal, Ankit K wrote:
> 
> 
> On 3/9/2018 6:40 PM, Ville Syrjälä wrote:
> > IIRC I did have a few more patches in my last inforame series to make
> > sure we don't send invalid aspect ratio values in the infoframe. Unless
> > something has changed I believe we still need those as well. Or am I
> > wrong?
> 
> You are right, There are two patches:
> https://patchwork.freedesktop.org/patch/188049/
> and https://patchwork.freedesktop.org/patch/188051/
> from the info-frame clean up series, both of which have already received 
> r-b.
> 
> These patches need a little change, as they reject picture aspect ratio  
>  > 16:9
> Since we are adding support of 64:27 and 256:135, then we need to update 
> the reject condition.

IIRC the whole point was that the inforframe can't convey 64:27 or
256:135. Thus the >16:9 cheeck still looks correct to me.

> I can make the required changes and add these two patches as part of 
> this series.
> 
> What do you suggest? Is it fine to make these changes?
> 
> Regards,
> Ankit
> >
> >> diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
> >> index c37ac41..0a9c879 100644
> >> --- a/drivers/gpu/drm/drm_property.c
> >> +++ b/drivers/gpu/drm/drm_property.c
> >> @@ -757,6 +757,11 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
> >>   			ret = -EFAULT;
> >>   			goto unref;
> >>   		}
> >> +		if (blob->is_video_mode) {
> >> +			struct drm_mode_modeinfo __user *mode =
> >> +				u64_to_user_ptr(out_resp->data);
> >> +			drm_mode_handle_aspect_ratio(file_priv, &mode->flags);
> >> +		}
> >>   	}
> >>   	out_resp->length = blob->length;
> >>   unref:
> >> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> >> index 2f78b7e..51d1188 100644
> >> --- a/include/drm/drm_modes.h
> >> +++ b/include/drm/drm_modes.h
> >> @@ -461,6 +461,10 @@ bool drm_mode_is_420_also(const struct drm_display_info *display,
> >>   			  const struct drm_display_mode *mode);
> >>   bool drm_mode_is_420(const struct drm_display_info *display,
> >>   		     const struct drm_display_mode *mode);
> >> +bool drm_mode_aspect_ratio_allowed(const struct drm_file *file_priv,
> >> +				   uint32_t flags);
> >> +void drm_mode_handle_aspect_ratio(const struct drm_file *file_priv,
> >> +				  uint32_t *flags);
> >>   
> >>   struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
> >>   				      int hdisplay, int vdisplay, int vrefresh,
> >> diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h
> >> index 8a522b4..95e6e32 100644
> >> --- a/include/drm/drm_property.h
> >> +++ b/include/drm/drm_property.h
> >> @@ -194,6 +194,7 @@ struct drm_property {
> >>    * @head_global: entry on the global blob list in
> >>    * 	&drm_mode_config.property_blob_list.
> >>    * @head_file: entry on the per-file blob list in &drm_file.blobs list.
> >> + * @is_video_mode: flag to mark the blobs that contain drm_mode_modeinfo.
> >>    * @length: size of the blob in bytes, invariant over the lifetime of the object
> >>    * @data: actual data, embedded at the end of this structure
> >>    *
> >> @@ -208,6 +209,7 @@ struct drm_property_blob {
> >>   	struct drm_device *dev;
> >>   	struct list_head head_global;
> >>   	struct list_head head_file;
> >> +	bool is_video_mode;
> >>   	size_t length;
> >>   	unsigned char data[];
> >>   };
> >> -- 
> >> 2.7.4
> 

-- 
Ville Syrjälä
Intel OTC


More information about the dri-devel mailing list