NetBSD Problem Report #56452

From www@netbsd.org  Tue Oct 12 09:22:55 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 90C871A921F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 12 Oct 2021 09:22:55 +0000 (UTC)
Message-Id: <20211012092253.BF3A61A9239@mollari.NetBSD.org>
Date: Tue, 12 Oct 2021 09:22:53 +0000 (UTC)
From: rvp@SDF.ORG
Reply-To: rvp@SDF.ORG
To: gnats-bugs@NetBSD.org
Subject: MAKEDEV should also create /dev/dri/renderD* devices
X-Send-Pr-Version: www-1.0

>Number:         56452
>Category:       bin
>Synopsis:       MAKEDEV should also create /dev/dri/renderD* devices
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 12 09:25:00 +0000 2021
>Last-Modified:  Tue Oct 12 17:20:01 +0000 2021
>Originator:     RVP
>Release:        NetBSD/amd64 9.99.91
>Organization:
>Environment:
NetBSD x202e.localdomain 9.99.91 NetBSD 9.99.91 (MYKERNEL) #0: Tue Oct 12 08:12:37 UTC 2021  bld@x202e.localdomain:/usr/obj/sys/arch/amd64/compile/MYKERNEL amd64
>Description:
/dev/MAKEDEV drm0 drm1 etc., should also create the corresponding renderD*
devices. The mpv(1) manpage indicates that --vo=gpu,--vo=vaapi and/or
--hwdec=vaapi-copy uses these devices, and a ktrace does seem to bear
that out:

$ for f in $(ldd /usr/pkg/bin/mpv | awk '/ => / { print $3 }')
> do strings $f | fgrep dri/renderD && echo @$f
> done
/dev/dri/renderD%d
@/usr/pkg/lib/ffmpeg4/libavutil.so.56
/dev/dri/renderD
@/usr/pkg/lib/libva-drm.so.2

$ ktrace -di -tn mpv Coin\ Operated\ -\ Animated\ Short\ Film-5L4DQfVIcdg.mp4

$ kdump | fgrep /dev/dri/render
  4035   4245 mpv      NAMI  "/dev/dri/renderD128"
  4035   4245 mpv      NAMI  "/dev/dri/renderD128"
  4035   4245 mpv      NAMI  "/dev/dri/renderD129"
  4035   4245 mpv      NAMI  "/dev/dri/renderD129"
  4035   4245 mpv      NAMI  "/dev/dri/renderD130"
  4035   4245 mpv      NAMI  "/dev/dri/renderD130"
  4035   4245 mpv      NAMI  "/dev/dri/renderD131"
  4035   4245 mpv      NAMI  "/dev/dri/renderD131"
  4035   4245 mpv      NAMI  "/dev/dri/renderD128"
  4035   4245 mpv      NAMI  "/dev/dri/renderD128"
  4035   4245 mpv      NAMI  "/dev/dri/renderD129"
  4035   4245 mpv      NAMI  "/dev/dri/renderD129"
  4035   4245 mpv      NAMI  "/dev/dri/renderD130"
  4035   4245 mpv      NAMI  "/dev/dri/renderD130"
  4035   4245 mpv      NAMI  "/dev/dri/renderD131"
  4035   4245 mpv      NAMI  "/dev/dri/renderD131"
$ 

>How-To-Repeat:
As above.
>Fix:
--- MAKEDEV.orig	2021-09-25 10:41:03.000000000 +0000
+++ MAKEDEV	2021-10-09 15:10:28.776715810 +0000
@@ -1519,8 +1519,10 @@

 drm[0-9]*)
 	unit=${i#drm}
+	unit2=$((unit + 128))
 	makedir dri 755
 	mkdev dri/card$unit c 180 $unit 660
+	mkdev dri/renderD${unit2} c 180 ${unit2} 660
 	;;

 drvctl)

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56452 CVS commit: src/etc
Date: Tue, 12 Oct 2021 13:19:21 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Tue Oct 12 17:19:20 UTC 2021

 Modified Files:
 	src/etc: MAKEDEV.tmpl

 Log Message:
 PR/56452: RVP: MAKEDEV should also create /dev/dri/renderD* devices


 To generate a diff of this commit:
 cvs rdiff -u -r1.225 -r1.226 src/etc/MAKEDEV.tmpl

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

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.