From nobody Mon Feb 13 21:09:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PFxmm0ZPQz3q5KJ; Mon, 13 Feb 2023 21:09:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFxml6yxYz4RhB; Mon, 13 Feb 2023 21:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pT0EXrfbLOEFhc+gZNX1Na1/hxgcmm6q4Q95QOGLMlw=; b=OoPc1maW3RR+ab5u5pvCet9/QOISwF+ly8HwFDUD6W6u9XIQKwNoYAy7kde9Lu44Tx6afP M2Elmyv3PNML+mTxv9ZsZA4qtUeLmReNpO0j/8QKvx9i5kaTXZg16pESiemTpf6onLUrj+ FAENcx1p9ECLiAItNJ4MymLdwBbMJ5bZ+GvkF3zQZIEjURyOd31uvVF1icL0mtcLhLV6z4 1FcccmU081d8a76VQQmEk8HVPE8gWrhjalF+RhZJXpB2DUtNrteoB+UAhkZoVaGixuvy/A AcxizNOZMeP1xT/PTAkVp+eJjppAUGdkbihyw/oaYnAe2W4Z39vmDn6jE5FhvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pT0EXrfbLOEFhc+gZNX1Na1/hxgcmm6q4Q95QOGLMlw=; b=nLQGrZecHmvE6cmoXeI6w5gCCXSTx+aj7Sk40DLqNiSvCP0yHJOvs4VvUE0Em6rQLQW4q8 Gnn404lcvPMiacdmgUR+acyGrMaefognRVf+1mONehtFsKSnZ8t6IIAiKiWuQ/WzUXsbQU ZtKvY4IiCe1bOAxkyvNZxkvEYIed/L6L0I6GNeKeDoYLod8/ZKd+LsrqFxyVwInLatCyDg SuiWt4kRbsBNi+ik+xIkiX0+w8XHhr7yWIV76xMhWsYLseTpTlooLTcqqNO05mQR/kqzue xOCQlgOJDCHbfgBIcfgPWw9Tt9N2rpn/nPJimNRLTn6Aj6vZtWo1f50BZO4naw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322584; a=rsa-sha256; cv=none; b=XpHb96ppbpCW/uiKQXL9pCtbi/jbnoKfSXs0zpfjVCgN2uxCZ56Q5GkOxiy3PEFOEKsa22 FIG4V/qcoOM0L8Dl2Q5aETvbNcyB5axOLIhwSUtXcSy/Q6/RL1Tor8WwmAFW6Yf4JE6abf phrJoNsivz1+zhdkbMwra1AHSl0XBCjX9vHGd9qyaJbYFGgFTguFTRgjtOdh/6/eUaSikV 9p48GxHQKRh7he4GoLztYefzg33cpKpeMps88tuMBxV3MTBATDnpRkliq+wwtPo2nzfJwR waZHGTom6AjsieXW6yCFJ39QOlrhjc5FK/zzdtY4Q2FbkqbNea4ywOB+FmrZag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PFxml5xX2zY4w; Mon, 13 Feb 2023 21:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31DL9hgF056259; Mon, 13 Feb 2023 21:09:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9hUs056258; Mon, 13 Feb 2023 21:09:43 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:43 GMT Message-Id: <202302132109.31DL9hUs056258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: a82a8a5e1935 - main - linuxkpi: Define `backlight_get_brightness()` and `backlight_is_blank()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a82a8a5e193587d819288c3c27f1c9472178e10e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a82a8a5e193587d819288c3c27f1c9472178e10e commit a82a8a5e193587d819288c3c27f1c9472178e10e Author: Jean-Sébastien Pédron AuthorDate: 2023-02-08 17:51:16 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-13 21:09:26 +0000 linuxkpi: Define `backlight_get_brightness()` and `backlight_is_blank()` This is not used by the DRM driver yet because we comment out the code calling them, but they are easy to implement. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38530 --- sys/compat/linuxkpi/common/include/linux/backlight.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h index 9591a4b671ab..5a3c7080b55d 100644 --- a/sys/compat/linuxkpi/common/include/linux/backlight.h +++ b/sys/compat/linuxkpi/common/include/linux/backlight.h @@ -91,6 +91,13 @@ backlight_force_update(struct backlight_device *bd, int reason) bd->props.brightness = bd->ops->get_brightness(bd); } +static inline int +backlight_get_brightness(struct backlight_device *bd) +{ + + return (bd->props.brightness); +} + static inline int backlight_device_set_brightness(struct backlight_device *bd, int brightness) { @@ -119,4 +126,11 @@ backlight_disable(struct backlight_device *bd) return (backlight_update_status(bd)); } +static inline bool +backlight_is_blank(struct backlight_device *bd) +{ + + return (bd->props.power != 0/* FB_BLANK_UNBLANK */); +} + #endif /* _LINUXKPI_LINUX_BACKLIGHT_H_ */