<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Helloworld sample for g2d in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896122#M135416</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Would anyone be able to supply a yocto recipe for a simple 'hello world' like application, that can access the G2D API?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have such a recipe to build a simple gstreamer application, but so far, I have not been able to figure out how to include the depends/links that would allow including access to the G2D api.&lt;/P&gt;&lt;P&gt;Ex: here is the recipe for the gstreamer recipe/application that works fine:&lt;/P&gt;&lt;P&gt;gstreamer1.0-app_1.0.0.bb:&lt;/P&gt;&lt;P&gt;SMMARY = "GStreamer app-1.0.0"&lt;BR /&gt;DESCRIPTION = "Gstreamer app-1.0.0"&lt;BR /&gt;SECTION = "apps"&lt;/P&gt;&lt;P&gt;inherit pkgconfig&lt;/P&gt;&lt;P&gt;DEPENDS = "glib-2.0 gstreamer1.0"&lt;BR /&gt;RDEPENDS_${PN} = "gstreamer1.0-plugins-base gstreamer1.0-plugins-good"&lt;/P&gt;&lt;P&gt;LICENSE = "MIT"&lt;BR /&gt;LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"&lt;/P&gt;&lt;P&gt;FILESEXTRAPATHS_prepend := "${THISDIR}/files:"&lt;/P&gt;&lt;P&gt;SRC_URI += " \&lt;BR /&gt; file://. \&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;inherit pkgconfig&lt;/P&gt;&lt;P&gt;do_compile() {&lt;BR /&gt; ${CXX} ${WORKDIR}/gst-app_1.cpp -o gst-app_1 ${CXXFLAGS} ${LDFLAGS} `pkg-config --cflags --libs gstreamer-1.0`&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;do_install() {&lt;BR /&gt; install -d ${D}${bindir}/&lt;BR /&gt; install -m 0755 ${S}/gst-app_1 ${D}${bindir}/&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;FILES_${PN} += " \&lt;BR /&gt; ${bindir}/ \&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in that dir, ./gstreamer1.0-app/gst-app_1.cpp contains:&lt;/P&gt;&lt;P&gt;#include &amp;lt;gst/gst.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(int argc, char *argv[]) {&lt;BR /&gt; GstElement *pipeline;&lt;BR /&gt; GstBus *bus;&lt;BR /&gt; GstMessage *msg;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Initialize GStreamer */&lt;BR /&gt; gst_init (&amp;amp;argc, &amp;amp;argv);&lt;/P&gt;&lt;P&gt;/* Build the pipeline */&lt;BR /&gt; pipeline = gst_parse_launch ("videotestsrc ! waylandsink name=mysink", NULL);&lt;/P&gt;&lt;P&gt;/* Start playing */&lt;BR /&gt; gst_element_set_state (pipeline, GST_STATE_PLAYING);&lt;/P&gt;&lt;P&gt;/* Wait until error or EOS */&lt;BR /&gt; bus = gst_element_get_bus (pipeline);&lt;BR /&gt; msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GstMessageType(GST_MESSAGE_ERROR | GST_MESSAGE_EOS) );&lt;/P&gt;&lt;P&gt;/* Free resources */&lt;BR /&gt; if (msg != NULL)&lt;BR /&gt; gst_message_unref (msg);&lt;BR /&gt; gst_object_unref (bus);&lt;BR /&gt; gst_element_set_state (pipeline, GST_STATE_NULL);&lt;BR /&gt; gst_object_unref (pipeline);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So instead of a gstreamer app, I would like to build an app source code file that uses G2D instead, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g2d-app_1.cpp:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "g2d.h"&lt;/P&gt;&lt;P&gt;int main(int argc, char *argv[]) {&lt;BR /&gt;void* handle;&lt;BR /&gt;g2d_open(&amp;amp;handle);&lt;/P&gt;&lt;P&gt;g2d_close(handle);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I just get errors that look like this:&lt;/P&gt;&lt;P&gt;Log data follows:&lt;BR /&gt;| DEBUG: Executing shell function do_compile&lt;BR /&gt;| /tmp/cciBbzfE.o: In function `main':&lt;BR /&gt;| ...gst-app_1.cpp:4: undefined reference to `g2d_open'&lt;BR /&gt;| ...gst-app_1.cpp:5: undefined reference to `g2d_close'&lt;BR /&gt;| collect2: error: ld returned 1 exit status&lt;BR /&gt;| WARNING: exit code 1 from a shell command.&lt;BR /&gt;| ERROR: Function failed: do_compile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Apr 2019 16:17:23 GMT</pubDate>
    <dc:creator>dan_searles</dc:creator>
    <dc:date>2019-04-15T16:17:23Z</dc:date>
    <item>
      <title>Helloworld sample for g2d</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896122#M135416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Would anyone be able to supply a yocto recipe for a simple 'hello world' like application, that can access the G2D API?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have such a recipe to build a simple gstreamer application, but so far, I have not been able to figure out how to include the depends/links that would allow including access to the G2D api.&lt;/P&gt;&lt;P&gt;Ex: here is the recipe for the gstreamer recipe/application that works fine:&lt;/P&gt;&lt;P&gt;gstreamer1.0-app_1.0.0.bb:&lt;/P&gt;&lt;P&gt;SMMARY = "GStreamer app-1.0.0"&lt;BR /&gt;DESCRIPTION = "Gstreamer app-1.0.0"&lt;BR /&gt;SECTION = "apps"&lt;/P&gt;&lt;P&gt;inherit pkgconfig&lt;/P&gt;&lt;P&gt;DEPENDS = "glib-2.0 gstreamer1.0"&lt;BR /&gt;RDEPENDS_${PN} = "gstreamer1.0-plugins-base gstreamer1.0-plugins-good"&lt;/P&gt;&lt;P&gt;LICENSE = "MIT"&lt;BR /&gt;LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"&lt;/P&gt;&lt;P&gt;FILESEXTRAPATHS_prepend := "${THISDIR}/files:"&lt;/P&gt;&lt;P&gt;SRC_URI += " \&lt;BR /&gt; file://. \&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;inherit pkgconfig&lt;/P&gt;&lt;P&gt;do_compile() {&lt;BR /&gt; ${CXX} ${WORKDIR}/gst-app_1.cpp -o gst-app_1 ${CXXFLAGS} ${LDFLAGS} `pkg-config --cflags --libs gstreamer-1.0`&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;do_install() {&lt;BR /&gt; install -d ${D}${bindir}/&lt;BR /&gt; install -m 0755 ${S}/gst-app_1 ${D}${bindir}/&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;FILES_${PN} += " \&lt;BR /&gt; ${bindir}/ \&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in that dir, ./gstreamer1.0-app/gst-app_1.cpp contains:&lt;/P&gt;&lt;P&gt;#include &amp;lt;gst/gst.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(int argc, char *argv[]) {&lt;BR /&gt; GstElement *pipeline;&lt;BR /&gt; GstBus *bus;&lt;BR /&gt; GstMessage *msg;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Initialize GStreamer */&lt;BR /&gt; gst_init (&amp;amp;argc, &amp;amp;argv);&lt;/P&gt;&lt;P&gt;/* Build the pipeline */&lt;BR /&gt; pipeline = gst_parse_launch ("videotestsrc ! waylandsink name=mysink", NULL);&lt;/P&gt;&lt;P&gt;/* Start playing */&lt;BR /&gt; gst_element_set_state (pipeline, GST_STATE_PLAYING);&lt;/P&gt;&lt;P&gt;/* Wait until error or EOS */&lt;BR /&gt; bus = gst_element_get_bus (pipeline);&lt;BR /&gt; msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GstMessageType(GST_MESSAGE_ERROR | GST_MESSAGE_EOS) );&lt;/P&gt;&lt;P&gt;/* Free resources */&lt;BR /&gt; if (msg != NULL)&lt;BR /&gt; gst_message_unref (msg);&lt;BR /&gt; gst_object_unref (bus);&lt;BR /&gt; gst_element_set_state (pipeline, GST_STATE_NULL);&lt;BR /&gt; gst_object_unref (pipeline);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So instead of a gstreamer app, I would like to build an app source code file that uses G2D instead, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g2d-app_1.cpp:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "g2d.h"&lt;/P&gt;&lt;P&gt;int main(int argc, char *argv[]) {&lt;BR /&gt;void* handle;&lt;BR /&gt;g2d_open(&amp;amp;handle);&lt;/P&gt;&lt;P&gt;g2d_close(handle);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far, I just get errors that look like this:&lt;/P&gt;&lt;P&gt;Log data follows:&lt;BR /&gt;| DEBUG: Executing shell function do_compile&lt;BR /&gt;| /tmp/cciBbzfE.o: In function `main':&lt;BR /&gt;| ...gst-app_1.cpp:4: undefined reference to `g2d_open'&lt;BR /&gt;| ...gst-app_1.cpp:5: undefined reference to `g2d_close'&lt;BR /&gt;| collect2: error: ld returned 1 exit status&lt;BR /&gt;| WARNING: exit code 1 from a shell command.&lt;BR /&gt;| ERROR: Function failed: do_compile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2019 16:17:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896122#M135416</guid>
      <dc:creator>dan_searles</dc:creator>
      <dc:date>2019-04-15T16:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Helloworld sample for g2d</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896123#M135417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer to chapter 8.2 G2D-imx-samples of i.MX LinuxÂ® User's Guide.&lt;BR /&gt;Also please refer Yuri's thread regarding to g2d example:&lt;BR /&gt;&lt;A href="https://community.nxp.com/thread/382621#comment-609269" target="test_blank"&gt;https://community.nxp.com/thread/382621#comment-609269&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 06:40:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896123#M135417</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2019-04-16T06:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Helloworld sample for g2d</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896124#M135418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have see those references and they do not answer the question I am asking.&lt;/P&gt;&lt;P&gt;Is it the case that there is no way to reference the g2d API from a recipe as I am asking?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 13:15:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896124#M135418</guid>
      <dc:creator>dan_searles</dc:creator>
      <dc:date>2019-04-16T13:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Helloworld sample for g2d</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896125#M135419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="330011" data-username="dan.searles@garmin.com" href="https://community.nxp.com/people/dan.searles@garmin.com"&gt;Dan Searles&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can able to compile the g2d based application successfully in yocto_sumo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the .bb file that we are using :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUMMARY = "Simple helloworld application"&lt;BR /&gt;SECTION = "examples"&lt;BR /&gt;inherit pkgconfig&lt;BR /&gt;DEPENDS = "glib-2.0 virtual/libg2d"&lt;BR /&gt;LICENSE = "MIT"&lt;BR /&gt;LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"&lt;BR /&gt;SRC_URI = "file://helloworld.c"&lt;BR /&gt;S = "${WORKDIR}"&lt;BR /&gt;do_compile() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ${CC} helloworld.c -o helloworld_new -lg2d&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do_install() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; install -d ${D}${bindir}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; install -m 0755 helloworld ${D}${bindir}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try with this. We don't know which version of yocto you are using. Let us know if you want us to run g2d application on a specific version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Radhika Somaiya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 06:31:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896125#M135419</guid>
      <dc:creator>radhikasomaiya</dc:creator>
      <dc:date>2019-05-08T06:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Helloworld sample for g2d</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896126#M135420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;The g2d lib being referenced as 'virtual/libg2d' indicates that there may be other means of being provided. On my platform, it ended up being through recipe&amp;nbsp;imx-dpu-g2d (vs&amp;nbsp;imx-gpu-g2d). In the future, -lg2d may be the way to link the library regardless, but at the moment, I needed -lg2d-dpu -ldrm, and I had to add 'drm' to the end of the DEPENDS. Also in the future, it seems likely that a '.pc' package file may be used to make the reference more generic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 12:43:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Helloworld-sample-for-g2d/m-p/896126#M135420</guid>
      <dc:creator>dan_searles</dc:creator>
      <dc:date>2019-05-08T12:43:04Z</dc:date>
    </item>
  </channel>
</rss>

