Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Thu, Feb 22, 2018 at 04:16:52PM -0500, Alex Deucher wrote: > On Thu, Feb 22, 2018 at 1:49 PM, Bas Nieuwenhuizen >wrote: > > On Thu, Feb 22, 2018 at 7:04 PM, Kristian H??gsberg > > wrote: > >> On Wed, Feb 21, 2018 at 4:00 PM Alex Deucher wrote: > >> > >>> On Wed, Feb 21, 2018 at 1:14 AM, Chad Versace > >> wrote: > >>> > On Thu 21 Dec 2017, Daniel Vetter wrote: > >>> >> On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen < > >> hoegsb...@google.com> wrote: > >>> >>> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico < > >> mvicom...@nvidia.com> wrote: > >>> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian H??gsberg < > >> hoegsb...@gmail.com> wrote: > >>> > I'd like to see concrete examples of actual display controllers > >>> > supporting more format layouts than what can be specified with a 64 > >>> > bit modifier. > >>> > >>> The main problem is our tiling and other metadata parameters can't > >>> generally fit in a modifier, so we find passing a blob of metadata a > >>> more suitable mechanism. > >>> >>> > >>> >>> I understand that you may have n knobs with a total of more than a > >> total of > >>> >>> 56 bits that configure your tiling/swizzling for color buffers. What > >> I don't > >>> >>> buy is that you need all those combinations when passing buffers > >> around > >>> >>> between codecs, cameras and display controllers. Even if you're > >> sharing > >>> >>> between the same 3D drivers in different processes, I expect just > >> locking > >>> >>> down, say, 64 different combinations (you can add more over time) and > >>> >>> assigning each a modifier would be sufficient. I doubt you'd extract > >>> >>> meaningful performance gains from going all the way to a blob. > >>> > > >>> > I agree with Kristian above. In my opinion, choosing to encode in > >>> > modifiers a precise description of every possible tiling/compression > >>> > layout is not technically incorrect, but I believe it misses the point. > >>> > The intention behind modifiers is not to exhaustively describe all > >>> > possibilites. > >>> > > >>> > I summarized this opinion in VK_EXT_image_drm_format_modifier, > >>> > where I wrote an "introdution to modifiers" section. Here's an excerpt: > >>> > > >>> > One goal of modifiers in the Linux ecosystem is to enumerate for > >> each > >>> > vendor a reasonably sized set of tiling formats that are > >> appropriate for > >>> > images shared across processes, APIs, and/or devices, where each > >>> > participating component may possibly be from different vendors. > >>> > A non-goal is to enumerate all tiling formats supported by all > >> vendors. > >>> > Some tiling formats used internally by vendors are inappropriate for > >>> > sharing; no modifiers should be assigned to such tiling formats. > >> > >>> Where it gets tricky is how to select that subset? Our tiling mode > >>> are defined more by the asic specific constraints than the tiling mode > >>> itself. At a high level we have basically 3 tiling modes (out of 16 > >>> possible) that would be the minimum we'd want to expose for gfx6-8. > >>> gfx9 uses a completely new scheme. > >>> 1. Linear (per asic stride requirements, not usable by many hw blocks) > >>> 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) > >>> 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), > >>> tile split (7 possible), sample split (4 possible), num banks (4 > >>> possible), bank width (4 possible), bank height (4 possible), macro > >>> tile aspect (4 possible) all of which are asic config specific) > >> > >>> I guess we could do something like: > >>> AMD_GFX6_LINEAR_ALIGNED_64B > >>> AMD_GFX6_LINEAR_ALIGNED_256B > >>> AMD_GFX6_LINEAR_ALIGNED_512B > >>> AMD_GFX6_1D_THIN_DISPLAY > >>> AMD_GFX6_1D_THIN_DEPTH > >>> AMD_GFX6_1D_THIN_ROTATED > >>> AMD_GFX6_1D_THIN_THIN > >>> AMD_GFX6_1D_THIN_THICK > >> > >> AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > >> > >> AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > >> > >> AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > >> > >> AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > >> > >> AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > >> > >> AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > >> > >> AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On 02/22/2018 01:16 PM, Alex Deucher wrote: On Thu, Feb 22, 2018 at 1:49 PM, Bas Nieuwenhuizenwrote: On Thu, Feb 22, 2018 at 7:04 PM, Kristian Høgsberg wrote: On Wed, Feb 21, 2018 at 4:00 PM Alex Deucher wrote: On Wed, Feb 21, 2018 at 1:14 AM, Chad Versace wrote: On Thu 21 Dec 2017, Daniel Vetter wrote: On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen < hoegsb...@google.com> wrote: On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico < mvicom...@nvidia.com> wrote: On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg < hoegsb...@gmail.com> wrote: I'd like to see concrete examples of actual display controllers supporting more format layouts than what can be specified with a 64 bit modifier. The main problem is our tiling and other metadata parameters can't generally fit in a modifier, so we find passing a blob of metadata a more suitable mechanism. I understand that you may have n knobs with a total of more than a total of 56 bits that configure your tiling/swizzling for color buffers. What I don't buy is that you need all those combinations when passing buffers around between codecs, cameras and display controllers. Even if you're sharing between the same 3D drivers in different processes, I expect just locking down, say, 64 different combinations (you can add more over time) and assigning each a modifier would be sufficient. I doubt you'd extract meaningful performance gains from going all the way to a blob. I agree with Kristian above. In my opinion, choosing to encode in modifiers a precise description of every possible tiling/compression layout is not technically incorrect, but I believe it misses the point. The intention behind modifiers is not to exhaustively describe all possibilites. I summarized this opinion in VK_EXT_image_drm_format_modifier, where I wrote an "introdution to modifiers" section. Here's an excerpt: One goal of modifiers in the Linux ecosystem is to enumerate for each vendor a reasonably sized set of tiling formats that are appropriate for images shared across processes, APIs, and/or devices, where each participating component may possibly be from different vendors. A non-goal is to enumerate all tiling formats supported by all vendors. Some tiling formats used internally by vendors are inappropriate for sharing; no modifiers should be assigned to such tiling formats. Where it gets tricky is how to select that subset? Our tiling mode are defined more by the asic specific constraints than the tiling mode itself. At a high level we have basically 3 tiling modes (out of 16 possible) that would be the minimum we'd want to expose for gfx6-8. gfx9 uses a completely new scheme. 1. Linear (per asic stride requirements, not usable by many hw blocks) 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), tile split (7 possible), sample split (4 possible), num banks (4 possible), bank width (4 possible), bank height (4 possible), macro tile aspect (4 possible) all of which are asic config specific) I guess we could do something like: AMD_GFX6_LINEAR_ALIGNED_64B AMD_GFX6_LINEAR_ALIGNED_256B AMD_GFX6_LINEAR_ALIGNED_512B AMD_GFX6_1D_THIN_DISPLAY AMD_GFX6_1D_THIN_DEPTH AMD_GFX6_1D_THIN_ROTATED AMD_GFX6_1D_THIN_THIN AMD_GFX6_1D_THIN_THICK AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 etc. We only probably need 40 bits to encode all of the tiling parameters so we could do family, plus tiling encoding that still seems unwieldy to deal with from an application
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Thu, Feb 22, 2018 at 1:49 PM, Bas Nieuwenhuizenwrote: > On Thu, Feb 22, 2018 at 7:04 PM, Kristian Høgsberg > wrote: >> On Wed, Feb 21, 2018 at 4:00 PM Alex Deucher wrote: >> >>> On Wed, Feb 21, 2018 at 1:14 AM, Chad Versace >> wrote: >>> > On Thu 21 Dec 2017, Daniel Vetter wrote: >>> >> On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen < >> hoegsb...@google.com> wrote: >>> >>> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico < >> mvicom...@nvidia.com> wrote: >>> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg < >> hoegsb...@gmail.com> wrote: >>> > I'd like to see concrete examples of actual display controllers >>> > supporting more format layouts than what can be specified with a 64 >>> > bit modifier. >>> >>> The main problem is our tiling and other metadata parameters can't >>> generally fit in a modifier, so we find passing a blob of metadata a >>> more suitable mechanism. >>> >>> >>> >>> I understand that you may have n knobs with a total of more than a >> total of >>> >>> 56 bits that configure your tiling/swizzling for color buffers. What >> I don't >>> >>> buy is that you need all those combinations when passing buffers >> around >>> >>> between codecs, cameras and display controllers. Even if you're >> sharing >>> >>> between the same 3D drivers in different processes, I expect just >> locking >>> >>> down, say, 64 different combinations (you can add more over time) and >>> >>> assigning each a modifier would be sufficient. I doubt you'd extract >>> >>> meaningful performance gains from going all the way to a blob. >>> > >>> > I agree with Kristian above. In my opinion, choosing to encode in >>> > modifiers a precise description of every possible tiling/compression >>> > layout is not technically incorrect, but I believe it misses the point. >>> > The intention behind modifiers is not to exhaustively describe all >>> > possibilites. >>> > >>> > I summarized this opinion in VK_EXT_image_drm_format_modifier, >>> > where I wrote an "introdution to modifiers" section. Here's an excerpt: >>> > >>> > One goal of modifiers in the Linux ecosystem is to enumerate for >> each >>> > vendor a reasonably sized set of tiling formats that are >> appropriate for >>> > images shared across processes, APIs, and/or devices, where each >>> > participating component may possibly be from different vendors. >>> > A non-goal is to enumerate all tiling formats supported by all >> vendors. >>> > Some tiling formats used internally by vendors are inappropriate for >>> > sharing; no modifiers should be assigned to such tiling formats. >> >>> Where it gets tricky is how to select that subset? Our tiling mode >>> are defined more by the asic specific constraints than the tiling mode >>> itself. At a high level we have basically 3 tiling modes (out of 16 >>> possible) that would be the minimum we'd want to expose for gfx6-8. >>> gfx9 uses a completely new scheme. >>> 1. Linear (per asic stride requirements, not usable by many hw blocks) >>> 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) >>> 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), >>> tile split (7 possible), sample split (4 possible), num banks (4 >>> possible), bank width (4 possible), bank height (4 possible), macro >>> tile aspect (4 possible) all of which are asic config specific) >> >>> I guess we could do something like: >>> AMD_GFX6_LINEAR_ALIGNED_64B >>> AMD_GFX6_LINEAR_ALIGNED_256B >>> AMD_GFX6_LINEAR_ALIGNED_512B >>> AMD_GFX6_1D_THIN_DISPLAY >>> AMD_GFX6_1D_THIN_DEPTH >>> AMD_GFX6_1D_THIN_ROTATED >>> AMD_GFX6_1D_THIN_THIN >>> AMD_GFX6_1D_THIN_THICK >> >> AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >> AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> >>
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
Kristian Høgsbergwrites: > On Wed, Feb 21, 2018 at 4:00 PM Alex Deucher wrote: > >> On Wed, Feb 21, 2018 at 1:14 AM, Chad Versace > wrote: >> > On Thu 21 Dec 2017, Daniel Vetter wrote: >> >> On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen < > hoegsb...@google.com> wrote: >> >>> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico < > mvicom...@nvidia.com> wrote: >> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg < > hoegsb...@gmail.com> wrote: >> > I'd like to see concrete examples of actual display controllers >> > supporting more format layouts than what can be specified with a 64 >> > bit modifier. >> >> The main problem is our tiling and other metadata parameters can't >> generally fit in a modifier, so we find passing a blob of metadata a >> more suitable mechanism. >> >>> >> >>> I understand that you may have n knobs with a total of more than a > total of >> >>> 56 bits that configure your tiling/swizzling for color buffers. What > I don't >> >>> buy is that you need all those combinations when passing buffers > around >> >>> between codecs, cameras and display controllers. Even if you're > sharing >> >>> between the same 3D drivers in different processes, I expect just > locking >> >>> down, say, 64 different combinations (you can add more over time) and >> >>> assigning each a modifier would be sufficient. I doubt you'd extract >> >>> meaningful performance gains from going all the way to a blob. >> > >> > I agree with Kristian above. In my opinion, choosing to encode in >> > modifiers a precise description of every possible tiling/compression >> > layout is not technically incorrect, but I believe it misses the point. >> > The intention behind modifiers is not to exhaustively describe all >> > possibilites. >> > >> > I summarized this opinion in VK_EXT_image_drm_format_modifier, >> > where I wrote an "introdution to modifiers" section. Here's an excerpt: >> > >> > One goal of modifiers in the Linux ecosystem is to enumerate for > each >> > vendor a reasonably sized set of tiling formats that are > appropriate for >> > images shared across processes, APIs, and/or devices, where each >> > participating component may possibly be from different vendors. >> > A non-goal is to enumerate all tiling formats supported by all > vendors. >> > Some tiling formats used internally by vendors are inappropriate for >> > sharing; no modifiers should be assigned to such tiling formats. > >> Where it gets tricky is how to select that subset? Our tiling mode >> are defined more by the asic specific constraints than the tiling mode >> itself. At a high level we have basically 3 tiling modes (out of 16 >> possible) that would be the minimum we'd want to expose for gfx6-8. >> gfx9 uses a completely new scheme. >> 1. Linear (per asic stride requirements, not usable by many hw blocks) >> 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) >> 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), >> tile split (7 possible), sample split (4 possible), num banks (4 >> possible), bank width (4 possible), bank height (4 possible), macro >> tile aspect (4 possible) all of which are asic config specific) > >> I guess we could do something like: >> AMD_GFX6_LINEAR_ALIGNED_64B >> AMD_GFX6_LINEAR_ALIGNED_256B >> AMD_GFX6_LINEAR_ALIGNED_512B >> AMD_GFX6_1D_THIN_DISPLAY >> AMD_GFX6_1D_THIN_DEPTH >> AMD_GFX6_1D_THIN_ROTATED >> AMD_GFX6_1D_THIN_THIN >> AMD_GFX6_1D_THIN_THICK > > AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> etc. > >> We only probably need 40 bits
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Thu, Feb 22, 2018 at 7:04 PM, Kristian Høgsbergwrote: > On Wed, Feb 21, 2018 at 4:00 PM Alex Deucher wrote: > >> On Wed, Feb 21, 2018 at 1:14 AM, Chad Versace > wrote: >> > On Thu 21 Dec 2017, Daniel Vetter wrote: >> >> On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen < > hoegsb...@google.com> wrote: >> >>> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico < > mvicom...@nvidia.com> wrote: >> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg < > hoegsb...@gmail.com> wrote: >> > I'd like to see concrete examples of actual display controllers >> > supporting more format layouts than what can be specified with a 64 >> > bit modifier. >> >> The main problem is our tiling and other metadata parameters can't >> generally fit in a modifier, so we find passing a blob of metadata a >> more suitable mechanism. >> >>> >> >>> I understand that you may have n knobs with a total of more than a > total of >> >>> 56 bits that configure your tiling/swizzling for color buffers. What > I don't >> >>> buy is that you need all those combinations when passing buffers > around >> >>> between codecs, cameras and display controllers. Even if you're > sharing >> >>> between the same 3D drivers in different processes, I expect just > locking >> >>> down, say, 64 different combinations (you can add more over time) and >> >>> assigning each a modifier would be sufficient. I doubt you'd extract >> >>> meaningful performance gains from going all the way to a blob. >> > >> > I agree with Kristian above. In my opinion, choosing to encode in >> > modifiers a precise description of every possible tiling/compression >> > layout is not technically incorrect, but I believe it misses the point. >> > The intention behind modifiers is not to exhaustively describe all >> > possibilites. >> > >> > I summarized this opinion in VK_EXT_image_drm_format_modifier, >> > where I wrote an "introdution to modifiers" section. Here's an excerpt: >> > >> > One goal of modifiers in the Linux ecosystem is to enumerate for > each >> > vendor a reasonably sized set of tiling formats that are > appropriate for >> > images shared across processes, APIs, and/or devices, where each >> > participating component may possibly be from different vendors. >> > A non-goal is to enumerate all tiling formats supported by all > vendors. >> > Some tiling formats used internally by vendors are inappropriate for >> > sharing; no modifiers should be assigned to such tiling formats. > >> Where it gets tricky is how to select that subset? Our tiling mode >> are defined more by the asic specific constraints than the tiling mode >> itself. At a high level we have basically 3 tiling modes (out of 16 >> possible) that would be the minimum we'd want to expose for gfx6-8. >> gfx9 uses a completely new scheme. >> 1. Linear (per asic stride requirements, not usable by many hw blocks) >> 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) >> 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), >> tile split (7 possible), sample split (4 possible), num banks (4 >> possible), bank width (4 possible), bank height (4 possible), macro >> tile aspect (4 possible) all of which are asic config specific) > >> I guess we could do something like: >> AMD_GFX6_LINEAR_ALIGNED_64B >> AMD_GFX6_LINEAR_ALIGNED_256B >> AMD_GFX6_LINEAR_ALIGNED_512B >> AMD_GFX6_1D_THIN_DISPLAY >> AMD_GFX6_1D_THIN_DEPTH >> AMD_GFX6_1D_THIN_ROTATED >> AMD_GFX6_1D_THIN_THIN >> AMD_GFX6_1D_THIN_THICK > > AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > > AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 >> etc. >
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Wed, Feb 21, 2018 at 4:00 PM Alex Deucherwrote: > On Wed, Feb 21, 2018 at 1:14 AM, Chad Versace wrote: > > On Thu 21 Dec 2017, Daniel Vetter wrote: > >> On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen < hoegsb...@google.com> wrote: > >>> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico < mvicom...@nvidia.com> wrote: > On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg < hoegsb...@gmail.com> wrote: > > I'd like to see concrete examples of actual display controllers > > supporting more format layouts than what can be specified with a 64 > > bit modifier. > > The main problem is our tiling and other metadata parameters can't > generally fit in a modifier, so we find passing a blob of metadata a > more suitable mechanism. > >>> > >>> I understand that you may have n knobs with a total of more than a total of > >>> 56 bits that configure your tiling/swizzling for color buffers. What I don't > >>> buy is that you need all those combinations when passing buffers around > >>> between codecs, cameras and display controllers. Even if you're sharing > >>> between the same 3D drivers in different processes, I expect just locking > >>> down, say, 64 different combinations (you can add more over time) and > >>> assigning each a modifier would be sufficient. I doubt you'd extract > >>> meaningful performance gains from going all the way to a blob. > > > > I agree with Kristian above. In my opinion, choosing to encode in > > modifiers a precise description of every possible tiling/compression > > layout is not technically incorrect, but I believe it misses the point. > > The intention behind modifiers is not to exhaustively describe all > > possibilites. > > > > I summarized this opinion in VK_EXT_image_drm_format_modifier, > > where I wrote an "introdution to modifiers" section. Here's an excerpt: > > > > One goal of modifiers in the Linux ecosystem is to enumerate for each > > vendor a reasonably sized set of tiling formats that are appropriate for > > images shared across processes, APIs, and/or devices, where each > > participating component may possibly be from different vendors. > > A non-goal is to enumerate all tiling formats supported by all vendors. > > Some tiling formats used internally by vendors are inappropriate for > > sharing; no modifiers should be assigned to such tiling formats. > Where it gets tricky is how to select that subset? Our tiling mode > are defined more by the asic specific constraints than the tiling mode > itself. At a high level we have basically 3 tiling modes (out of 16 > possible) that would be the minimum we'd want to expose for gfx6-8. > gfx9 uses a completely new scheme. > 1. Linear (per asic stride requirements, not usable by many hw blocks) > 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) > 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), > tile split (7 possible), sample split (4 possible), num banks (4 > possible), bank width (4 possible), bank height (4 possible), macro > tile aspect (4 possible) all of which are asic config specific) > I guess we could do something like: > AMD_GFX6_LINEAR_ALIGNED_64B > AMD_GFX6_LINEAR_ALIGNED_256B > AMD_GFX6_LINEAR_ALIGNED_512B > AMD_GFX6_1D_THIN_DISPLAY > AMD_GFX6_1D_THIN_DEPTH > AMD_GFX6_1D_THIN_ROTATED > AMD_GFX6_1D_THIN_THIN > AMD_GFX6_1D_THIN_THICK AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 > etc. > We only probably need 40 bits to encode all of the tiling parameters > so we could do family, plus tiling encoding that still seems unwieldy > to deal with from an application perspective. All of
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Wed, Feb 21, 2018 at 1:14 AM, Chad Versacewrote: > On Thu 21 Dec 2017, Daniel Vetter wrote: >> On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen >> wrote: >>> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico >>> wrote: On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg wrote: > I'd like to see concrete examples of actual display controllers > supporting more format layouts than what can be specified with a 64 > bit modifier. The main problem is our tiling and other metadata parameters can't generally fit in a modifier, so we find passing a blob of metadata a more suitable mechanism. >>> >>> I understand that you may have n knobs with a total of more than a total of >>> 56 bits that configure your tiling/swizzling for color buffers. What I don't >>> buy is that you need all those combinations when passing buffers around >>> between codecs, cameras and display controllers. Even if you're sharing >>> between the same 3D drivers in different processes, I expect just locking >>> down, say, 64 different combinations (you can add more over time) and >>> assigning each a modifier would be sufficient. I doubt you'd extract >>> meaningful performance gains from going all the way to a blob. > > I agree with Kristian above. In my opinion, choosing to encode in > modifiers a precise description of every possible tiling/compression > layout is not technically incorrect, but I believe it misses the point. > The intention behind modifiers is not to exhaustively describe all > possibilites. > > I summarized this opinion in VK_EXT_image_drm_format_modifier, > where I wrote an "introdution to modifiers" section. Here's an excerpt: > > One goal of modifiers in the Linux ecosystem is to enumerate for each > vendor a reasonably sized set of tiling formats that are appropriate for > images shared across processes, APIs, and/or devices, where each > participating component may possibly be from different vendors. > A non-goal is to enumerate all tiling formats supported by all vendors. > Some tiling formats used internally by vendors are inappropriate for > sharing; no modifiers should be assigned to such tiling formats. Where it gets tricky is how to select that subset? Our tiling mode are defined more by the asic specific constraints than the tiling mode itself. At a high level we have basically 3 tiling modes (out of 16 possible) that would be the minimum we'd want to expose for gfx6-8. gfx9 uses a completely new scheme. 1. Linear (per asic stride requirements, not usable by many hw blocks) 2. 1D Thin (5 layouts, displayable, depth, thin, rotated, thick) 3. 2D Thin (1D tiling constraints, plus pipe config (18 possible), tile split (7 possible), sample split (4 possible), num banks (4 possible), bank width (4 possible), bank height (4 possible), macro tile aspect (4 possible) all of which are asic config specific) I guess we could do something like: AMD_GFX6_LINEAR_ALIGNED_64B AMD_GFX6_LINEAR_ALIGNED_256B AMD_GFX6_LINEAR_ALIGNED_512B AMD_GFX6_1D_THIN_DISPLAY AMD_GFX6_1D_THIN_DEPTH AMD_GFX6_1D_THIN_ROTATED AMD_GFX6_1D_THIN_THIN AMD_GFX6_1D_THIN_THICK AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P2_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DISPLAY_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_DEPTH_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_ROTATED_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THIN_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 AMD_GFX6_2D_1D_THIN_THICK_PIPE_CONFIG_P4_8x16_TILE_SPLIT_64B_SAMPLE_SPLIT_1_NUM_BANKS_2_BANK_WIDTH_1_BANK_HEIGHT_1_MACRO_TILE_ASPECT_1 etc. We only probably need 40 bits to encode all of the tiling parameters so we could do family, plus tiling encoding that still seems unwieldy to deal with from an application perspective. All of the parameters affect the alignment requirements. Alex ___ dri-devel mailing list dri-devel@lists.freedesktop.org
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Wed 21 Feb 2018, Daniel Vetter wrote: > On Tue, Feb 20, 2018 at 10:14:47PM -0800, Chad Versace wrote: > > On Thu 21 Dec 2017, Daniel Vetter wrote: > > > On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen > > >wrote: > > >> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico > > >> wrote: > > >>> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg > > >>> wrote: > > I'd like to see concrete examples of actual display controllers > > supporting more format layouts than what can be specified with a 64 > > bit modifier. > > >>> > > >>> The main problem is our tiling and other metadata parameters can't > > >>> generally fit in a modifier, so we find passing a blob of metadata a > > >>> more suitable mechanism. > > >> > > >> I understand that you may have n knobs with a total of more than a total > > >> of > > >> 56 bits that configure your tiling/swizzling for color buffers. What I > > >> don't > > >> buy is that you need all those combinations when passing buffers around > > >> between codecs, cameras and display controllers. Even if you're sharing > > >> between the same 3D drivers in different processes, I expect just locking > > >> down, say, 64 different combinations (you can add more over time) and > > >> assigning each a modifier would be sufficient. I doubt you'd extract > > >> meaningful performance gains from going all the way to a blob. > > > > I agree with Kristian above. In my opinion, choosing to encode in > > modifiers a precise description of every possible tiling/compression > > layout is not technically incorrect, but I believe it misses the point. > > The intention behind modifiers is not to exhaustively describe all > > possibilites. > > > > I summarized this opinion in VK_EXT_image_drm_format_modifier, > > where I wrote an "introdution to modifiers" section. Here's an excerpt: > > > > One goal of modifiers in the Linux ecosystem is to enumerate for each > > vendor a reasonably sized set of tiling formats that are appropriate for > > images shared across processes, APIs, and/or devices, where each > > participating component may possibly be from different vendors. > > A non-goal is to enumerate all tiling formats supported by all vendors. > > Some tiling formats used internally by vendors are inappropriate for > > sharing; no modifiers should be assigned to such tiling formats. > > fwiw (since the source of truth wrt modifiers is the kernel's uapi > header): > > Acked-by: Daniel Vetter Linux would eventually encounter big problems if the kernel and Vulkan disagreed on the fundamental, unspoken Theory of Modifiers. So your acked-by is definitely worth something here. Thanks for confirming. > > I'm happy to merge modifier #define additions for pretty much anything > where there's a need for sharing across devices/drivers/apis, explicitly > including stuff that's only relevant for userspace and which the kernel > nevers sees (in e.g. a kms addfb2 call). Trying to preemptively enumerate > everything that's possible doesn't seem like a wise idea. But even then we > can probably spare the oddball vendor prefix is a driver team really > insists that this is what they want, best using some code that makes the > case for them. Yep. I believe Jason Ekstrand has tentative plans for such a modifier that improves performance for interop in GL and Vulkan but the kernel and Intel display hw wouldn't understand: a modifier for CCS_E images that are fully compressed. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Tue, Feb 20, 2018 at 10:14:47PM -0800, Chad Versace wrote: > On Thu 21 Dec 2017, Daniel Vetter wrote: > > On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen > >wrote: > >> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico > >> wrote: > >>> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg > >>> wrote: > I'd like to see concrete examples of actual display controllers > supporting more format layouts than what can be specified with a 64 > bit modifier. > >>> > >>> The main problem is our tiling and other metadata parameters can't > >>> generally fit in a modifier, so we find passing a blob of metadata a > >>> more suitable mechanism. > >> > >> I understand that you may have n knobs with a total of more than a total of > >> 56 bits that configure your tiling/swizzling for color buffers. What I > >> don't > >> buy is that you need all those combinations when passing buffers around > >> between codecs, cameras and display controllers. Even if you're sharing > >> between the same 3D drivers in different processes, I expect just locking > >> down, say, 64 different combinations (you can add more over time) and > >> assigning each a modifier would be sufficient. I doubt you'd extract > >> meaningful performance gains from going all the way to a blob. > > I agree with Kristian above. In my opinion, choosing to encode in > modifiers a precise description of every possible tiling/compression > layout is not technically incorrect, but I believe it misses the point. > The intention behind modifiers is not to exhaustively describe all > possibilites. > > I summarized this opinion in VK_EXT_image_drm_format_modifier, > where I wrote an "introdution to modifiers" section. Here's an excerpt: > > One goal of modifiers in the Linux ecosystem is to enumerate for each > vendor a reasonably sized set of tiling formats that are appropriate for > images shared across processes, APIs, and/or devices, where each > participating component may possibly be from different vendors. > A non-goal is to enumerate all tiling formats supported by all vendors. > Some tiling formats used internally by vendors are inappropriate for > sharing; no modifiers should be assigned to such tiling formats. fwiw (since the source of truth wrt modifiers is the kernel's uapi header): Acked-by: Daniel Vetter I'm happy to merge modifier #define additions for pretty much anything where there's a need for sharing across devices/drivers/apis, explicitly including stuff that's only relevant for userspace and which the kernel nevers sees (in e.g. a kms addfb2 call). Trying to preemptively enumerate everything that's possible doesn't seem like a wise idea. But even then we can probably spare the oddball vendor prefix is a driver team really insists that this is what they want, best using some code that makes the case for them. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Thu 21 Dec 2017, Daniel Vetter wrote: > On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensen> wrote: >> On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico >> wrote: >>> On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsberg >>> wrote: I'd like to see concrete examples of actual display controllers supporting more format layouts than what can be specified with a 64 bit modifier. >>> >>> The main problem is our tiling and other metadata parameters can't >>> generally fit in a modifier, so we find passing a blob of metadata a >>> more suitable mechanism. >> >> I understand that you may have n knobs with a total of more than a total of >> 56 bits that configure your tiling/swizzling for color buffers. What I don't >> buy is that you need all those combinations when passing buffers around >> between codecs, cameras and display controllers. Even if you're sharing >> between the same 3D drivers in different processes, I expect just locking >> down, say, 64 different combinations (you can add more over time) and >> assigning each a modifier would be sufficient. I doubt you'd extract >> meaningful performance gains from going all the way to a blob. I agree with Kristian above. In my opinion, choosing to encode in modifiers a precise description of every possible tiling/compression layout is not technically incorrect, but I believe it misses the point. The intention behind modifiers is not to exhaustively describe all possibilites. I summarized this opinion in VK_EXT_image_drm_format_modifier, where I wrote an "introdution to modifiers" section. Here's an excerpt: One goal of modifiers in the Linux ecosystem is to enumerate for each vendor a reasonably sized set of tiling formats that are appropriate for images shared across processes, APIs, and/or devices, where each participating component may possibly be from different vendors. A non-goal is to enumerate all tiling formats supported by all vendors. Some tiling formats used internally by vendors are inappropriate for sharing; no modifiers should be assigned to such tiling formats. > Tegra just redesigned it's modifier space from an ungodly amount of > bits to just a few layouts. Not even just the ones in used, but simply > limiting to the ones that make sense (there's dependencies apparently) > Also note that the modifier alone doesn't need to describe the layout > precisely, it only makes sense together with a specific pixel format > and size. E.g. a bunch of the i915 layouts change layout depending > upon bpp. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
Just wanted to clarify this one thing here, otherwise I think Rob/krh covered it all. On Thu, Dec 28, 2017 at 10:24:38AM -0800, Miguel Angel Vico wrote: > Daniel Vetter wrote: > > I think in the interim figuring out how to expose kms capabilities > > better (and necessarily standardizing at least some of them which > > matter at the compositor level, like size limits of framebuffers) > > feels like the place to push the ecosystem forward. In some way > > Miguel's proposal looks a bit backwards, since it adds the pitch > > capabilities to addfb, but at addfb time you've allocated everything > > already, so way too late to fix things up. With modifiers we've added > > a very simple per-plane property to list which modifiers can be > > combined with which pixel formats. Tiny start, but obviously very far > > from all that we'll need. > > Not sure whether I might be misunderstanding your statement, but one of > the allocator main features is negotiation of nearly optimal allocation > parameters given a set of uses on different devices/engines by the > capability merge operation. A client should have queried what every > device/engine is capable of for the given uses, find the optimal set of > capabilities, and use it for allocating a buffer. At the moment these > parameters are given to KMS, they are expected to be good. If they > aren't, the client didn't do things right. Your example code has a new capability for PITCH_ALIGNMENT. That looks wrong for addfb (which should only received the the computed intersection of all requirements, not the requirements itself). And since that was the only thing in your example code besides the bare boilerplate to wire it all up it looks a bit confused. Maybe we need to distinguish capabilities into constraints on properties (like pitch alignment, or power-of-two pitch) and properties (like pitch) themselves. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On 12/28/2017 10:24 AM, Miguel Angel Vico wrote: (Adding dri-devel back, and trying to respond to some comments from the different forks) James Jones wrote: Your worst case analysis above isn't far off from our HW, give or take some bits and axes here and there. We've started an internal discussion about how to lay out all the bits we need. It's hard to even enumerate them all without having a complete understanding of what capability sets are going to include, a fully-optimized implementation of the mechanism on our HW, and lot's of test scenarios though. (thanks James for most of the info below) To elaborate a bit, if we want to share an allocation across GPUs for 3D rendering, it seems we would need 12 bits to express our swizzling/tiling memory layouts for fermi+. In addition to that, maxwell uses 3 more bits for this, and we need an extra bit to identify pre-fermi representations. We also need one bit to differentiate between Tegra and desktop, and another one to indicate whether the layout is otherwise linear. Then things like whether compression is used (one more bit), and we can probably get by with 3 bits for the type of compression if we are creative. However, it'd be way easier to just track arch + page kind, which would be like 32 bits on its own. Not clear if this is an NV-only term, so for those not familiar, page kind is very loosely the equivalent of a format modifier our HW uses internally in its memory management subsystem. The value mappings vary a bit for each HW generation. Whether Z-culling and/or zero-bandwidth-clears are used may be another 3 bits. If device-local properties are included, we might need a couple more bits for caching. We may also need to express locality information, which may take at least another 2 or 3 bits. If we want to share array textures too, you also need to pass the array pitch. Is it supposed to be encoded in a modifier too? That's 64 bits on its own. So yes, as James mentioned, with some effort, we could technically fit our current allocation parameters in a modifier, but I'm still not convinced this is as future proof as it could be as our hardware grows in capabilities. Daniel Stone wrote: So I reflexively get a bit itchy when I see the kernel being used to transit magic blobs of data which are supplied by userspace, and only interpreted by different userspace. Having tiling formats hidden away means that we've had real-world bugs in AMD hardware, where we end up displaying garbage because we cannot generically reason about the buffer attributes. I'm a bit confused. Can't modifiers be specified by vendors and only interpreted by drivers? My understanding was that modifiers could actually be treated as opaque 64-bit data, in which case they would qualify as "magic blobs of data". Otherwise, it seems this wouldn't be scalable. What am I missing? Daniel Vetter wrote: I think in the interim figuring out how to expose kms capabilities better (and necessarily standardizing at least some of them which matter at the compositor level, like size limits of framebuffers) feels like the place to push the ecosystem forward. In some way Miguel's proposal looks a bit backwards, since it adds the pitch capabilities to addfb, but at addfb time you've allocated everything already, so way too late to fix things up. With modifiers we've added a very simple per-plane property to list which modifiers can be combined with which pixel formats. Tiny start, but obviously very far from all that we'll need. Not sure whether I might be misunderstanding your statement, but one of the allocator main features is negotiation of nearly optimal allocation parameters given a set of uses on different devices/engines by the capability merge operation. A client should have queried what every device/engine is capable of for the given uses, find the optimal set of capabilities, and use it for allocating a buffer. At the moment these parameters are given to KMS, they are expected to be good. If they aren't, the client didn't do things right. Rob Clark wrote: It does seem like, if possible, starting out with modifiers for now at the kernel interface would make life easier, vs trying to reinvent both kernel and userspace APIs at the same time. Userspace APIs are easier to change or throw away. Presumably by the time we get to the point of changing kernel uabi, we are already using, and pretty happy with, serialized liballoc data over the wire in userspace so it is only a matter of changing the kernel interface. I guess we can indeed start with modifiers for now, if that's what it takes to get the allocator mechanisms rolling. However, it seems to me that we won't be able to encode the same type of information included in capability sets with modifiers in all cases. For instance, if we end up encoding usage transition information in capability sets, how that would translate to modifiers? I assume display doesn't really care about a lot of the data
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Thu, Dec 28, 2017 at 1:24 PM, Miguel Angel Vicowrote: > (Adding dri-devel back, and trying to respond to some comments from > the different forks) > > James Jones wrote: > >> Your worst case analysis above isn't far off from our HW, give or take >> some bits and axes here and there. We've started an internal discussion >> about how to lay out all the bits we need. It's hard to even enumerate >> them all without having a complete understanding of what capability sets >> are going to include, a fully-optimized implementation of the mechanism >> on our HW, and lot's of test scenarios though. > > (thanks James for most of the info below) > > To elaborate a bit, if we want to share an allocation across GPUs for 3D > rendering, it seems we would need 12 bits to express our > swizzling/tiling memory layouts for fermi+. In addition to that, > maxwell uses 3 more bits for this, and we need an extra bit to identify > pre-fermi representations. > > We also need one bit to differentiate between Tegra and desktop, and > another one to indicate whether the layout is otherwise linear. > > Then things like whether compression is used (one more bit), and we can > probably get by with 3 bits for the type of compression if we are > creative. However, it'd be way easier to just track arch + page kind, > which would be like 32 bits on its own. > > Whether Z-culling and/or zero-bandwidth-clears are used may be another 3 > bits. > > If device-local properties are included, we might need a couple more > bits for caching. > > We may also need to express locality information, which may take at > least another 2 or 3 bits. > > If we want to share array textures too, you also need to pass the array > pitch. Is it supposed to be encoded in a modifier too? That's 64 bits on > its own. > > So yes, as James mentioned, with some effort, we could technically fit > our current allocation parameters in a modifier, but I'm still not > convinced this is as future proof as it could be as our hardware grows > in capabilities. > > > Daniel Stone wrote: > >> So I reflexively >> get a bit itchy when I see the kernel being used to transit magic >> blobs of data which are supplied by userspace, and only interpreted by >> different userspace. Having tiling formats hidden away means that >> we've had real-world bugs in AMD hardware, where we end up displaying >> garbage because we cannot generically reason about the buffer >> attributes. > > I'm a bit confused. Can't modifiers be specified by vendors and only > interpreted by drivers? My understanding was that modifiers could > actually be treated as opaque 64-bit data, in which case they would > qualify as "magic blobs of data". Otherwise, it seems this wouldn't be > scalable. What am I missing? > > > Daniel Vetter wrote: > >> I think in the interim figuring out how to expose kms capabilities >> better (and necessarily standardizing at least some of them which >> matter at the compositor level, like size limits of framebuffers) >> feels like the place to push the ecosystem forward. In some way >> Miguel's proposal looks a bit backwards, since it adds the pitch >> capabilities to addfb, but at addfb time you've allocated everything >> already, so way too late to fix things up. With modifiers we've added >> a very simple per-plane property to list which modifiers can be >> combined with which pixel formats. Tiny start, but obviously very far >> from all that we'll need. > > Not sure whether I might be misunderstanding your statement, but one of > the allocator main features is negotiation of nearly optimal allocation > parameters given a set of uses on different devices/engines by the > capability merge operation. A client should have queried what every > device/engine is capable of for the given uses, find the optimal set of > capabilities, and use it for allocating a buffer. At the moment these > parameters are given to KMS, they are expected to be good. If they > aren't, the client didn't do things right. > > > Rob Clark wrote: > >> It does seem like, if possible, starting out with modifiers for now at >> the kernel interface would make life easier, vs trying to reinvent >> both kernel and userspace APIs at the same time. Userspace APIs are >> easier to change or throw away. Presumably by the time we get to the >> point of changing kernel uabi, we are already using, and pretty happy >> with, serialized liballoc data over the wire in userspace so it is >> only a matter of changing the kernel interface. > > I guess we can indeed start with modifiers for now, if that's what it > takes to get the allocator mechanisms rolling. However, it seems to me > that we won't be able to encode the same type of information included > in capability sets with modifiers in all cases. For instance, if we end > up encoding usage transition information in capability sets, how that > would translate to modifiers? > > I assume display doesn't really care about a lot of the data capability >
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
(Adding dri-devel back, and trying to respond to some comments from the different forks) James Jones wrote: > Your worst case analysis above isn't far off from our HW, give or take > some bits and axes here and there. We've started an internal discussion > about how to lay out all the bits we need. It's hard to even enumerate > them all without having a complete understanding of what capability sets > are going to include, a fully-optimized implementation of the mechanism > on our HW, and lot's of test scenarios though. (thanks James for most of the info below) To elaborate a bit, if we want to share an allocation across GPUs for 3D rendering, it seems we would need 12 bits to express our swizzling/tiling memory layouts for fermi+. In addition to that, maxwell uses 3 more bits for this, and we need an extra bit to identify pre-fermi representations. We also need one bit to differentiate between Tegra and desktop, and another one to indicate whether the layout is otherwise linear. Then things like whether compression is used (one more bit), and we can probably get by with 3 bits for the type of compression if we are creative. However, it'd be way easier to just track arch + page kind, which would be like 32 bits on its own. Whether Z-culling and/or zero-bandwidth-clears are used may be another 3 bits. If device-local properties are included, we might need a couple more bits for caching. We may also need to express locality information, which may take at least another 2 or 3 bits. If we want to share array textures too, you also need to pass the array pitch. Is it supposed to be encoded in a modifier too? That's 64 bits on its own. So yes, as James mentioned, with some effort, we could technically fit our current allocation parameters in a modifier, but I'm still not convinced this is as future proof as it could be as our hardware grows in capabilities. Daniel Stone wrote: > So I reflexively > get a bit itchy when I see the kernel being used to transit magic > blobs of data which are supplied by userspace, and only interpreted by > different userspace. Having tiling formats hidden away means that > we've had real-world bugs in AMD hardware, where we end up displaying > garbage because we cannot generically reason about the buffer > attributes. I'm a bit confused. Can't modifiers be specified by vendors and only interpreted by drivers? My understanding was that modifiers could actually be treated as opaque 64-bit data, in which case they would qualify as "magic blobs of data". Otherwise, it seems this wouldn't be scalable. What am I missing? Daniel Vetter wrote: > I think in the interim figuring out how to expose kms capabilities > better (and necessarily standardizing at least some of them which > matter at the compositor level, like size limits of framebuffers) > feels like the place to push the ecosystem forward. In some way > Miguel's proposal looks a bit backwards, since it adds the pitch > capabilities to addfb, but at addfb time you've allocated everything > already, so way too late to fix things up. With modifiers we've added > a very simple per-plane property to list which modifiers can be > combined with which pixel formats. Tiny start, but obviously very far > from all that we'll need. Not sure whether I might be misunderstanding your statement, but one of the allocator main features is negotiation of nearly optimal allocation parameters given a set of uses on different devices/engines by the capability merge operation. A client should have queried what every device/engine is capable of for the given uses, find the optimal set of capabilities, and use it for allocating a buffer. At the moment these parameters are given to KMS, they are expected to be good. If they aren't, the client didn't do things right. Rob Clark wrote: > It does seem like, if possible, starting out with modifiers for now at > the kernel interface would make life easier, vs trying to reinvent > both kernel and userspace APIs at the same time. Userspace APIs are > easier to change or throw away. Presumably by the time we get to the > point of changing kernel uabi, we are already using, and pretty happy > with, serialized liballoc data over the wire in userspace so it is > only a matter of changing the kernel interface. I guess we can indeed start with modifiers for now, if that's what it takes to get the allocator mechanisms rolling. However, it seems to me that we won't be able to encode the same type of information included in capability sets with modifiers in all cases. For instance, if we end up encoding usage transition information in capability sets, how that would translate to modifiers? I assume display doesn't really care about a lot of the data capability sets may encode, but is it correct to think of modifiers as things only display needs? If we are to treat modifiers as a first-class citizen, I would expect to use them beyond that. Kristian Kristensen wrote: > I agree and let me
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
Inline. On Wed, 20 Dec 2017 11:54:10 -0800 Kristian Høgsbergwrote: > On Wed, Dec 20, 2017 at 11:51 AM, Daniel Vetter wrote: > > Since this also involves the kernel let's add dri-devel ... Yeah, I forgot. Thanks Daniel! > > > > On Wed, Dec 20, 2017 at 5:51 PM, Miguel Angel Vico > > wrote: > >> Hi all, > >> > >> As many of you already know, I've been working with James Jones on the > >> Generic Device Allocator project lately. He started a discussion thread > >> some weeks ago seeking feedback on the current prototype of the library > >> and advice on how to move all this forward, from a prototype stage to > >> production. For further reference, see: > >> > >> > >> https://lists.freedesktop.org/archives/mesa-dev/2017-November/177632.html > >> > >> From the thread above, we came up with very interesting high level > >> design ideas for one of the currently missing parts in the library: > >> Usage transitions. That's something I'll personally work on during the > >> following weeks. > >> > >> > >> In the meantime, I've been working on putting together an open source > >> implementation of the allocator mechanisms using the Nouveau driver for > >> all to be able to play with. > >> > >> Below I'm seeking feedback on a bunch of changes I had to make to > >> different components of the graphics stack: > >> > >> ** Allocator ** > >> > >> An allocator driver implementation on top of Nouveau. The current > >> implementation only handles pitch linear layouts, but that's enough > >> to have the kmscube port working using the allocator and Nouveau > >> drivers. > >> > >> You can pull these changes from > >> > >> > >> https://github.com/mvicomoya/allocator/tree/wip/mvicomoya/nouveau-driver > >> > >> ** Mesa ** > >> > >> James's kmscube port to use the allocator relies on the > >> EXT_external_objects extension to import allocator allocations to > >> OpenGL as a texture object. However, the Nouveau implementation of > >> these mechanisms is missing in Mesa, so I went ahead and added them. > >> > >> You can pull these changes from > >> > >> > >> https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/EXT_external_objects-nouveau > >> > >> Also, James's kmscube port uses the NVX_unix_allocator_import > >> extension to attach allocator metadata to texture objects so the > >> driver knows how to deal with the imported memory. > >> > >> Note that there isn't a formal spec for this extension yet. For now, > >> it just serves as an experimental mechanism to import allocator > >> memory in OpenGL, and attach metadata to texture objects. > >> > >> You can pull these changes (written on top of the above) from: > >> > >> > >> https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/NVX_unix_allocator_import > >> > >> ** kmscube ** > >> > >> Mostly minor fixes and improvements on top of James's port to use the > >> allocator. Main thing is the allocator initialization path will use > >> EGL_MESA_platform_surfaceless if EGLDevice platform isn't supported > >> by the underlying EGL implementation. > >> > >> You can pull these changes from: > >> > >> > >> https://github.com/mvicomoya/kmscube/tree/wip/mvicomoya/allocator-nouveau > >> > >> > >> With all the above you should be able to get kmscube working using the > >> allocator on top of the Nouveau driver. > >> > >> > >> Another of the missing pieces before we can move this to production is > >> importing allocations to DRM FB objects. This is probably one of the > >> most sensitive parts of the project as it requires modification/addition > >> of kernel driver interfaces. > >> > >> At XDC2017, James had several hallway conversations with several people > >> about this, all having different opinions. I'd like to take this > >> opportunity to also start a discussion about what's the best option to > >> create a path to get allocator allocations added as DRM FB objects. > >> > >> These are the few options we've considered to start with: > >> > >> A) Have vendor-private ioctls to set properties on GEM objects that > >> are inherited by the FB objects. This is how our (NVIDIA) desktop > >> DRM driver currently works. This would require every vendor to add > >> their own ioctl to process allocator metadata, but the metadata is > >> actually a vendor-agnostic object more like DRM modifiers. We'd > >> like to come up with a vendor-agnostic solutions that can be > >> integrated to core DRM. > >> > >> B) Add a new drmModeAddFBWithMetadata() command that takes allocator > >> metadata blobs for each plane of the FB. Some people in the > >> community have mentioned this is their preferred design. This, > >> however, means we'd have to go through the exercise of adding > >> another metadata mechanism to the whole graphics stack. > >> > >> C) Shove allocator metadata into DRM by defining it to be a separate
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vicowrote: > Inline. > > On Wed, 20 Dec 2017 11:54:10 -0800 > Kristian Høgsberg wrote: > > > On Wed, Dec 20, 2017 at 11:51 AM, Daniel Vetter wrote: > > > Since this also involves the kernel let's add dri-devel ... > > Yeah, I forgot. Thanks Daniel! > > > > > > > On Wed, Dec 20, 2017 at 5:51 PM, Miguel Angel Vico < > mvicom...@nvidia.com> wrote: > > >> Hi all, > > >> > > >> As many of you already know, I've been working with James Jones on the > > >> Generic Device Allocator project lately. He started a discussion > thread > > >> some weeks ago seeking feedback on the current prototype of the > library > > >> and advice on how to move all this forward, from a prototype stage to > > >> production. For further reference, see: > > >> > > >>https://lists.freedesktop.org/archives/mesa-dev/2017- > November/177632.html > > >> > > >> From the thread above, we came up with very interesting high level > > >> design ideas for one of the currently missing parts in the library: > > >> Usage transitions. That's something I'll personally work on during the > > >> following weeks. > > >> > > >> > > >> In the meantime, I've been working on putting together an open source > > >> implementation of the allocator mechanisms using the Nouveau driver > for > > >> all to be able to play with. > > >> > > >> Below I'm seeking feedback on a bunch of changes I had to make to > > >> different components of the graphics stack: > > >> > > >> ** Allocator ** > > >> > > >> An allocator driver implementation on top of Nouveau. The current > > >> implementation only handles pitch linear layouts, but that's enough > > >> to have the kmscube port working using the allocator and Nouveau > > >> drivers. > > >> > > >> You can pull these changes from > > >> > > >> https://github.com/mvicomoya/allocator/tree/wip/mvicomoya/ > nouveau-driver > > >> > > >> ** Mesa ** > > >> > > >> James's kmscube port to use the allocator relies on the > > >> EXT_external_objects extension to import allocator allocations to > > >> OpenGL as a texture object. However, the Nouveau implementation of > > >> these mechanisms is missing in Mesa, so I went ahead and added them. > > >> > > >> You can pull these changes from > > >> > > >> https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/EXT_ > external_objects-nouveau > > >> > > >> Also, James's kmscube port uses the NVX_unix_allocator_import > > >> extension to attach allocator metadata to texture objects so the > > >> driver knows how to deal with the imported memory. > > >> > > >> Note that there isn't a formal spec for this extension yet. For now, > > >> it just serves as an experimental mechanism to import allocator > > >> memory in OpenGL, and attach metadata to texture objects. > > >> > > >> You can pull these changes (written on top of the above) from: > > >> > > >> https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/NVX_ > unix_allocator_import > > >> > > >> ** kmscube ** > > >> > > >> Mostly minor fixes and improvements on top of James's port to use > the > > >> allocator. Main thing is the allocator initialization path will use > > >> EGL_MESA_platform_surfaceless if EGLDevice platform isn't supported > > >> by the underlying EGL implementation. > > >> > > >> You can pull these changes from: > > >> > > >> https://github.com/mvicomoya/kmscube/tree/wip/mvicomoya/ > allocator-nouveau > > >> > > >> > > >> With all the above you should be able to get kmscube working using the > > >> allocator on top of the Nouveau driver. > > >> > > >> > > >> Another of the missing pieces before we can move this to production is > > >> importing allocations to DRM FB objects. This is probably one of the > > >> most sensitive parts of the project as it requires > modification/addition > > >> of kernel driver interfaces. > > >> > > >> At XDC2017, James had several hallway conversations with several > people > > >> about this, all having different opinions. I'd like to take this > > >> opportunity to also start a discussion about what's the best option to > > >> create a path to get allocator allocations added as DRM FB objects. > > >> > > >> These are the few options we've considered to start with: > > >> > > >> A) Have vendor-private ioctls to set properties on GEM objects that > > >> are inherited by the FB objects. This is how our (NVIDIA) desktop > > >> DRM driver currently works. This would require every vendor to > add > > >> their own ioctl to process allocator metadata, but the metadata > is > > >> actually a vendor-agnostic object more like DRM modifiers. We'd > > >> like to come up with a vendor-agnostic solutions that can be > > >> integrated to core DRM. > > >> > > >> B) Add a new drmModeAddFBWithMetadata() command that takes allocator > > >> metadata blobs for each plane of the FB. Some people in the >
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Thu, Dec 21, 2017 at 12:22 AM, Kristian Kristensenwrote: > On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico > wrote: >> >> Inline. >> >> On Wed, 20 Dec 2017 11:54:10 -0800 >> Kristian Høgsberg wrote: >> >> > On Wed, Dec 20, 2017 at 11:51 AM, Daniel Vetter wrote: >> > > Since this also involves the kernel let's add dri-devel ... >> >> Yeah, I forgot. Thanks Daniel! >> >> > > >> > > On Wed, Dec 20, 2017 at 5:51 PM, Miguel Angel Vico >> > > wrote: >> > >> Hi all, >> > >> >> > >> As many of you already know, I've been working with James Jones on >> > >> the >> > >> Generic Device Allocator project lately. He started a discussion >> > >> thread >> > >> some weeks ago seeking feedback on the current prototype of the >> > >> library >> > >> and advice on how to move all this forward, from a prototype stage to >> > >> production. For further reference, see: >> > >> >> > >> >> > >> https://lists.freedesktop.org/archives/mesa-dev/2017-November/177632.html >> > >> >> > >> From the thread above, we came up with very interesting high level >> > >> design ideas for one of the currently missing parts in the library: >> > >> Usage transitions. That's something I'll personally work on during >> > >> the >> > >> following weeks. >> > >> >> > >> >> > >> In the meantime, I've been working on putting together an open source >> > >> implementation of the allocator mechanisms using the Nouveau driver >> > >> for >> > >> all to be able to play with. >> > >> >> > >> Below I'm seeking feedback on a bunch of changes I had to make to >> > >> different components of the graphics stack: >> > >> >> > >> ** Allocator ** >> > >> >> > >> An allocator driver implementation on top of Nouveau. The current >> > >> implementation only handles pitch linear layouts, but that's enough >> > >> to have the kmscube port working using the allocator and Nouveau >> > >> drivers. >> > >> >> > >> You can pull these changes from >> > >> >> > >> >> > >> https://github.com/mvicomoya/allocator/tree/wip/mvicomoya/nouveau-driver >> > >> >> > >> ** Mesa ** >> > >> >> > >> James's kmscube port to use the allocator relies on the >> > >> EXT_external_objects extension to import allocator allocations to >> > >> OpenGL as a texture object. However, the Nouveau implementation of >> > >> these mechanisms is missing in Mesa, so I went ahead and added >> > >> them. >> > >> >> > >> You can pull these changes from >> > >> >> > >> >> > >> https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/EXT_external_objects-nouveau >> > >> >> > >> Also, James's kmscube port uses the NVX_unix_allocator_import >> > >> extension to attach allocator metadata to texture objects so the >> > >> driver knows how to deal with the imported memory. >> > >> >> > >> Note that there isn't a formal spec for this extension yet. For >> > >> now, >> > >> it just serves as an experimental mechanism to import allocator >> > >> memory in OpenGL, and attach metadata to texture objects. >> > >> >> > >> You can pull these changes (written on top of the above) from: >> > >> >> > >> >> > >> https://github.com/mvicomoya/mesa/tree/wip/mvicomoya/NVX_unix_allocator_import >> > >> >> > >> ** kmscube ** >> > >> >> > >> Mostly minor fixes and improvements on top of James's port to use >> > >> the >> > >> allocator. Main thing is the allocator initialization path will use >> > >> EGL_MESA_platform_surfaceless if EGLDevice platform isn't supported >> > >> by the underlying EGL implementation. >> > >> >> > >> You can pull these changes from: >> > >> >> > >> >> > >> https://github.com/mvicomoya/kmscube/tree/wip/mvicomoya/allocator-nouveau >> > >> >> > >> >> > >> With all the above you should be able to get kmscube working using >> > >> the >> > >> allocator on top of the Nouveau driver. >> > >> >> > >> >> > >> Another of the missing pieces before we can move this to production >> > >> is >> > >> importing allocations to DRM FB objects. This is probably one of the >> > >> most sensitive parts of the project as it requires >> > >> modification/addition >> > >> of kernel driver interfaces. >> > >> >> > >> At XDC2017, James had several hallway conversations with several >> > >> people >> > >> about this, all having different opinions. I'd like to take this >> > >> opportunity to also start a discussion about what's the best option >> > >> to >> > >> create a path to get allocator allocations added as DRM FB objects. >> > >> >> > >> These are the few options we've considered to start with: >> > >> >> > >> A) Have vendor-private ioctls to set properties on GEM objects that >> > >> are inherited by the FB objects. This is how our (NVIDIA) >> > >> desktop >> > >> DRM driver currently works. This would require every vendor to >> > >> add >> > >> their own ioctl to process allocator metadata, but the metadata >> > >> is >> > >> actually a
Re: [Mesa-dev] Allocator Nouveau driver, Mesa EXT_external_objects, and DRM metadata import interfaces
On Wed, Dec 20, 2017 at 6:22 PM, Kristian Kristensenwrote: > On Wed, Dec 20, 2017 at 12:41 PM, Miguel Angel Vico > wrote: >> On Wed, 20 Dec 2017 11:54:10 -0800 >> Kristian Høgsberg wrote: >> > I'd like to see concrete examples of actual display controllers >> > supporting more format layouts than what can be specified with a 64 >> > bit modifier. >> >> The main problem is our tiling and other metadata parameters can't >> generally fit in a modifier, so we find passing a blob of metadata a >> more suitable mechanism. > > > I understand that you may have n knobs with a total of more than a total of > 56 bits that configure your tiling/swizzling for color buffers. What I don't > buy is that you need all those combinations when passing buffers around > between codecs, cameras and display controllers. Even if you're sharing > between the same 3D drivers in different processes, I expect just locking > down, say, 64 different combinations (you can add more over time) and > assigning each a modifier would be sufficient. I doubt you'd extract > meaningful performance gains from going all the way to a blob. There's probably a world of stuff that we don't know about in nouveau, but I have a hard time coming up with more than 64-bits worth of tiling info for dGPU surfaces... There's 8 bits (sorta, not fully populated, but might as well use them) of "micro" tiling which is done at the PTE level by the memory controller and includes compression settings, and then there's 4 bits of tiling per dimension for macro blocks (which configures different sizes for each dimension for tile sizes) -- that's only 20 bits. MSAA level (which is part of the micro tiling setting usually, but may not necessarily have to be) - another couple of bits, maybe something else weird for another few bits. Anyways, this is *nowhere* close to 64 bits. What am I missing? -ilia ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel