From patchwork Wed Nov 6 09:31:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 11229763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7586D15AB for ; Wed, 6 Nov 2019 09:31:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E79C2075C for ; Wed, 6 Nov 2019 09:31:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E79C2075C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1720B6EC7B; Wed, 6 Nov 2019 09:31:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9AC1A6EC75 for ; Wed, 6 Nov 2019 09:31:26 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 09732B40E; Wed, 6 Nov 2019 09:31:25 +0000 (UTC) From: Thomas Zimmermann To: daniel@ffwll.ch, christian.koenig@amd.com, noralf@tronnes.org Subject: [RFC][PATCH 0/8] Support I/O memory in generic fbdev emulation Date: Wed, 6 Nov 2019 10:31:13 +0100 Message-Id: <20191106093121.21762-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We recently had a discussion if/how fbdev emulation could support framebuffers in I/O memory on all platform. [1] I typed up a patchset that passes information about the memory area from memory manager to client (e.g., fbdev emulation). The client can take this into consideration when accessing the framebuffer. The alternative proposal is to introduce a separate vmap() call that only returns I/O memorym or NULL if the framebuffer is not in I/O memory. AFAICS the benefit of this idea is the cleaner interface and the ability to modify drivers one by one. The drawback is some additional boilerplate code in drivers and clients. [1] https://lists.freedesktop.org/archives/dri-devel/2019-November/242464.html Thomas Zimmermann (8): drm/vram-helper: Tell caller if vmap() returned I/O memory drm/qxl: Tell caller if kmap() returned I/O memory drm: Add is_iomem return parameter to struct drm_gem_object_funcs.vmap drm/gem: Return I/O-memory flag from drm_gem_vram() drm/client: Return I/O memory flag from drm_client_buffer_vmap() fbdev: Export default read and write operations as fb_cfb_{read,write}() drm/fb-helper: Select between fb_{sys,cfb}_read() and _write() drm/fb-helper: Handle I/O memory correctly when flushing shadow fb drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.h | 2 +- drivers/gpu/drm/ast/ast_mode.c | 6 +- drivers/gpu/drm/cirrus/cirrus.c | 2 +- drivers/gpu/drm/drm_client.c | 15 ++- drivers/gpu/drm/drm_fb_helper.c | 118 ++++++++++++++++++-- drivers/gpu/drm/drm_gem.c | 9 +- drivers/gpu/drm/drm_gem_cma_helper.c | 7 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 12 +- drivers/gpu/drm/drm_gem_vram_helper.c | 13 ++- drivers/gpu/drm/drm_internal.h | 2 +- drivers/gpu/drm/drm_prime.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 4 +- drivers/gpu/drm/mgag200/mgag200_cursor.c | 4 +- drivers/gpu/drm/nouveau/nouveau_gem.h | 2 +- drivers/gpu/drm/nouveau/nouveau_prime.c | 4 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 6 +- drivers/gpu/drm/qxl/qxl_draw.c | 4 +- drivers/gpu/drm/qxl/qxl_drv.h | 4 +- drivers/gpu/drm/qxl/qxl_object.c | 7 +- drivers/gpu/drm/qxl/qxl_object.h | 2 +- drivers/gpu/drm/qxl/qxl_prime.c | 4 +- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_prime.c | 4 +- drivers/gpu/drm/tiny/gm12u320.c | 2 +- drivers/gpu/drm/vc4/vc4_bo.c | 4 +- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- drivers/gpu/drm/vgem/vgem_drv.c | 5 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 6 +- drivers/gpu/drm/xen/xen_drm_front_gem.h | 3 +- drivers/video/fbdev/core/fbmem.c | 53 +++++++-- include/drm/drm_client.h | 7 +- include/drm/drm_drv.h | 2 +- include/drm/drm_fb_helper.h | 14 +++ include/drm/drm_gem.h | 2 +- include/drm/drm_gem_cma_helper.h | 2 +- include/drm/drm_gem_shmem_helper.h | 2 +- include/drm/drm_gem_vram_helper.h | 2 +- include/linux/fb.h | 5 + 41 files changed, 278 insertions(+), 78 deletions(-)