From nobody Fri Jan 19 19:24:46 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TGqLp2CnWz57CZ9; Fri, 19 Jan 2024 19:24:50 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TGqLp1jzHz4psZ; Fri, 19 Jan 2024 19:24:50 +0000 (UTC) (envelope-from jbeich@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705692290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7juZdns7Df0zVtrAYvrRUAAMVpffyd/YNlOrlaTBwBU=; b=j4lggMzgWAxkcFHOggrtHuPidClXqETFa5lj1aVSpLkb6MniyVVhB6vSgTSQfg75vGPyrn jSfa8JbhDfe4fKs70jkiImO4I364BbqwvoDkMOP2ELb9m0DhcWuRfEDk5ATmNVMbK9Cx1Y dlroUZs7dTWiTgcx31nMxGGYiaKumMwn3OmYkOSdqtXPLLGGcjcUbZc1etnCDEWAui41Gu reS6UkcCTgumGQ00KG2iZCDr1Ib3AaQdXr8dr4tarM7nOBqtzjpteIXx36SSj77zgoAuMC HU7psmZWl2v6Zn7YHJY002dHAJcbYqTFYvHNol1CXaZIuyltkFKEDn5uk0wDow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705692290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7juZdns7Df0zVtrAYvrRUAAMVpffyd/YNlOrlaTBwBU=; b=kXrjD41Uw6Cv/vz6/4gZVMd7NiiNUr+lsB1kJX3K/NWwd1466+P9AhbWSyZvN6l85rTqI7 om1GAzt4pnWMf8cQz65+hUJXaDGkIb/jskBLzGQJE20gN71RkROXuYf1BHX3pxJzbJHqfX nh9KfKPA4Ixzd5R2Gxbq72IdQXuPSCdV+/KgzWw3LTwiSO9UFc9d3o758v/Sytzt45iOdZ k7lHtHvWG209IDUZd/MfiBHW4XO3EbUM4nSOG1CDS+lifO8C04n0TEdW+TH2jWFplw1nmn MNCqp3wizxJC3qncAtWxDC+keV1b3U5u0Cq8+2rtPNmrhix5pwswe4P9Z/SmEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705692290; a=rsa-sha256; cv=none; b=bUQLRLFAAkOnC2q3ItOsKInwGCFZy1zBib/nAqtbSrE9b9y/az00PElbi7zoSQkouVVj7C I9U1I4mlsn2eNs40GLR0hcf7d+TQZ1CjuSioQjgQs999CbA/C0YjCvTIBNyumZFJ4YR8Gx oUKXeNoKdjPFh0TTLXW4xTuyJEHFbV2R6jGv8aIkNbgP363hmFT9JgaRgQ0mDb+D+GfUk/ O6yfUTDQwa0jFhQgGhv9apXZRZUKQBzeOrjBvg4qAlaTkygNIb3FHq8jv878Jovsg7y/DM RvMG9Biq47bfpQBnekPxvS2jQN9BNjbGCCql6fqmyk95yce2p56gPIhPRTDcGw== Received: by freefall.freebsd.org (Postfix, from userid 1354) id 2DBF1F850; Fri, 19 Jan 2024 19:24:50 +0000 (UTC) From: Jan Beich To: Rozhuk Ivan Cc: FreeBSD Hackers , FreeBSD Mailing List Subject: Re: kcmp implementation for mesa In-Reply-To: <20240119131047.6975f574@rimwks.local> (Rozhuk Ivan's message of "Fri, 19 Jan 2024 13:10:47 +0200") References: <20240119131047.6975f574@rimwks.local> Date: Fri, 19 Jan 2024 20:24:46 +0100 Message-ID: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain Rozhuk Ivan writes: > * The 2 fds can be different, even in systems with a single GPU, eg: if > * radv is initialized before radeonsi. > * > * This fd tracking is useful for buffer sharing because KMS/GEM handles are > * specific to a DRM file description, i.e. the same handle value may refer > * to different underlying BOs in different DRM file descriptions. > * As an example, if an app wants to use drmModeAddFB it'll need a KMS handle > * valid for its fd (== amdgpu_screen_winsys::fd). > * If both fds are identical, there's nothing to do: bo->u.real.kms_handle > * can be used directly (see amdgpu_bo_get_handle). > * If they're different, the BO has to be exported from the device fd as > * a dma-buf, then imported from the app fd as a KMS handle. Just FYI, some types of export/import dma-bufs may not work on FreeBSD due to https://github.com/freebsd/drm-kmod/issues/278 export/import ioctls are mainly used in Vulkan WSI while kcmp() is used in OpenGL drivers (iris, radeonsi, etc), so it's probobably only necessary between a Vulkan-based compositor (wlroots for Wayland, chamfer for X11) and an OpenGL client (web browsers, old or open source games, etc). How much of that requires emulating kcmp() is unclear to me.