From patchwork Sat Aug 29 14:06:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidong Yang X-Patchwork-Id: 11744391 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 2890616B1 for ; Sat, 29 Aug 2020 14:07:18 +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 EEEC1207DA for ; Sat, 29 Aug 2020 14:07:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VLkSOoR/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEEC1207DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 51A796E05A; Sat, 29 Aug 2020 14:07:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 605876E05A for ; Sat, 29 Aug 2020 14:07:13 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id o13so1848572pgf.0 for ; Sat, 29 Aug 2020 07:07:13 -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; bh=G4Co+LDYHQDXFnU8L4kBtVkB8qH4ZjDz0L0to2gfrKY=; b=VLkSOoR/YR8forWhO67URYv2p62bdEUJPYPqIFIdrHshtLyU3x/JWxTnz1xV4x4Eoe tbxEFIrPu+Phv9bL3xrw6grMczHzX1voAIt+iylXLjxEpG/egTgZmD+ehF6OmvdfhPvP quqbzPRt3Kzp3fwQWnPmKEJcda0P2TxoGmpykz6+/MPuYbzp+Du6YJv6P/onoDXyBN/0 pwO8QzuQr8l59g4G2vfIQk5F2HybQTbQlwNmyfi8+rXxwpamCKTASm5NFiDJGoL75TOO i706fmWgETbTrH9DxVApbbrC53jSQdxmF+FT9P0rvwMtzTpznq9NFhrDayPujwwh2ymn K3ig== 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; bh=G4Co+LDYHQDXFnU8L4kBtVkB8qH4ZjDz0L0to2gfrKY=; b=TdbMYkagXzo2DOKcw143AdF2a/eJea3zPUvVAYNK+MMkptEmj7RzQqZkMjdb3/fT9l zDITYfIplAuj3wfdO086uYD2p9BSbfXxPmmoMFrOOTR2+iBFn474KzkNDkq0tNPsMQRk UH3wcPbNqRZgf4aKEWCGeEWjH380ol0oV8NOie5RseOZORuEc73iSuTjFjQdW9kfTF1w YblkZYiMyhA590lnkQlHgEs4ShOacgXjHoSEg90j3bfyMU4N+2c43k7C/ikL9p3tXCfB tB9PQ9FDsUlOR8aI4mHKjw/uUgha63B+hswYAlZSIw8bi0FI0aaOAos4R5NkShxZebPL JH2w== X-Gm-Message-State: AOAM532RhCqDwrWgFUObMYSjwAISis5XFO1WEqP2mYVH6CjZgSJEIfiE O4/MYEj2zqqBlD0S7Ed5g7Q= X-Google-Smtp-Source: ABdhPJxyqOLquHmdfef3I8zWlT2JV8o6Q8Plfy8AEupDK8yZuT+bcCMdqitS7x/r+KeBRepRufcVtQ== X-Received: by 2002:a63:9d0f:: with SMTP id i15mr2581489pgd.413.1598710032881; Sat, 29 Aug 2020 07:07:12 -0700 (PDT) Received: from localhost.localdomain ([61.83.141.80]) by smtp.gmail.com with ESMTPSA id h193sm2691889pgc.42.2020.08.29.07.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Aug 2020 07:07:12 -0700 (PDT) From: Sidong Yang To: Daniel Vetter , Rodrigo Siqueira Subject: [PATCH] drm/vkms: add support for gamma_set interface Date: Sat, 29 Aug 2020 14:06:47 +0000 Message-Id: <20200829140647.7626-1-realwakka@gmail.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haneen Mohammed , Emil Velikov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Melissa Wen , Sidong Yang MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently vkms module doesn't support gamma function for userspace. so igt subtests in kms_plane(pixel-format-pipe-A-plan) failed for calling drmModeCrtcSetGamma(). This patch set gamma_set interface in vkms_crtc_funcs for support gamma function. With initializing crtc, added calls for setting gamma size. it pass the test after this patch. Cc: Daniel Vetter Cc: Rodrigo Siqueira Cc: Haneen Mohammed Signed-off-by: Sidong Yang --- drivers/gpu/drm/vkms/vkms_crtc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index ac85e17428f8..643435fb2ee6 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -160,6 +160,7 @@ static const struct drm_crtc_funcs vkms_crtc_funcs = { .get_crc_sources = vkms_get_crc_sources, .set_crc_source = vkms_set_crc_source, .verify_crc_source = vkms_verify_crc_source, + .gamma_set = drm_atomic_helper_legacy_gamma_set, }; static int vkms_crtc_atomic_check(struct drm_crtc *crtc, @@ -275,6 +276,13 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, return ret; } + ret = drm_mode_crtc_set_gamma_size(crtc, 256); + if (ret) { + DRM_ERROR("Failed to set gamma size\n"); + return ret; + } + drm_crtc_enable_color_mgmt(crtc, 0, false, 256); + drm_crtc_helper_add(crtc, &vkms_crtc_helper_funcs); spin_lock_init(&vkms_out->lock);