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:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 25 23:25:00 +0000 2015
>Closed-Date:    Tue Oct 13 04:38:48 +0000 2020
>Last-Modified:  Tue Oct 13 04:40:00 +0000 2020
>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;

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 13 Oct 2020 04:38:48 +0000
State-Changed-Why:
Applied an updated version from freebsd ports. Thanks for the report.


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50090 CVS commit: pkgsrc/x11/xf86-video-intel
Date: Tue, 13 Oct 2020 04:38:30 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Tue Oct 13 04:38:30 UTC 2020

 Modified Files:
 	pkgsrc/x11/xf86-video-intel: distinfo
 Added Files:
 	pkgsrc/x11/xf86-video-intel/patches: patch-src_intel__device.c

 Log Message:
 xf86-video-intel: freebsd/dragonflybsd build fix. from freebsd ports.

 Inspired by an outdated patch in PR pkg/50090


 To generate a diff of this commit:
 cvs rdiff -u -r1.31 -r1.32 pkgsrc/x11/xf86-video-intel/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/x11/xf86-video-intel/patches/patch-src_intel__device.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.