Git Product home page Git Product logo

Comments (14)

mkoskar avatar mkoskar commented on June 8, 2024

RE: quiet output, I've obviously missed the -t option although the following warning goes to stdout instead of stderr:

VCP (aka MCCS) version for display is undetected or less than 2.0. Output may not be accurate.
VCP 10 ERR

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

mkoskar avatar mkoskar commented on June 8, 2024

I would expect first line (informational as you say) go to stderr and the real response VCP 10 ERR go to stdout. So that when inside the shell I can easily get only the response for parsing e.g., pwr=$(ddcutil -t -e "$edid" getvcp d6). I can filter the output for the last line of course but why not to benefit from stderr. If one needs all, there is always 2>&1. Well, just an idea.

What I do now is that I ignore output if I get exit status > 0 so:

if pwr=$(ddcutil -t -e "$edid" getvcp d6); then
    pwr=$(awk '{print $4}' <<<"$pwr")
    [[ $pwr = 'x05' ]] && continue
fi

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

mkoskar avatar mkoskar commented on June 8, 2024

Well for --verbose it's ok to dump everything to stdout because that's what user expects. You are right to say this is about output format, that is stdout format. I was just surprised to see that line there, I actually get it when interrogating my laptop's LVDS panel which obviously doesn't support DDC while still having i2c bus. It's design decision and that's ok with me, just thought I point it out ;).

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

mkoskar avatar mkoskar commented on June 8, 2024

No worries, I don't want to be nitpicking on details. My original point here was to point out that while ddcutil -e would work that is find display only by edid, loadvcp wouldn't and fail on assert but I concede I edited the file which is kinda dumb anyway :).

RE: format thing. Yes I get this when targeting LVDS monitor directly either by bus or by edid.
What I do now in my script is that I want to filter out monitors that are turned off, so I cycle through all outputs and call ddcutil for edid that I have from sysfs. Actually now I figured I can get i2c bus number too; for DP outputs it's directly under output node; the rest is under card node and I match it to the output by the name (e.g., i915 gmbus panel would be for LVDS-1 :| well it's not very nice but works and it's rather fast because I can use --nodetect).

$ ddcutil detect
Invalid display
   I2C bus:             /dev/i2c-2
   Supports DDC:        false
   EDID synopsis:
      Mfg id:           LEN
      Model:            Unspecified
      Serial number:    Unspecified
      Manufacture year: 2008
      EDID version:     1.3
   DDC communication failed

$ ddcutil -t -e <edid> getvcp d6
VCP (aka MCCS) version for display is undetected or less than 2.0. Output may not be accurate.
VCP D6 ERR

$ ddcutil -e <edid> getvcp d6
VCP (aka MCCS) version for display is undetected or less than 2.0. Output may not be accurate.
VCP code 0xd6 (Power mode                    ): Invalid response. status code=ENXIO(-6): No such device or address

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

mkoskar avatar mkoskar commented on June 8, 2024

Ok, cool. Thanks!

RE: I2C bus numbers

+0:drm$ pwd
/sys/class/drm

+0:drm$ ls -lad card0/card0-*
drwxr-xr-x 5 root root 0 Jul 30 22:15 card0/card0-DP-1
drwxr-xr-x 5 root root 0 Jul 30 22:15 card0/card0-DP-2
drwxr-xr-x 5 root root 0 Jul 30 22:15 card0/card0-DP-3
drwxr-xr-x 3 root root 0 Jul 30 22:15 card0/card0-HDMI-A-1
drwxr-xr-x 3 root root 0 Jul 30 22:15 card0/card0-HDMI-A-2
drwxr-xr-x 3 root root 0 Jul 30 22:15 card0/card0-HDMI-A-3
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/card0-LVDS-1
drwxr-xr-x 3 root root 0 Jul 30 22:15 card0/card0-VGA-1

+0:drm$ ls -lad card0/card0-*/i2c-*
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/card0-DP-1/i2c-6
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/card0-DP-2/i2c-7
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/card0-DP-3/i2c-8

+0:drm$ cat card0/card0-*/i2c-*/name
DPDDC-B
DPDDC-C
DPDDC-D

+0:drm$ ls -lad card0/device/i2c-*
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/device/i2c-0
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/device/i2c-1
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/device/i2c-2
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/device/i2c-3
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/device/i2c-4
drwxr-xr-x 4 root root 0 Jul 30 22:15 card0/device/i2c-5

+0:drm$ cat card0/device/i2c-*/name
i915 gmbus ssc
i915 gmbus vga
i915 gmbus panel
i915 gmbus dpc
i915 gmbus dpb
i915 gmbus dpd

So for whatever reason it seems DP outputs have their i2c associated directly underneath "output node" that is e.g., card0/card0-DP-1 sysfs path.

For the rest I've assumed simple translation table:

bus2out['i915 gmbus dpb']='HDMI-A-1'
bus2out['i915 gmbus dpc']='HDMI-A-2'
bus2out['i915 gmbus dpd']='HDMI-A-3'
bus2out['i915 gmbus panel']='LVDS-1'
bus2out['i915 gmbus vga']='VGA-1'

Here is the bash script where I'm using it.

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

mkoskar avatar mkoskar commented on June 8, 2024

Yep, I imagined it would be highly driver dependent ... it's kind of a hack really. Also doesn't make much sense to me why for i915 that direct association is done only for DP ports. Also interesting why nouveau wouldn't do it, no wonder about proprietary drivers though.

Anyway thanks for the info / and changes done. I guess we can close this issue then.

from ddcutil.

rockowitz avatar rockowitz commented on June 8, 2024

from ddcutil.

mkoskar avatar mkoskar commented on June 8, 2024

Yes, you're correct about DP ports. I've asked in #intel-gfx freenode channel and somebody explained to me that those i2c buses correspond to DP-aux channels. When I've inquired about why the other i2c buses aren't associated in similar fashion, I got congratulated that I'm most likely the first person to care and that they welcome patches :).

from ddcutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.