/* The DRM device (@dev) has size and pitch limits. Here we validate the modes we probed for @dev against those limits and set their status as necessary.  */
void drm_mode_validate_size(struct drm_device *dev, struct list_head *mode_list, int maxX, int maxY, int maxPitch)
/* The DRM device (@dev) has size and pitch limits. Here we validate the modes we probed for @dev against those limits and set their status as necessary.  */
void drm_mode_validate_size(struct drm_device *dev, struct list_head *mode_list, int maxX, int maxY, int maxPitch)
{
	struct drm_display_mode *mode;
	list_for_each_entry(mode, mode_list, head) {
		if (maxPitch > 0 && mode->hdisplay > maxPitch)
			mode->status = MODE_BAD_WIDTH;
		if (maxX > 0 && mode->hdisplay > maxX)
			mode->status = MODE_VIRTUAL_X;
		if (maxY > 0 && mode->vdisplay > maxY)
			mode->status = MODE_VIRTUAL_Y;
	}
}