From 4ef7ec52c0a4d3cf5e0b7d325e77a3d2a68009c4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 23 Mar 2025 14:36:56 +0100 Subject: Rewrite gamma-drm.c to use libgamma MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- po/be.po | 11 +-- po/ca.po | 11 +-- po/cs.po | 11 +-- po/da.po | 11 +-- po/de.po | 11 +-- po/el.po | 7 +- po/en_GB.po | 11 +-- po/eo.po | 7 +- po/es.po | 11 +-- po/eu.po | 11 +-- po/fi.po | 7 +- po/fr.po | 11 +-- po/gl.po | 7 +- po/he.po | 7 +- po/hi.po | 7 +- po/hr.po | 7 +- po/hu.po | 11 +-- po/it.po | 7 +- po/ja.po | 11 +-- po/lt.po | 7 +- po/nb.po | 7 +- po/nl.po | 11 +-- po/oc.po | 7 +- po/pl.po | 11 +-- po/pt.po | 11 +-- po/pt_BR.po | 11 +-- po/redshift.pot | 7 +- po/ro.po | 7 +- po/ru.po | 7 +- po/sr.po | 7 +- po/sv.po | 11 +-- po/tr.po | 7 +- po/uk.po | 11 +-- po/zh_CN.po | 11 +-- po/zh_TW.po | 11 +-- src/config.mk | 1 - src/gamma-drm.c | 256 +++----------------------------------------------------- 37 files changed, 99 insertions(+), 479 deletions(-) diff --git a/po/be.po b/po/be.po index adcfc4b..4e3579a 100644 --- a/po/be.po +++ b/po/be.po @@ -539,15 +539,10 @@ msgstr "У DRM не атрымалася прачытаць значэнне г msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Наладзіць гаму з дапамогай Direct Rendering Manager\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tГрафічная карта для ўжытых змен\n" -" crtc=N\tCRTC для ўжытых змен для\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Графічная карта для ўжытых змен\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/ca.po b/po/ca.po index b92cd16..2f4f1ac 100644 --- a/po/ca.po +++ b/po/ca.po @@ -545,15 +545,10 @@ msgstr "El DRM no pot llegir els valors gamma en el CRTC %i en la targeta de ví msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Ajusta els valors gamma amb el DRM.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tTargeta gràfica per aplicar els ajusts\n" -" crtc=N\tCRTC per aplicar els ajusts\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Targeta gràfica per aplicar els ajusts\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/cs.po b/po/cs.po index 48d76a8..61649c0 100644 --- a/po/cs.po +++ b/po/cs.po @@ -546,15 +546,10 @@ msgstr "" "Přizpůsobit gamma korekci pomocí rozhraní podsystému Direct Rendering " "Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tGrafická karta, na které provést přizpůsobení\n" -" crtc=N\tCRTC, na kterém provést přizpůsobení\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Grafická karta, na které provést přizpůsobení\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/da.po b/po/da.po index df6e132..6cf69d9 100644 --- a/po/da.po +++ b/po/da.po @@ -538,15 +538,10 @@ msgstr "DRM kunne ikke læse gammatabellen for CRTC %i på grafikkort %i, ignore msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Juster gammatabellerne med Direct Rendering Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tGrafikkort som skal justeres\n" -" crtc=N\tCRTC som skal justeres\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Grafikkort som skal justeres\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/de.po b/po/de.po index c8aed9a..abae9d4 100644 --- a/po/de.po +++ b/po/de.po @@ -541,15 +541,10 @@ msgstr "DRM kann den Gamma-Anstieg von CRTC %i an Grafikkarten %i nicht lesen. G msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Gamma-Anstiege mit Direct-Rendering-Manager (DRM) einstellen.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tGrafikkarte zum Anpassen\n" -" crtc=N\tCRTC zum Anpassen\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Grafikkarte zum Anpassen\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/el.po b/po/el.po index 53431f7..758425b 100644 --- a/po/el.po +++ b/po/el.po @@ -498,12 +498,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/en_GB.po b/po/en_GB.po index 55a5175..84c0e4d 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -539,15 +539,10 @@ msgstr "DRM could not read gamma ramps on CRTC %i on graphics card %i, ignoring msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Adjust gamma ramps with Direct Rendering Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Graphics card to apply adjustments to\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/eo.po b/po/eo.po index 32c0906..104752c 100644 --- a/po/eo.po +++ b/po/eo.po @@ -505,12 +505,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/es.po b/po/es.po index 99d0740..946feda 100644 --- a/po/es.po +++ b/po/es.po @@ -549,15 +549,10 @@ msgstr "El DRM no puede leer los valores gamma en el CRTC %i en la tarjeta gráf msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Ajustar los valores gamma con el DRM\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N \t Tarjeta gráfica para aplicar los ajustes\n" -" crtc=N \t CRTC para aplicar los ajustes\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Tarjeta gráfica para aplicar los ajustes\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/eu.po b/po/eu.po index a807f8e..2ef2bfa 100644 --- a/po/eu.po +++ b/po/eu.po @@ -537,15 +537,10 @@ msgstr "Ezin izan da CRTC %i bideo txartelaren gamma-balioa ezarri. Gailuari ez msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Doitu gamma balioak Direct Rendering Managerraren bidez." -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tDoitzeak aplikatzeko txartel grafikoa\n" -" crtc=N\tDoitzeak aplikatzeko CRTCa\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Doitzeak aplikatzeko txartel grafikoa\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/fi.po b/po/fi.po index f777e3d..552c932 100644 --- a/po/fi.po +++ b/po/fi.po @@ -510,12 +510,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/fr.po b/po/fr.po index 38ee96e..32e24b7 100644 --- a/po/fr.po +++ b/po/fr.po @@ -553,15 +553,10 @@ msgstr "DRM ne peut pas lire les rampes de couleurs sur CRTC %i sur les carte gr msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Régler les rampes de couleurs avec Direct Rendering Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N \t Réglages à appliquer à la carte graphique\n" -" crtc=N \t Réglages à appliquer au CRTC\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Réglages à appliquer à la carte graphique\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/gl.po b/po/gl.po index 155cf68..ec4e093 100644 --- a/po/gl.po +++ b/po/gl.po @@ -503,12 +503,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/he.po b/po/he.po index 7de0f18..5e6a15a 100644 --- a/po/he.po +++ b/po/he.po @@ -500,12 +500,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/hi.po b/po/hi.po index 5b3f994..dfcc487 100644 --- a/po/hi.po +++ b/po/hi.po @@ -501,12 +501,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/hr.po b/po/hr.po index 2aa2271..0f4fa06 100644 --- a/po/hr.po +++ b/po/hr.po @@ -508,12 +508,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/hu.po b/po/hu.po index 6f0385f..8b354b4 100644 --- a/po/hu.po +++ b/po/hu.po @@ -523,15 +523,10 @@ msgstr "DRM nem tudja kiolvasni a CRTC %i gamma emelkedéseket a %i grafikus ká msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "A gamma emelkedés beállítása a Közvetlen kiválasztó kezelővel.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" kártya=N\tGrafikus kártya amin beállítást végez\n" -" crtc=N\tCRTC amin beállítást végez\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Grafikus kártya amin beállítást végez\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/it.po b/po/it.po index b7e22aa..e7411d8 100644 --- a/po/it.po +++ b/po/it.po @@ -521,12 +521,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/ja.po b/po/ja.po index 37524a5..3a1e51c 100644 --- a/po/ja.po +++ b/po/ja.po @@ -527,15 +527,10 @@ msgstr "DRM は グラフィックス カード %i 上の CRTC %i のガンマ msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Direct Rendering Manager を用いてガンマ ランプを調整します。\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\t調整を適用するグラフィックス カード\n" -" crtc=N\t調整を適用する CRTC\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N 調整を適用するグラフィックス カード\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/lt.po b/po/lt.po index fb8605d..5bf1c66 100644 --- a/po/lt.po +++ b/po/lt.po @@ -516,12 +516,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/nb.po b/po/nb.po index cae30c7..40fdc59 100644 --- a/po/nb.po +++ b/po/nb.po @@ -515,12 +515,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/nl.po b/po/nl.po index db52a0f..1dec54e 100644 --- a/po/nl.po +++ b/po/nl.po @@ -528,15 +528,10 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tGrafische kaart om bijstellingen op toe te passen\n" -" crtc=N\tCRTC om bijstellingen op toe te passen\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Grafische kaart om bijstellingen op toe te passen\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/oc.po b/po/oc.po index a307d07..edbc79a 100644 --- a/po/oc.po +++ b/po/oc.po @@ -499,12 +499,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/pl.po b/po/pl.po index e3d7895..1cd53e8 100644 --- a/po/pl.po +++ b/po/pl.po @@ -516,15 +516,10 @@ msgstr "DRM nie może odczytać zakresu gamma na CRTC %i na karcie graficznej %i msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Dostosuj zakres gamma dzięki Direct Rendering Manager\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\t Karta, do której będą zastosowane parametry\n" -" crtc=N\t CRTC, do którego będą zastosowane parametry\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Karta, do której będą zastosowane parametry\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/pt.po b/po/pt.po index bc23ce6..9e8fb44 100644 --- a/po/pt.po +++ b/po/pt.po @@ -509,15 +509,10 @@ msgstr "DRM não consegue ler o declive gama no CRTC %i da placa gráfica %i, ig msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Ajusta o declive gama com o Gestor de Rendering Direto.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tPlaca gráfica a aplicar os ajuste a\n" -" crtc=N\tCRTC a aplicar os ajustes a\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Placa gráfica a aplicar os ajuste a\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/pt_BR.po b/po/pt_BR.po index 104271f..72fbb7c 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -521,15 +521,10 @@ msgstr "DRM não consegue obter a escala gamma de CTRC %i em placa gráfica %i, msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Ajuste escala gamma com Direct Rendering Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tPlaca gráfica para receber ajustes\n" -" crtc=N\tCRTC para receber ajustes\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Placa gráfica para receber ajustes\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/redshift.pot b/po/redshift.pot index 2b00cca..71c3b00 100644 --- a/po/redshift.pot +++ b/po/redshift.pot @@ -493,12 +493,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/ro.po b/po/ro.po index dcaf068..a9bb90f 100644 --- a/po/ro.po +++ b/po/ro.po @@ -497,12 +497,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/ru.po b/po/ru.po index 2079ef7..ea5888a 100644 --- a/po/ru.po +++ b/po/ru.po @@ -513,12 +513,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/sr.po b/po/sr.po index de00da0..4f0cf97 100644 --- a/po/sr.po +++ b/po/sr.po @@ -514,12 +514,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/sv.po b/po/sv.po index 66bc5bc..3eecc1b 100644 --- a/po/sv.po +++ b/po/sv.po @@ -518,15 +518,10 @@ msgstr "DRM kunde inte läsa gammaförfiningar på CRTC %i på grafikkort %i, ig msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Justera gammaförfiningar med Direct Rendering Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\tGrafikkort att tillämpa justeringar på\n" -" crtc=N\tCRTC att tillämpa justeringar på\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Grafikkort att tillämpa justeringar på\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/tr.po b/po/tr.po index 43979ca..35d0ecc 100644 --- a/po/tr.po +++ b/po/tr.po @@ -498,12 +498,9 @@ msgstr "" msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" +msgid " card=N Graphics card to apply adjustments to\n" msgstr "" #: ../src/gamma-drm.c:260 diff --git a/po/uk.po b/po/uk.po index 4da122b..3651f44 100644 --- a/po/uk.po +++ b/po/uk.po @@ -542,15 +542,10 @@ msgstr "DRM не може прочитати гамма-рампу CRTC %i на msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "Налаштувати гамма-рампу за допомогою Direct Rendering Manager.\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\t Щоб застосувати коригування до відеокарти\n" -" crtc=N\t Щоб застосувати коригування CRTC\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N Щоб застосувати коригування до відеокарти\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/zh_CN.po b/po/zh_CN.po index 31fb089..6cc5323 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -525,15 +525,10 @@ msgstr "DRM 无法在显卡 %i 上获取 CTRC %i 的伽马斜面,忽略设备 msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "使用 Direct Rendering Manager 调整伽马斜面。\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\t用来应用调节的显卡\n" -" crtc=N\t用来应用调节的CRTC\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N 用来应用调节的显卡\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/po/zh_TW.po b/po/zh_TW.po index 2685923..d4f09b5 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -530,15 +530,10 @@ msgstr "DRM 不能讀到咖瑪斜面於 CRTC %i on 顯示卡 %i , 忽略設備 msgid "Adjust gamma ramps with Direct Rendering Manager.\n" msgstr "用 Direct Rendering Manager 調整咖瑪斜面。\n" -#. TRANSLATORS: DRM help output -#. left column must not be translated +#. TRANSLATORS: DRM help output left column must not be translated #: ../src/gamma-drm.c:247 -msgid "" -" card=N\tGraphics card to apply adjustments to\n" -" crtc=N\tCRTC to apply adjustments to\n" -msgstr "" -" card=N\t顯示卡去套用調整至\n" -" crtc=N\tCRTC 去套用調整至\n" +msgid " card=N Graphics card to apply adjustments to\n" +msgstr " card=N 顯示卡去套用調整至\n" #: ../src/gamma-drm.c:260 #, c-format diff --git a/src/config.mk b/src/config.mk index d0418bb..b16b4c9 100644 --- a/src/config.mk +++ b/src/config.mk @@ -10,7 +10,6 @@ PKGCONFIG = pkg-config PKGCONFIG_CFLAGS = $(PKGCONFIG) --cflags PKGCONFIG_LDFLAGS = $(PKGCONFIG) --libs -DRM_LIBS = libdrm GEOCLUE_LIBS = glib-2.0 gio-2.0 LIBS_PKGCONFIG = $(DRM_LIBS) $(GEOCLUE_LIBS) libgamma diff --git a/src/gamma-drm.c b/src/gamma-drm.c index 1713024..f5aef31 100644 --- a/src/gamma-drm.c +++ b/src/gamma-drm.c @@ -19,196 +19,11 @@ */ #include "common.h" -#include -#include - -#ifndef O_CLOEXEC -# define O_CLOEXEC 02000000 -#endif - - -struct drm_crtc_state { - int crtc_num; - int crtc_id; - int gamma_size; - uint16_t *r_gamma; - uint16_t *g_gamma; - uint16_t *b_gamma; -}; - - -struct gamma_state { - int card_num; - int crtc_num; - int fd; - drmModeRes *res; - struct drm_crtc_state *crtcs; -}; - static int drm_create(struct gamma_state **state_out) { - struct gamma_state *state; - state = *state_out = emalloc(sizeof(**state_out)); - state->card_num = 0; - state->crtc_num = -1; - state->fd = -1; - state->res = NULL; - state->crtcs = NULL; - return 0; -} - - -static int -drm_start(struct gamma_state *state) -{ - /* Acquire access to a graphics card. */ - char pathname[sizeof(DRM_DIR_NAME"")-1U + sizeof(DRM_DEV_NAME"")-1U + 3U * sizeof(int) + 2U]; - int crtc_count; - struct drm_crtc_state *crtcs; - - sprintf(pathname, DRM_DEV_NAME, DRM_DIR_NAME, state->card_num); - - state->fd = open(pathname, O_RDWR | O_CLOEXEC); - if (state->fd < 0) { - /* TODO check if access permissions, normally root or membership of the video group is required. */ - weprintf(_("Failed to open DRM device `%s': %s."), pathname, strerror(errno)); - return -1; - } - - /* Acquire mode resources. */ - state->res = drmModeGetResources(state->fd); - if (state->res == NULL) { - weprintf(_("Failed to get DRM mode resources.")); - close(state->fd); - state->fd = -1; - return -1; - } - - /* Create entries for selected CRTCs. */ - crtc_count = state->res->count_crtcs; - if (state->crtc_num >= 0) { - if (state->crtc_num >= crtc_count) { - if (crtc_count > 1) - weprintf(_("CRTC %i does not exist, valid CRTCs are [0, %i]."), state->crtc_num, crtc_count-1); - else - weprintf(_("CRTC %i does not exist, only CRTC 0 exists."), state->crtc_num); - close(state->fd); - state->fd = -1; - drmModeFreeResources(state->res); - state->res = NULL; - return -1; - } - - state->crtcs = malloc(2 * sizeof(struct drm_crtc_state)); - state->crtcs[1].crtc_num = -1; - - state->crtcs->crtc_num = state->crtc_num; - state->crtcs->crtc_id = -1; - state->crtcs->gamma_size = -1; - state->crtcs->r_gamma = NULL; - state->crtcs->g_gamma = NULL; - state->crtcs->b_gamma = NULL; - } else { - int crtc_num; - state->crtcs = malloc((crtc_count + 1) * sizeof(struct drm_crtc_state)); - state->crtcs[crtc_count].crtc_num = -1; - for (crtc_num = 0; crtc_num < crtc_count; crtc_num++) { - state->crtcs[crtc_num].crtc_num = crtc_num; - state->crtcs[crtc_num].crtc_id = -1; - state->crtcs[crtc_num].gamma_size = -1; - state->crtcs[crtc_num].r_gamma = NULL; - state->crtcs[crtc_num].g_gamma = NULL; - state->crtcs[crtc_num].b_gamma = NULL; - } - } - - /* Load CRTC information and gamma ramps. */ - crtcs = state->crtcs; - for (; crtcs->crtc_num >= 0; crtcs++) { - drmModeCrtc *crtc_info; - crtcs->crtc_id = state->res->crtcs[crtcs->crtc_num]; - crtc_info = drmModeGetCrtc(state->fd, crtcs->crtc_id); - if (crtc_info == NULL) { - weprintf(_("CRTC %i lost, skipping"), crtcs->crtc_num); - continue; - } - crtcs->gamma_size = crtc_info->gamma_size; - drmModeFreeCrtc(crtc_info); - if (crtcs->gamma_size <= 1) { - weprintf(_("Could not get gamma ramp size for CRTC %i on graphics card" - " %i, ignoring device."), crtcs->crtc_num, state->card_num); - continue; - } - /* Valgrind complains about us reading uninitialize memory if we just use malloc. */ - crtcs->r_gamma = calloc(3 * crtcs->gamma_size, sizeof(uint16_t)); - crtcs->g_gamma = crtcs->r_gamma + crtcs->gamma_size; - crtcs->b_gamma = crtcs->g_gamma + crtcs->gamma_size; - if (crtcs->r_gamma) { - int r = drmModeCrtcGetGamma(state->fd, crtcs->crtc_id, crtcs->gamma_size, - crtcs->r_gamma, crtcs->g_gamma, crtcs->b_gamma); - if (r < 0) { - weprintf(_("DRM could not read gamma ramps on CRTC %i on graphics card" - " %i, ignoring device."), crtcs->crtc_num, state->card_num); - free(crtcs->r_gamma); - crtcs->r_gamma = NULL; - } - } else { - weprintf("malloc:"); - drmModeFreeResources(state->res); - state->res = NULL; - close(state->fd); - state->fd = -1; - while (crtcs-- != state->crtcs) - free(crtcs->r_gamma); - free(state->crtcs); - state->crtcs = NULL; - return -1; - } - } - - return 0; -} - - -static void -drm_restore(struct gamma_state *state) -{ - struct drm_crtc_state *crtcs = state->crtcs; - while (crtcs->crtc_num >= 0) { - if (crtcs->r_gamma) { - drmModeCrtcSetGamma(state->fd, crtcs->crtc_id, crtcs->gamma_size, - crtcs->r_gamma, crtcs->g_gamma, crtcs->b_gamma); - } - crtcs++; - } -} - - -static void -drm_free(struct gamma_state *state) -{ - if (state->crtcs) { - struct drm_crtc_state *crtcs = state->crtcs; - while (crtcs->crtc_num >= 0) { - free(crtcs->r_gamma); - crtcs->crtc_num = -1; - crtcs++; - } - free(state->crtcs); - state->crtcs = NULL; - } - if (state->res) { - drmModeFreeResources(state->res); - state->res = NULL; - } - if (state->fd >= 0) { - close(state->fd); - state->fd = -1; - } - - free(state); + return direct_create(state_out, LIBGAMMA_METHOD_LINUX_DRM, "drm"); } @@ -218,10 +33,9 @@ drm_print_help(FILE *f) fputs(_("Adjust gamma ramps with Direct Rendering Manager.\n"), f); fputs("\n", f); - /* TRANSLATORS: DRM help output - left column must not be translated */ - fputs(_(" card=N\tGraphics card to apply adjustments to\n" - " crtc=N\tCRTC to apply adjustments to\n"), f); /* TODO list is not supported */ + /* TRANSLATORS: DRM help output left column must not be translated */ + fputs(_(" card=N Graphics card to apply adjustments to\n"), f); + fputs(_(" crtc=N List of comma-separated CRTCs to apply adjustments to\n"), f); fputs("\n", f); } @@ -230,68 +44,18 @@ static int drm_set_option(struct gamma_state *state, const char *key, const char *value) { if (!strcasecmp(key, "card")) { - state->card_num = atoi(value); + return direct_set_partitions(state, key, value); } else if (!strcasecmp(key, "crtc")) { - if (!strcasecmp(value, "all")) { - state->crtc_num = -1; - } else { - state->crtc_num = atoi(value); - if (state->crtc_num < 0) { - weprintf(_("CRTC must be a non-negative integer")); - return -1; - } - } + return direct_set_crtcs(state, key, value); } else { weprintf(_("Unknown method parameter: `%s'."), key); return -1; } - - return 0; -} - - -static int -drm_apply(struct gamma_state *state, const struct colour_setting *setting, int preserve) -{ - struct drm_crtc_state *crtcs = state->crtcs; - uint32_t last_gamma_size = 0; - uint16_t *r_gamma = NULL; - uint16_t *g_gamma = NULL; - uint16_t *b_gamma = NULL; - uint16_t value; - uint32_t i, ramp_size; - - (void) preserve; /* TODO */ - - for (; crtcs->crtc_num >= 0; crtcs++) { - if (crtcs->gamma_size <= 1) - continue; - if (crtcs->gamma_size != last_gamma_size) { - if (crtcs->gamma_size > last_gamma_size) { - r_gamma = erealloc(r_gamma, 3 * crtcs->gamma_size * sizeof(uint16_t)); - g_gamma = r_gamma + crtcs->gamma_size; - b_gamma = g_gamma + crtcs->gamma_size; - } - last_gamma_size = crtcs->gamma_size; - } - - /* Initialize gamma ramps to pure state */ - ramp_size = crtcs->gamma_size; - for (i = 0; i < ramp_size; i++) { - value = (uint16_t)((double)i / (ramp_size - 1) * UINT16_MAX); - r_gamma[i] = value; - g_gamma[i] = value; - b_gamma[i] = value; - } - - fill_ramps_u16(r_gamma, g_gamma, b_gamma, crtcs->gamma_size, crtcs->gamma_size, crtcs->gamma_size, setting); - drmModeCrtcSetGamma(state->fd, crtcs->crtc_id, crtcs->gamma_size, r_gamma, g_gamma, b_gamma); - } - - free(r_gamma); - - return 0; } +#define drm_start direct_start +#define drm_apply direct_apply +#define drm_restore direct_restore +#define drm_free direct_free const struct gamma_method drm_gamma_method = GAMMA_METHOD_INIT("drm", 0, 0, drm); -- cgit v1.2.3-70-g09d2