From owner-freebsd-current@FreeBSD.ORG Mon Mar 23 23:28:55 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE8C064B; Mon, 23 Mar 2015 23:28:54 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9531CE8B; Mon, 23 Mar 2015 23:28:54 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0B1F41FE022; Tue, 24 Mar 2015 00:28:51 +0100 (CET) Message-ID: <5510A1E3.9040603@selasky.org> Date: Tue, 24 Mar 2015 00:29:39 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Sam Fourman Jr." , Alexander Kabaev Subject: Re: [Call for testers] DRM device-independent code update to Linux 3.8 (take #2) References: <54F636B3.90701@FreeBSD.org> <20150307111305.10d7678d@kan> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020405040306080001000506" Cc: Konstantin Belousov , freebsd-x11 , FreeBSD Current , Ed Maste , =?windows-1252?Q?Jean-S=E9bastien_P=E9dron?= X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 23:28:55 -0000 This is a multi-part message in MIME format. --------------020405040306080001000506 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi, Without the attached kernel patch(es), Xorg starts consuming alot of CPU and becomes very unresponsive and unusable. Using ktrace reveals that X-org is issuing DRM_IOCTL_MODE_GETCONNECTOR over and over again with no apparent reason. It doesn't happen when using a simple window manager like blackbox. I was not able to use XFCE4 (9-stable userland) with 11-current kernel at all, after the latest DRM2 kernel updates. It worked fine before the update. I'm not sure what is causing it. Going through the new DRM2 code revealed that a mode sorting function did not take all parameters like interlaced or not into account, causing the mode list to be reshuffelled every time a new mode scan was done. Not sure if Xorg cares about this though. I can test patches if you have other suggestions. --HPS --------------020405040306080001000506 Content-Type: text/x-diff; name="drm_patches.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="drm_patches.diff" diff --git a/sys/dev/drm2/drm_crtc.c b/sys/dev/drm2/drm_crtc.c index 318a764..d368e83 100644 --- a/sys/dev/drm2/drm_crtc.c +++ b/sys/dev/drm2/drm_crtc.c @@ -1499,15 +1499,18 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, } } - if (out_resp->count_modes == 0) { + list_for_each_entry(mode, &connector->modes, head) + mode_count++; + + if (mode_count == 0) { connector->funcs->fill_modes(connector, dev->mode_config.max_width, dev->mode_config.max_height); - } - /* delayed so we get modes regardless of pre-fill_modes state */ - list_for_each_entry(mode, &connector->modes, head) - mode_count++; + /* delayed so we get modes regardless of pre-fill_modes state */ + list_for_each_entry(mode, &connector->modes, head) + mode_count++; + } out_resp->connector_id = connector->base.id; out_resp->connector_type = connector->connector_type; diff --git a/sys/dev/drm2/drm_modes.c b/sys/dev/drm2/drm_modes.c index 4df8cb1..db06176 100644 --- a/sys/dev/drm2/drm_modes.c +++ b/sys/dev/drm2/drm_modes.c @@ -928,6 +928,10 @@ static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head if (diff) return diff; diff = b->clock - a->clock; + if (diff) + return diff; + diff = ((b->flags & DRM_MODE_FLAG_INTERLACE) != 0) - + ((a->flags & DRM_MODE_FLAG_INTERLACE) != 0); return diff; } --------------020405040306080001000506--