From patchwork Sat Jul 4 13:17:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hanishkvc X-Patchwork-Id: 20796 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id EEBD444949A for ; Sat, 4 Jul 2020 16:18:24 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D0DFB68B453; Sat, 4 Jul 2020 16:18:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB47568B0DF for ; Sat, 4 Jul 2020 16:18:18 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id b16so15039943pfi.13 for ; Sat, 04 Jul 2020 06:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8IXkLbPkmyrBftIrXlWA164Qkx2y1cprgZkhLjwg5qY=; b=Q5SkswQuz9vEZPC+utoGb2DdAvYyCR1QoNMWemhFAeK/7U8tWd8dRrxvx3L8xUvFja RMZuRo92rrPV/ucGZFH4xxhUb057Gtb0t8ak8o/ON2U6KWHmN8ZnKzPriMgR+6KSfUZN Imy9Yonw7WokAFGgbJ91fMMllcqVwZR9040f06DTuedQnrxqhKCIcDOIAAWAbg9A5izs YA8Ti3F2qsP8MkpE1jmFOePi40XEHimL4B3lit/7CNZLyaIjFqPYMmkh6WbgXAMBN8+3 /zRTa34pHws49QSEc1xbw91NLdmkUMWuPL0ARJ1AjFex41mS5LNFP88/iAPAEIradqAP sEcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8IXkLbPkmyrBftIrXlWA164Qkx2y1cprgZkhLjwg5qY=; b=d7K7XM0XLH4LFI+jyprUBpNv9mbTck9hfL+C+YvYRAUlF9f/2S0nyrR7ETKA9lnGb9 9fH8qTvuhvM+8K6BNAvrExt5QoHKAiSgFsOAwp+WiYU0TZfTVQNjsBURwvmhEiGUlsJA HVPYKkUqTTJd1qio0KTrkoRQGmGWOBIzqz/snJ2ORdKe/t8ZzDKTQdp7X1AS/f6qSu0A b46F43nPOivVxgjR2Ta2TvRTfgYEHAfOi5hXcPCR4/I7XfpUIyf9l3hzDxp+LT6s6bPf 7Hfb0tHb4YO1ENO4ntSoRWi5UQ3SUeWjQcnFGCUpxEdzg2GSg0nXfQ3nE/r7LtFk6wo0 SQmg== X-Gm-Message-State: AOAM5321lgH9TjMdxrXyDuHYWvE/wQDvjGg1pAHzbHVEFcSzgDso3kRt thuOskNGNleK75XBlGHZI9NL9rqH X-Google-Smtp-Source: ABdhPJy5vY47LJQ+jMeF9iNiPog5HJ6lxt/VCA/H+78JN/+er1x1pZnLWpPqaR0PFD4J30uDNBV4Mw== X-Received: by 2002:a63:5d11:: with SMTP id r17mr3989415pgb.146.1593868696478; Sat, 04 Jul 2020 06:18:16 -0700 (PDT) Received: from localhost.localdomain ([122.179.70.80]) by smtp.gmail.com with ESMTPSA id b191sm14657507pga.13.2020.07.04.06.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 06:18:15 -0700 (PDT) From: hanishkvc To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Jul 2020 18:47:12 +0530 Message-Id: <20200704131717.49428-1-hanishkvc@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v06 0/5] KMSGrab, fbtile helpers, hwcontext_drm, hwdownload, fbdetilevf X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: hanishkvc Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Have split my changes into 5 patches, so that the concerned people/team can decide whether to apply a given patch or not. P1/4) kmsgrab format_modifier patch is independent of other patches P2/5) fbtile helper routines is indepdent of other patches, and is used by my hwcontext_drm, hwdownload and fbdetile patches. Equally it could be used by any other logic if required. P3/5) hwcontext_drm detile if required and possible. This depends on the fbtile (P2/5) patches. P4/5) hwdownload detile framebuffer patch. It is implemented such that it gets used only if the actual hardware context doesnt detile the underlying framebuffer and inturn if user requests detiling explicitly. This depends on the fbtile (P2/5) patches. NOTE: hwdownload patch is orthogonal to hwcontext_drm patch. Detiling within hwcontext_drm, allows a bit more efficient detiling, by avoiding a copy operation. Detiling in hwdownload, provides a catch all detiling, where possible, provided the user requests the same and the underlying hwcontext doesnt output a linear layout. P5/5) fbdetile video filter. Useful if a user wants to apply detiling as a offline/seperate pass. This depends on the fbtile (P2/5) patches. I strongly feel ffmpeg should be a flexible toolkit, which gives the freedom to the user to mix and match things as they see fit, rather than enforcing things for them. Also ideally it should try and provide a sensible fallback where possible. Keeping these in mind, this set of patches, tries to put a skeleton in place to handle multiple possible usecases related to tiled layouts. Beyond this I leave it to the concerned people to decide, if they want to provide the same freedom and flexibility to the users or not. At a minimum apply P1/5, P2/5 and P3/5. Ideally apply all 5 patches, for the best possible future flexibility. hanishkvc (5): KMSGrab: getfb2 format_modifier if user doesnt specify fbtile helperRoutines cpu based framebuffer detiling hwcontext_drm detile non linear layout, if possible hwdownload detile framebuffer, if requested by user fbdetile videofilter cpu based framebuffer detiling Changelog | 4 + doc/filters.texi | 97 ++++++++ libavdevice/kmsgrab.c | 22 +- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_fbdetile.c | 238 +++++++++++++++++++ libavfilter/vf_hwdownload.c | 74 +++++- libavutil/Makefile | 2 + libavutil/fbtile.c | 441 ++++++++++++++++++++++++++++++++++++ libavutil/fbtile.h | 228 +++++++++++++++++++ libavutil/hwcontext_drm.c | 32 ++- 11 files changed, 1135 insertions(+), 5 deletions(-) create mode 100644 libavfilter/vf_fbdetile.c create mode 100644 libavutil/fbtile.c create mode 100644 libavutil/fbtile.h