NetBSD Problem Report #50090

From www@NetBSD.org  Sat Jul 25 23:23:31 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 79815A5858
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 25 Jul 2015 23:23:31 +0000 (UTC)
Message-Id: <20150725232330.0A7D4A6552@mollari.NetBSD.org>
Date: Sat, 25 Jul 2015 23:23:30 +0000 (UTC)
From: davshao@gmail.com
Reply-To: davshao@gmail.com
To: gnats-bugs@NetBSD.org
Subject: x11/xf86-video-intel fix build and enable functionality on newer DragonFly and FreeBSD
X-Send-Pr-Version: www-1.0

>Number:         50090
>Category:       pkg
>Synopsis:       x11/xf86-video-intel fix build and enable functionality on newer DragonFly and FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 25 23:25:00 +0000 2015
>Originator:     David Shao
>Release:        pkgsrc current
>Organization:
>Environment:
DragonFly  4.3-DEVELOPMENT DragonFly v4.2.2.123.g14929-DEVELOPMENT #10: Sat Jul 25 07:24:55 PDT 2015     xxxxx@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64

>Description:
On at least newer DragonFly and FreeBSD, and possibly maybe none of them, x11/xf86-video-intel cannot build due to a problem finding getline() in src/sna/kgem.c

kgem.c: In function 'cpu_cache_size':
kgem.c:996:10: error: implicit declaration of function 'getline' [-Werror=implicit-function-declaration]
   while (getline(&line, &len, file) != -1) {

Fortunately this has a fix in the Makefile that does not touch the original source code.

Unfortunately to actually make xf86-video-intel functional on newer DragonFly and probably FreeBSD, there is yet another patch from DragonFly dports / FreeBSD ports that will never be accepted by upstream.


>How-To-Repeat:

>Fix:
--- Makefile.orig	2015-05-28 19:59:23.000000000 -0700
+++ Makefile	2015-07-22 14:03:32.000000000 -0700
@@ -24,6 +24,10 @@
 CONFIGURE_ENV+=	DRIVER_MAN_SUFFIX=4
 .endif

+.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+CFLAGS+=	-D_WITH_GETLINE=1
+.endif
+
 BUILDLINK_API_DEPENDS.libdrm+=	libdrm>=2.4.7

 .include "../../x11/modular-xorg-server/buildlink3.mk"

$NetBSD$

--- src/intel_device.c.orig	2015-07-23 00:34:18.755727000 +0000
+++ src/intel_device.c
@@ -398,8 +398,13 @@ static int __intel_open_device__legacy(c
 		 pci->domain, pci->bus, pci->dev, pci->func);

 	ret = drmCheckModesettingSupported(id);
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+	if (ret || 1) {
+		if (xf86LoadKernelModule("i915kms"))
+#else
 	if (ret) {
 		if (xf86LoadKernelModule("i915"))
+#endif
 			ret = drmCheckModesettingSupported(id);
 		if (ret)
 			return -1;

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.