[PATCH xserver 2/2] modesetting: Use helper to fetch drmModeProperty(Blob)s
Adam Jackson
ajax at nwnk.net
Mon Oct 23 15:41:19 UTC 2017
On Mon, 2017-10-23 at 10:31 +0200, Daniel Martin wrote:
> @@ -1233,26 +1264,15 @@ has_panel_fitter(xf86OutputPtr output)
> drmmode_output_private_ptr drmmode_output = output->driver_private;
> drmModeConnectorPtr koutput = drmmode_output->mode_output;
> drmmode_ptr drmmode = drmmode_output->drmmode;
> - int i;
> + int idx;
>
> /* Presume that if the output supports scaling, then we have a
> * panel fitter capable of adjust any mode to suit.
> */
> - for (i = 0; i < koutput->count_props; i++) {
> - drmModePropertyPtr props;
> - Bool found = FALSE;
> + idx = koutput_get_prop_idx(drmmode->fd, koutput,
> + DRM_MODE_PROP_ENUM, "scaling mode");
>
> - props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
> - if (props) {
> - found = strcmp(props->name, "scaling mode") == 0;
> - drmModeFreeProperty(props);
> - }
> -
> - if (found)
> - return TRUE;
> - }
> -
> - return FALSE;
> + return (idx > -1) ? TRUE : FALSE;
> }
This can just be return (idx > -1). Fixed that up and merged the series:
remote: I: patch #184285 updated using rev 6abdb54a11dac4e8854ff94ecdcb90a14321ab31.
remote: E: failed to find patch for rev f44935cdb7321af242ce9f242975f096807b97f7.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
8d7f7e2426..f44935cdb7 master -> master
- ajax
More information about the xorg-devel
mailing list