On 2017年02月15日 04:32, Daniel Stone
wrote:
Hi John, On 14 February 2017 at 19:25, John Stultz <john.stultz@xxxxxxxxxx> wrote:+static enum drm_mode_status +drm_connector_check_crtc_modes(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct drm_device *dev = connector->dev; + const struct drm_crtc_helper_funcs *crtc_funcs; + struct drm_crtc *c; + + if (mode->status != MODE_OK) + return mode->status; + + /* Check all the crtcs on a connector to make sure the mode is valid */ + drm_for_each_crtc(c, dev) { + crtc_funcs = c->helper_private; + if (crtc_funcs && crtc_funcs->mode_valid) + mode->status = crtc_funcs->mode_valid(c, mode); + if (mode->status != MODE_OK) + break; + } + return mode->status; +}Hm, that's unfortunate: it limits the mode list for every connector, to those which are supported by every single CRTC. So if you have one CRTC serving low-res LVDS, and another serving higher-res HDMI, suddenly you can't get bigger modes on HDMI. The idea seems sound enough, but a little more nuance might be good ... John, I have same requirement, also want to valid mode with crtc, here is my patch[0], use encoder->possible_crtcs to limit the crtc valid, may be can solved the low-res and high-res problem. [0]: https://patchwork.kernel.org/patch/9555945 /* * ensure all drm display mode can work, if someone want support more * resolutions, please limit the possible_crtc, only connect to * needed crtc. */ drm_for_each_crtc(crtc, connector->dev) { [...] if (!(encoder->possible_crtcs & drm_crtc_mask(crtc))) Cheers, Daniel _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Mark Yao |
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel